aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_prog_array_init.c
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2022-02-02 14:13:15 -0800
committerKees Cook <[email protected]>2022-02-13 16:48:04 -0800
commit545c272232caded141abb273745091d6a0d8b14b (patch)
tree091251f61e02f2712f02da2daeb50fa2426cf061 /tools/testing/selftests/bpf/progs/test_prog_array_init.c
parent2a55550fbba643f41318bb12ab20e6510c7df231 (diff)
alpha: Silence -Warray-bounds warnings
GCC 11 (incorrectly[1]) assumes that literal values cast to (void *) should be treated like a NULL pointer with an offset, and raises diagnostics when doing bounds checking: In function '__memset', inlined from '__bad_pagetable' at arch/alpha/mm/init.c:79:2: ./arch/alpha/include/asm/string.h:37:32: error: '__builtin_memset' offset [0, 8191] is out of the bounds [0, 0] [-Werror=array-bounds] 37 | return __builtin_memset(s, c, n); | ^~~~~~~~~~~~~~~~~~~~~~~~~ In function '__memset', inlined from '__bad_page' at arch/alpha/mm/init.c:86:2: ./arch/alpha/include/asm/string.h:37:32: error: '__builtin_memset' offset [0, 8191] is out of the bounds [0, 0] [-Werror=array-bounds] 37 | return __builtin_memset(s, c, n); | ^~~~~~~~~~~~~~~~~~~~~~~~~ In function '__memset', inlined from 'paging_init' at arch/alpha/mm/init.c:256:2: ./arch/alpha/include/asm/string.h:37:32: error: '__builtin_memset' offset [0, 8191] is out of the bounds [0, 0] [-Werror=array-bounds] 37 | return __builtin_memset(s, c, n); This has been solved in other places[2] already by using the recently added absolute_pointer() macro. Do the same here. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 [2] https://lore.kernel.org/all/[email protected]/ Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Reviewed-and-tested-by: Guenter Roeck <[email protected]> Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_prog_array_init.c')
0 files changed, 0 insertions, 0 deletions