selftests/bpf: Fix OOB write in test_verifier
Subsystems (3)
Kumar Kartikeya Dwivedi
maintainerPATCH 1/1 selftests/bpf: Fix OOB write in test_verifier
The commit referenced below added fixup_map_timer support (to create a BPF map containing timers), but failed to increase the size of the map_fds array, leading to out of bounds write. Fix this by changing MAX_NR_MAPS to 22.
Fixes e60e6962c503 ("selftests/bpf: Add tests for restricted helpers")
Signed-off-by Kumar Kartikeya Dwivedi <[email protected]>
--- tools/testing/selftests/bpf/test_verifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/test_verifier.c +1 -1
@@ -54,7 +54,7 @@#define MAX_INSNS BPF_MAXINSNS#define MAX_TEST_INSNS 1000000#define MAX_FIXUPS 8 -#define MAX_NR_MAPS 21 +#define MAX_NR_MAPS 22#define MAX_TEST_RUNS 8#define POINTER_VALUE 0xcafe4all#define TEST_DATA_LEN 64
--
2.34.1
This patch was applied to bpf/bpf.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <[email protected]>:
Quoted 9 lines · On Tue, 14 Dec 2021 07:18:00 +0530 you wrote:
The commit referenced below added
fixup_map_timersupport (to create a BPF map containing timers), but failed to increase the size of themap_fdsarray, leading to out of bounds write. Fix this by changingMAX_NR_MAPSto 22.Fixes e60e6962c503 ("selftests/bpf: Add tests for restricted helpers")Signed-off-by Kumar Kartikeya Dwivedi <[email protected]>[...]
Here is the summary with links:
- [bpf-next] selftests/bpf: Fix OOB write in test_verifier
https://git.kernel.org/bpf/bpf/c/f7abc4c8df8c
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html