aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
diff options
context:
space:
mode:
authorDaniel Xu <[email protected]>2025-02-04 17:25:16 +0000
committerAlexei Starovoitov <[email protected]>2025-02-07 23:45:43 +0000
commit884c3a18dadfda326dffa364477cc027728219de (patch)
treea9e30069042f2eb97c2f2c4f802408f0aa2ac3d4 /tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
parentbpf: Fix softlockup in arena_map_free on 64k page kernel (diff)
downloadkernel-884c3a18dadfda326dffa364477cc027728219de.tar.gz
kernel-884c3a18dadfda326dffa364477cc027728219de.zip
bpf: verifier: Do not extract constant map keys for irrelevant maps
Previously, we were trying to extract constant map keys for all bpf_map_lookup_elem(), regardless of map type. This is an issue if the map has a u64 key and the value is very high, as it can be interpreted as a negative signed value. This in turn is treated as an error value by check_func_arg() which causes a valid program to be incorrectly rejected. Fix by only extracting constant map keys for relevant maps. This fix works because nullness elision is only allowed for {PERCPU_}ARRAY maps, and keys for these are within u32 range. See next commit for an example via selftest. Acked-by: Eduard Zingerman <[email protected]> Reported-by: Marc Hartmayer <[email protected]> Reported-by: Ilya Leoshkevich <[email protected]> Tested-by: Marc Hartmayer <[email protected]> Signed-off-by: Daniel Xu <[email protected]> Link: https://lore.kernel.org/r/aa868b642b026ff87ba6105ea151bc8693b35932.1738689872.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockmap_basic.c')
0 files changed, 0 insertions, 0 deletions