• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
2To: bpf@vger.kernel.org
3Cc: Alexei Starovoitov <ast@kernel.org>,
4	Daniel Borkmann <daniel@iogearbox.net>,
5	Andrii Nakryiko <andrii@kernel.org>
6Subject: [PATCH bpf-next] selftests/bpf: Fix OOB write in test_verifier
7Date: Tue, 14 Dec 2021 07:18:00 +0530	[thread overview]
8Message-ID: <20211214014800.78762-1-memxor@gmail.com> (raw)
9
10The commit referenced below added fixup_map_timer support (to create a
11BPF map containing timers), but failed to increase the size of the
12map_fds array, leading to out of bounds write. Fix this by changing
13MAX_NR_MAPS to 22.
14
15Fixes: e60e6962c503 ("selftests/bpf: Add tests for restricted helpers")
16Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
17---
18 tools/testing/selftests/bpf/test_verifier.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
22index ad5d30bafd93..33e2ecb3bef9 100644
23--- a/tools/testing/selftests/bpf/test_verifier.c
24+++ b/tools/testing/selftests/bpf/test_verifier.c
25@@ -54,7 +54,7 @@
26 #define MAX_INSNS	BPF_MAXINSNS
27 #define MAX_TEST_INSNS	1000000
28 #define MAX_FIXUPS	8
29-#define MAX_NR_MAPS	21
30+#define MAX_NR_MAPS	22
31 #define MAX_TEST_RUNS	8
32 #define POINTER_VALUE	0xcafe4all
33 #define TEST_DATA_LEN	64
34--
352.34.1
36