diff mbox series

[bpf] selftests/bpf: Fix cgroup sockopt verifier test

Message ID 20200710150439.126627-1-jean-philippe@linaro.org
State Accepted
Commit 55b244221c3f17eb2ed51c8e39e4a01c523e4eee
Headers show
Series [bpf] selftests/bpf: Fix cgroup sockopt verifier test | expand

Commit Message

Jean-Philippe Brucker July 10, 2020, 3:04 p.m. UTC
Since the BPF_PROG_TYPE_CGROUP_SOCKOPT verifier test does not set an
attach type, bpf_prog_load_check_attach() disallows loading the program
and the test is always skipped:

 #434/p perfevent for cgroup sockopt SKIP (unsupported program type 25)

Fix the issue by setting a valid attach type.

Fixes: 0456ea170cd6 ("bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT}")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

---
 tools/testing/selftests/bpf/verifier/event_output.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.27.0

Comments

Daniel Borkmann July 10, 2020, 11:34 p.m. UTC | #1
On 7/10/20 5:04 PM, Jean-Philippe Brucker wrote:
> Since the BPF_PROG_TYPE_CGROUP_SOCKOPT verifier test does not set an

> attach type, bpf_prog_load_check_attach() disallows loading the program

> and the test is always skipped:

> 

>   #434/p perfevent for cgroup sockopt SKIP (unsupported program type 25)

> 

> Fix the issue by setting a valid attach type.

> 

> Fixes: 0456ea170cd6 ("bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT}")

> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>


Applied, thanks!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/verifier/event_output.c b/tools/testing/selftests/bpf/verifier/event_output.c
index 99f8f582c02b..c5e805980409 100644
--- a/tools/testing/selftests/bpf/verifier/event_output.c
+++ b/tools/testing/selftests/bpf/verifier/event_output.c
@@ -112,6 +112,7 @@ 
 	"perfevent for cgroup sockopt",
 	.insns =  { __PERF_EVENT_INSNS__ },
 	.prog_type = BPF_PROG_TYPE_CGROUP_SOCKOPT,
+	.expected_attach_type = BPF_CGROUP_SETSOCKOPT,
 	.fixup_map_event_output = { 4 },
 	.result = ACCEPT,
 	.retval = 1,