kernel_optimize_test/tools/include
Jakub Sitnicki 042fb1c281 selftests/bpf: Extend verifier and bpf_sock tests for dst_port loads
commit 8f50f16ff39dd4e2d43d1548ca66925652f8aff7 upstream.

Add coverage to the verifier tests and tests for reading bpf_sock fields to
ensure that 32-bit, 16-bit, and 8-bit loads from dst_port field are allowed
only at intended offsets and produce expected values.

While 16-bit and 8-bit access to dst_port field is straight-forward, 32-bit
wide loads need be allowed and produce a zero-padded 16-bit value for
backward compatibility.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/r/20220130115518.213259-3-jakub@cloudflare.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
[OP: backport to 5.10: adjusted context in sock_fields.c]
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-11 13:06:44 +02:00
..
asm tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' - again 2022-07-25 11:26:56 +02:00
asm-generic
linux tools headers: Remove broken definition of __LITTLE_ENDIAN 2022-07-25 11:26:56 +02:00
nolibc tools/nolibc: fix incorrect truncation of exit code 2022-01-27 10:53:42 +01:00
tools
trace/events
uapi selftests/bpf: Extend verifier and bpf_sock tests for dst_port loads 2022-08-11 13:06:44 +02:00
vdso