Re: [PATCH bpf-next 2/2] selftests/bpf: Test invalid narrower ctx load

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2025-07-21 at 15:02 +0200, Paul Chaignon wrote:
> This patch adds two selftests to cover invalid narrower loads on the
> context. These used to cause kernel warning before the previous patch.
> To trigger the warning, the load had to be aligned, to read an affected
> pointer field (ex., skb->sk), and not starting at the beginning of the
> pointer field. The new selftests show two such loads of 1B and 4B sizes.
> 
> Signed-off-by: Paul Chaignon <paul.chaignon@xxxxxxxxx>
> ---

Since we hit a bug here, I think it would be nice to have a test case
for each buggy field if that could be done in a terse way.
Wrapping `invalid_narrow_skb_sk_load` here in a macro and stamping a
few instances seem to be sufficient.

[...]





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux