Re: [PATCH] capability: test_deny_namespace breakage due to capability conversion to u64

From: Alexei Starovoitov
Date: Fri Mar 24 2023 - 15:49:11 EST


On Fri, Mar 24, 2023 at 9:49 AM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Fri, Mar 24, 2023 at 5:36 AM Sasha Levin <sashal@xxxxxxxxxx> wrote:
> >
> > Commit f122a08b197d ("capability: just use a 'u64' instead of a 'u32[2]'
> > array") attempts to use BIT_LL() but actually wanted to use BIT_ULL(),
> > fix it up to make the test compile and run again.

It would only fix the compilation error, but the test would still fail.

> This got fixed differently by e8c8361cfdbf ("selftests/bpf: Fix
> progs/test_deny_namespace.c issues").

exactly. It's not just the macro that had to be adjusted.

> I wonder what drugs made me think BIT_LL() was ok. Maybe my wife puts
> something in the coffee?

$ make C=2 kernel/bpf/core.o
kernel/bpf/core.c:1822:43: error: arithmetics on pointers to functions
kernel/bpf/core.c:1827:48: error: arithmetics on pointers to functions
kernel/bpf/core.c:2073:77: error: subtraction of functions? Share your drugs

:)