netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] bpf: Allow CGROUP_SKB eBPF program to access sk_buff
@ 2017-05-31 18:06 Chenbo Feng
  2017-05-31 18:06 ` [PATCH net-next 2/2] bpf: Remove the capability check for cgroup skb eBPF program Chenbo Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Chenbo Feng @ 2017-05-31 18:06 UTC (permalink / raw)
  To: netdev, David Miller; +Cc: Lorenzo Colitti, Chenbo Feng

From: Chenbo Feng <fengc@google.com>

This allows cgroup eBPF program to classify packet based on their
protocol or other detail information. Currently program need
CAP_NET_ADMIN privilege to attach a cgroup eBPF program, and A
process with CAP_NET_ADMIN can already see all packets on the system,
for example, by creating an iptables rules that causes the packet to
be passed to userspace via NFLOG.

Signed-off-by: Chenbo Feng <fengc@google.com>
---
 kernel/bpf/verifier.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 339c8a1..94a9bc9 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -2419,6 +2419,7 @@ static bool may_access_skb(enum bpf_prog_type type)
 	case BPF_PROG_TYPE_SOCKET_FILTER:
 	case BPF_PROG_TYPE_SCHED_CLS:
 	case BPF_PROG_TYPE_SCHED_ACT:
+	case BPF_PROG_TYPE_CGROUP_SKB:
 		return true;
 	default:
 		return false;
-- 
2.7.4

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

end of thread, other threads:[~2017-06-01  0:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-31 18:06 [PATCH net-next 1/2] bpf: Allow CGROUP_SKB eBPF program to access sk_buff Chenbo Feng
2017-05-31 18:06 ` [PATCH net-next 2/2] bpf: Remove the capability check for cgroup skb eBPF program Chenbo Feng
2017-06-01  0:17   ` YUAN Linyu

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