mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
selftests/bpf: Tests for uninitialized stack reads
Three testcases to make sure that stack reads from uninitialized locations are accepted by verifier when executed in privileged mode: - read from a fixed offset; - read from a variable offset; - passing a pointer to stack to a helper converts STACK_INVALID to STACK_MISC. Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20230219200427.606541-3-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
committed by
Alexei Starovoitov
parent
6715df8d5d
commit
6338a94d5a
9
tools/testing/selftests/bpf/prog_tests/uninit_stack.c
Normal file
9
tools/testing/selftests/bpf/prog_tests/uninit_stack.c
Normal file
@@ -0,0 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include <test_progs.h>
|
||||
#include "uninit_stack.skel.h"
|
||||
|
||||
void test_uninit_stack(void)
|
||||
{
|
||||
RUN_TESTS(uninit_stack);
|
||||
}
|
||||
Reference in New Issue
Block a user