bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf] selftests/bpf: Set attach type for CGROUP_SOCKOPT verifier test
@ 2020-07-10 16:49 Jakub Sitnicki
  2020-07-10 16:52 ` Jakub Sitnicki
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Sitnicki @ 2020-07-10 16:49 UTC (permalink / raw)
  To: bpf
  Cc: netdev, kernel-team, Alexei Starovoitov, Daniel Borkmann,
	Stanislav Fomichev

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 <sdf@google.com>
Fixes: 0456ea170cd6 ("bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT}")
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
---
 tools/testing/selftests/bpf/verifier/event_output.c | 1 +
 1 file changed, 1 insertion(+)

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,
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH bpf] selftests/bpf: Set attach type for CGROUP_SOCKOPT verifier test
  2020-07-10 16:49 [PATCH bpf] selftests/bpf: Set attach type for CGROUP_SOCKOPT verifier test Jakub Sitnicki
@ 2020-07-10 16:52 ` Jakub Sitnicki
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Sitnicki @ 2020-07-10 16:52 UTC (permalink / raw)
  To: Jakub Sitnicki, bpf
  Cc: netdev, kernel-team, Alexei Starovoitov, Daniel Borkmann,
	Stanislav Fomichev

On Fri, 10 Jul 2020 16:49:17 +0000
Jakub Sitnicki <jakub@cloudflare.com> wrote:

> 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 <sdf@google.com>
> Fixes: 0456ea170cd6 ("bpf: Enable more helpers for BPF_PROG_TYPE_CGROUP_{DEVICE,SYSCTL,SOCKOPT}")
> Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
> ---
>  tools/testing/selftests/bpf/verifier/event_output.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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,

Just noticed same fix has been already posted a couple hours earlier:

  https://lore.kernel.org/bpf/20200710150439.126627-1-jean-philippe@linaro.org/

Please ignore.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-10 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 16:49 [PATCH bpf] selftests/bpf: Set attach type for CGROUP_SOCKOPT verifier test Jakub Sitnicki
2020-07-10 16:52 ` Jakub Sitnicki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).