Skip to contentSkip to conversation

bpf, selftests: Adjust few selftest result_unpriv outcomes

PATCH In review Shaoying Xu 2 participants 2 messages Jun 1, 2021 – Jun 8, 2021 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf, selftests: Adjust few selftest result_unpriv outcomes

From: Daniel Borkmann <[email protected]>

commit 1bad6fd52be4ce12d207e2820ceb0f29ab31fc53 upstream

Given we don't need to simulate the speculative domain for registers with immediates anymore since the verifier uses direct imm-based rewrites instead of having to mask, we can also lift a few cases that were previously rejected.

---
 tools/testing/selftests/bpf/verifier/stack_ptr.c       | 2 --
 tools/testing/selftests/bpf/verifier/value_ptr_arith.c | 8 --------
 2 files changed, 10 deletions(-)
tools/testing/selftests/bpf/verifier/stack_ptr.c +0 -2
index 7276620ef242..53d2a5a5ec58 100644
@@ -291,8 +291,6 @@
 	BPF_LDX_MEM(BPF_B, BPF_REG_0, BPF_REG_1, 0),
 	BPF_EXIT_INSN(),
 	},
-	.result_unpriv = REJECT,
-	.errstr_unpriv = "invalid stack off=0 size=1",
 	.result = ACCEPT,
 	.retval = 42,
 },
tools/testing/selftests/bpf/verifier/value_ptr_arith.c +0 -8
index 28d44e6aa0b7..f9c91b95080e 100644
@@ -300,8 +300,6 @@
 	},
 	.fixup_map_array_48b = { 3 },
 	.result = ACCEPT,
-	.result_unpriv = REJECT,
-	.errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
 	.retval = 1,
 },
 {
@@ -371,8 +369,6 @@
 	},
 	.fixup_map_array_48b = { 3 },
 	.result = ACCEPT,
-	.result_unpriv = REJECT,
-	.errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
 	.retval = 1,
 },
 {
@@ -472,8 +468,6 @@
 	},
 	.fixup_map_array_48b = { 3 },
 	.result = ACCEPT,
-	.result_unpriv = REJECT,
-	.errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
 	.retval = 1,
 },
 {
@@ -766,8 +760,6 @@
 	},
 	.fixup_map_array_48b = { 3 },
 	.result = ACCEPT,
-	.result_unpriv = REJECT,
-	.errstr_unpriv = "R0 pointer arithmetic of map value goes out of range",
 	.retval = 1,
 },
 {
Signature · 1 line
2.16.6
maintainer
#1 lore raw
Quoted 11 lines · Shaoying Xu

From: Daniel Borkmann <[email protected]>

commit 1bad6fd52be4ce12d207e2820ceb0f29ab31fc53 upstream

Given we don't need to simulate the speculative domain for registers with immediates anymore since the verifier uses direct imm-based rewrites instead of having to mask, we can also lift a few cases that were previously rejected.

[[email protected] - backport to 5.4 with small contextual change]

What about 5.10 and 5.12, why wouldn't they also need this?

thanks,

greg k-h