Skip to contentSkip to conversation

bpf: fix segfault in test_verifier selftest

PATCH Applied Daniel Borkmann 2 participants 2 messages Dec 21, 2018

Subsystems (5)
lore
Share & tools
lore

Daniel Borkmann

author maintainer
#0 lore raw

PATCH 1/1 bpf: fix segfault in test_verifier selftest

Minor fallout from merge resolution, test_verifier was segfaulting because the REJECT result was correct, but errstr was NULL. Properly fix it as in 339bbff2d6e0.

Fixes 339bbff2d6e0 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next")

---
[ Hi David, would be great if you could take it directly, thanks! ]

 tools/testing/selftests/bpf/test_verifier.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/test_verifier.c +2 -1
index baafe5c76aca..33f7d38849b8 100644
@@ -14194,7 +14194,8 @@ static struct bpf_test tests[] = {
 		},
 		.prog_type = BPF_PROG_TYPE_SOCKET_FILTER,
 		.errstr_unpriv = "function calls to other bpf functions are allowed for root only",
-                .result = REJECT,
+		.errstr = "!read_ok",
+		.result = REJECT,
 	},
 	{
 		"jset: functional",
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

From: Daniel Borkmann <[email protected]>
Date: Fri, 21 Dec 2018 14:04:46 +0100

Quoted 8 lines

Minor fallout from merge resolution, test_verifier was segfaulting because the REJECT result was correct, but errstr was NULL. Properly fix it as in 339bbff2d6e0.

Fixes 339bbff2d6e0 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next")

---
[ Hi David, would be great if you could take it directly, thanks! ]

I'll learn how to resolve conflicts properly some day :-)

Applied, thanks Daniel.