selftests/bpf: Fix cgroup sockopt verifier test
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Fri, 10 Jul 2020 15:04:40 +0000 (17:04 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 10 Jul 2020 23:32:15 +0000 (01:32 +0200)
commit55b244221c3f17eb2ed51c8e39e4a01c523e4eee
tree4c990166cbf8213a7aab7b6ee0e9cd1715be62d4
parentc8b1d7436045d3599bae56aef1682813ecccaad7
selftests/bpf: Fix cgroup sockopt verifier test

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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20200710150439.126627-1-jean-philippe@linaro.org
tools/testing/selftests/bpf/verifier/event_output.c