Thread (2 messages) 2 messages, 2 authors, 2021-12-20

Re: [PATCH bpf-next] selftests/bpf: Fix map_fds buffer overflow in test_verifier

From: Yonghong Song <hidden>
Date: 2021-12-20 15:46:15


On 12/20/21 6:04 AM, Ilya Leoshkevich wrote:
quoted hunk ↗ jump to hunk
do_test_fixup() accesses map_fds[21], which is out of bounds. Extend
map_fds array to 22 elements.

Fixes: e60e6962c503 ("selftests/bpf: Add tests for restricted helpers")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
  tools/testing/selftests/bpf/test_verifier.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
index b0bd2a1f6d52..76cd903117af 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -53,7 +53,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
The patch has been fixed by:
   https://lore.kernel.org/bpf/20211214014800.78762-1-memxor@gmail.com/ (local)
and merged into bpf tree. It should circulate back to bpf-next later
when the patch goes from bpf->net->linus->net-next->bpf-next.
  #define MAX_TEST_RUNS	8
  #define POINTER_VALUE	0xcafe4all
  #define TEST_DATA_LEN	64
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help