OSDN Git Service

bpf: fix test suite to enable all unpriv program types
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 2 Jun 2021 03:27:45 +0000 (11:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 11:24:07 +0000 (13:24 +0200)
commit1b5c4b0669e0a63c9e5345c42ff6329a9001c207
tree3e3a8c63f0cd96c479ccef1831b7120d483ee8b8
parent7de60c2d5a2a66ef2c5d76952a5a3a9a4ea4d436
bpf: fix test suite to enable all unpriv program types

commit 36641ad61db5ce9befd5eb0071abb36eaff16cfc upstream

Given BPF_PROG_TYPE_CGROUP_SKB program types are also valid in an
unprivileged setting, lets not omit these tests and potentially
have issues fall through the cracks. Make this more obvious by
adding a small test_as_unpriv() helper.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/test_verifier.c