bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf] selftests/bpf: Fix cgroup sockopt verifier test
@ 2020-07-10 15:04 Jean-Philippe Brucker
  2020-07-10 16:54 ` Jakub Sitnicki
  2020-07-10 23:34 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Jean-Philippe Brucker @ 2020-07-10 15:04 UTC (permalink / raw)
  To: bpf
  Cc: netdev, linux-kselftest, shuah, ast, daniel, kafai,
	songliubraving, yhs, andriin, john.fastabend, kpsingh, sdf,
	Jean-Philippe Brucker

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(+)

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.27.0


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

* Re: [PATCH bpf] selftests/bpf: Fix cgroup sockopt verifier test
  2020-07-10 15:04 [PATCH bpf] selftests/bpf: Fix cgroup sockopt verifier test Jean-Philippe Brucker
@ 2020-07-10 16:54 ` Jakub Sitnicki
  2020-07-10 23:34 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Sitnicki @ 2020-07-10 16:54 UTC (permalink / raw)
  To: Jean-Philippe Brucker, bpf
  Cc: netdev, linux-kselftest, shuah, ast, daniel, kafai,
	songliubraving, yhs, andriin, john.fastabend, kpsingh, sdf

On Fri, 10 Jul 2020 17:04:40 +0200
Jean-Philippe Brucker <jean-philippe@linaro.org> 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>
> ---
>  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,

Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>

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

* Re: [PATCH bpf] selftests/bpf: Fix cgroup sockopt verifier test
  2020-07-10 15:04 [PATCH bpf] selftests/bpf: Fix cgroup sockopt verifier test Jean-Philippe Brucker
  2020-07-10 16:54 ` Jakub Sitnicki
@ 2020-07-10 23:34 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2020-07-10 23:34 UTC (permalink / raw)
  To: Jean-Philippe Brucker, bpf
  Cc: netdev, linux-kselftest, shuah, ast, kafai, songliubraving, yhs,
	andriin, john.fastabend, kpsingh, sdf

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!

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 15:04 [PATCH bpf] selftests/bpf: Fix cgroup sockopt verifier test Jean-Philippe Brucker
2020-07-10 16:54 ` Jakub Sitnicki
2020-07-10 23:34 ` Daniel Borkmann

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).