From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: Potential issues (security and otherwise) with the current cgroup-bpf API Date: Mon, 19 Dec 2016 18:44:10 -0700 Message-ID: <2dbec775-6304-e44c-19c5-fbf07877e7b1@gmail.com> References: <20161219205631.GA31242@ast-mbp.thefacebook.com> <20161220000254.GA58895@ast-mbp.thefacebook.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Andy Lutomirski , Daniel Mack , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Kees Cook , Jann Horn , Tejun Heo , "David S. Miller" , Thomas Graf , Michael Kerrisk , Peter Zijlstra , Linux API , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Network Development To: Andy Lutomirski , Alexei Starovoitov Return-path: In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On 12/19/16 5:25 PM, Andy Lutomirski wrote: > net.socket_create_filter = "none": no filter > net.socket_create_filter = "bpf:baadf00d": bpf filter > net.socket_create_filter = "disallow": no sockets created period > net.socket_create_filter = "iptables:foobar": some iptables thingy > net.socket_create_filter = "nft:blahblahblah": some nft thingy > net.socket_create_filter = "address_family_list:1,2,3": allow AF 1, 2, and 3 Such a scheme works for the socket create filter b/c it is a very simple use case. It does not work for the ingress and egress which allow generic bpf filters. ... >> you're ignoring use cases I described earlier. >> In vrf case there is only one ifindex it needs to bind to. > > I'm totally lost. Can you explain what this has to do with the cgroup > hierarchy? I think the point is that a group hierarchy makes no sense for the VRF use case. What I put into iproute2 is cgrp2/vrf/NAME where NAME is the vrf name. The filter added to it binds ipv4 and ipv6 sockets to a specific device index. cgrp2/vrf is the "default" vrf and does not have a filter. A user can certainly add another layer cgrp2/vrf/NAME/NAME2 but it provides no value since VRF in a VRF does not make sense. ... >>> I like this last one, but IT'S NOT A POSSIBLE FUTURE EXTENSION. You >>> have to do it now (or disable the feature for 4.10). This is why I'm >>> bringing this whole thing up now. >> >> We don't have to touch user visible api here, so extensions are fine. > > Huh? My example in the original email attaches a program in a > sub-hierarchy. Are you saying that 4.11 could make that example stop > working? Are you suggesting sub-cgroups should not be allowed to override the filter of a parent cgroup?