[LTP] [PATCH v2 4/4] bpf_prog05: Drop CAP_BPF and check if ptr arithmetic is allowed

Richard Palethorpe rpalethorpe@suse.de
Mon Jan 17 16:11:22 CET 2022


Hello Joerg,

> I did some more digging and bisecting. First I bisected the mainline
> kernel and found, that the commit 2c78ee898 ("bpf: Implement CAP_BPF")
> makes the check run successful. This is only in linux >= 5.8.
> But my 5.4 ubuntu kernel also successfully ran the check, so I also
> bisected ubuntu sources [1] and found this commit to be the fix here:
> 2fa9ab45c ("bpf: No need to simulate speculative domain for immediates")
> This commit is also in the mainline kernel, but only in >= 5.13.

Uffff, interesting, some of the things mentioned in this commit seem
familiar. I did start working on other BPF reproducers, but gave up for
the time being.

>
> I guess the check you implemented now disables the test for a lot of
> kernels, that do not have a patch like this... I will stop here and just
> accept, that the test is not running successfully in my case. But still
> wanted to share this information.

Thanks, yes this could be useful.

>
> Joerg
>
>
> [1]
> https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal/commit/?id=2fa9ab45c53e8b104ba8f7d3a953131cc818fcc0


-- 
Thank you,
Richard.


More information about the ltp mailing list