selftests/bpf: Set attach type for CGROUP_SOCKOPT verifier test
Subsystems (5)
PATCH 1/1 selftests/bpf: Set attach type for CGROUP_SOCKOPT verifier test
BPF_PROG_TYPE_CGROUP_SOCKOPT requires expected_attach_type to be set on prog load. Set it in the verifier test that checks if calling bpf_perf_event_output() from CGROUP_SOCKOPT is allowed so that the runner does skip it.
Cc Stanislav Fomichev <[email protected]>
Fixes 0456ea170cd6 ("bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT}")
Signed-off-by Jakub Sitnicki <[email protected]>
--- tools/testing/selftests/bpf/verifier/event_output.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/verifier/event_output.c +1 -0
@@ -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,
Signature · 1 line
2.25.4
Quoted 17 lines · On Fri, 10 Jul 2020 16:49:17 +0000 Jakub Sitnicki <[email protected]> wrote:
BPF_PROG_TYPE_CGROUP_SOCKOPTrequiresexpected_attach_typeto be set on prog load. Set it in the verifier test that checks if callingbpf_perf_event_output()fromCGROUP_SOCKOPTis allowed so that the runner does skip it.Cc Stanislav Fomichev <[email protected]>Fixes 0456ea170cd6 ("bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT}")Signed-off-by Jakub Sitnicki <[email protected]>--- tools/testing/selftests/bpf/verifier/event_output.c | 1 + 1 file changed, 1 insertion(+)tools/testing/selftests/bpf/verifier/event_output.c +0
-0
tools/testing/selftests/bpf/verifier/event_output.c line 118
Quoted 7 lines
tools/testing/selftests/bpf/verifier/event_output.c +1
-0@@ -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,
Just noticed same fix has been already posted a couple hours earlier:
https://lore.kernel.org/bpf/[email protected]/
Please ignore.