aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_autoload.c
diff options
context:
space:
mode:
authorJohn Fastabend <[email protected]>2020-06-23 03:22:23 +0000
committerDaniel Borkmann <[email protected]>2020-06-23 22:04:36 +0000
commit2fde1747c986cac28fa66d0cffd7577db042640b (patch)
treeb63ed51d2ae66d7a8aea24308b6de2041440c8e9 /tools/testing/selftests/bpf/progs/test_autoload.c
parentselftests/bpf: Add variable-length data concatenation pattern test (diff)
downloadkernel-2fde1747c986cac28fa66d0cffd7577db042640b.tar.gz
kernel-2fde1747c986cac28fa66d0cffd7577db042640b.zip
selftests/bpf: Add variable-length data concat pattern less than test
Extend original variable-length tests with a case to catch a common existing pattern of testing for < 0 for errors. Note because verifier also tracks upper bounds and we know it can not be greater than MAX_LEN here we can skip upper bound check. In ALU64 enabled compilation converting from long->int return types in probe helpers results in extra instruction pattern, <<= 32, s >>= 32. The trade-off is the non-ALU64 case works. If you really care about every extra insn (XDP case?) then you probably should be using original int type. In addition adding a sext insn to bpf might help the verifier in the general case to avoid these types of tricks. Signed-off-by: John Fastabend <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions