public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [bpf-next] bpf: Add CAP_NET_ADMIN for sk_lookup program type
@ 2022-01-30  3:03 He Fengqing
  2022-01-30  3:24 ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: He Fengqing @ 2022-01-30  3:03 UTC (permalink / raw)
  To: netdev, bpf, linux-kernel
  Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend

SK_LOOKUP program type was introduced in commit e9ddbb7707ff
("bpf: Introduce SK_LOOKUP program type with a dedicated attach point"),
but the commit did not add SK_LOOKUP program type in net admin prog type.
I think SK_LOOKUP program type should need CAP_NET_ADMIN, so add SK_LOOKUP
program type in net_admin_prog_type.

Fixes: e9ddbb7707ff ("bpf: Introduce SK_LOOKUP program type with a dedicated attach point")

Signed-off-by: He Fengqing <hefengqing@huawei.com>
---
 kernel/bpf/syscall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 9befb1123770..2a8a4a5266fb 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2163,6 +2163,7 @@ static bool is_net_admin_prog_type(enum bpf_prog_type prog_type)
 	case BPF_PROG_TYPE_SK_MSG:
 	case BPF_PROG_TYPE_LIRC_MODE2:
 	case BPF_PROG_TYPE_FLOW_DISSECTOR:
+	case BPF_PROG_TYPE_SK_LOOKUP:
 	case BPF_PROG_TYPE_CGROUP_DEVICE:
 	case BPF_PROG_TYPE_CGROUP_SOCK:
 	case BPF_PROG_TYPE_CGROUP_SOCK_ADDR:
-- 
2.25.1


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

end of thread, other threads:[~2022-02-01 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-30  3:03 [bpf-next] bpf: Add CAP_NET_ADMIN for sk_lookup program type He Fengqing
2022-01-30  3:24 ` Alexei Starovoitov
2022-01-30 12:25   ` Jakub Sitnicki
2022-02-01 20:25     ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox