Make the network stack usable by userns root
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | netns: Deduplicate and fix copy_net_ns when !CONFIG_NET_NSinclude/ net/ | +9 | 9 replies | |
| 2/17 | userns: make each net (net_ns) belong to a user_nsinclude/ kernel/ net/ | +20 | 0 replies | |
| 3/17 | sysctl: Pass useful parameters to sysctl permissionsfs/ include/ net/ | +7 | 0 replies | |
| 4/17 | net: Don't export sysctls to unprivileged usersnet/ net/ net/ +19 more | +98 | 0 replies | |
| 5/17 | net: Push capable(CAP_NET_ADMIN) into the rtnl methodsnet/ net/ net/ +14 more | +102 | 0 replies | |
| 6/17 | net: Update the per network namespace sysctls to be available to the network namespace ownernet/ | +11 | 0 replies | |
| 7/17 | user_ns: get rid of duplicate code in net_ctl_permissionsnet/ | +2 | 0 replies | |
| 8/17 | net: Allow userns root to force the scm credsnet/ | +3 | 0 replies | |
| 9/17 | net: Allow userns root control of the core of the network stack.net/ net/ net/ +1 more | +28 | 0 replies | |
| 10/17 | net: Allow userns root to control ipv4net/ net/ net/ +11 more | +30 | 0 replies | |
| 11/17 | net: Allow userns root to control ipv6net/ net/ net/ +9 more | +28 | 0 replies | |
| 12/17 | net: Allow userns root to control llc, netfilter, netlink, packet, and xfrmnet/ net/ net/ +5 more | +9 | 0 replies | |
| 13/17 | net: Allow userns root to control the network bridge code.net/ net/ net/ | +19 | 0 replies | |
| 14/17 | net: Allow the userns root to control vlans.net/ | +6 | 0 replies | |
| 15/17 | net: Enable some sysctls that are safe for the userns rootnet/ net/ net/ +1 more | +1 | 0 replies | |
| 16/17 | net: Enable a userns root rtnl calls that are safe for unprivilged usersnet/ net/ net/ +6 more | +4 | 0 replies | |
| 17/17 | net: Make CAP_NET_BIND_SERVICE per user namespacenet/ net/ net/ | +10 | 0 replies |
Reviews trailers per patch
4 of 17 patches have a Reviewed-by or Acked-by.
| Patch | Serge Hallyn |
|---|---|
| 1/17 | A-b A-b |
| 2/17 | A-b |
| 3/17 | A-b |
| 4/17 | |
| 5/17 | A-b |
| 6/17 | |
| 7/17 | |
| 8/17 | |
| 9/17 | |
| 10/17 | |
| 11/17 | |
| 12/17 | |
| 13/17 | |
| 14/17 | |
| 15/17 | |
| 16/17 | |
| 17/17 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next 0/17] Make the network stack usable by userns root
In a secondary user namespace the root user only has CAP_NET_ADMIN, CAP_NET_RAW and CAP_NET_BIND_SERVICE with respect to the secondary user namespace. The test "capable(CAP_NET_ADMIN)" tests for capabilities in the initial user namespace.
The following set of patches goes through the networking stack. First pushing the capable(CAP_NET_ADMIN) admin calls down farther in the stack so individual instances can be changed. Then where I have I it appears safe I have relaxed the permission checks.
The code is available in git from:git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git netns-v73
The netns-v73 branch is against v3.7-rc3 and merges cleanly with net-next.
In my user namespace tree I am working to allow unprivileged users to create user namespace, and to allow the user namespace root able to create network namespaces. Making these patches really about allowing unprivileged users able to use the networking stack (not that they will be able to talk to anyone).
David I have some small dependencies on the first two patches of this series in my later user namespace work. So after these changes have been reviewed if you can pull my netns-v73 branch (which is just these patches) into net-next that will help me avoid unnecessary conflicts.
Eric
Eric W. Biederman (16):
netns: Deduplicate and fix copy_net_ns when !CONFIG_NET_NS
userns: make each net (net_ns) belong to a user_ns
sysctl: Pass useful parameters to sysctl permissions
net: Don't export sysctls to unprivileged users
net: Push capable(CAP_NET_ADMIN) into the rtnl methods
net: Update the per network namespace sysctls to be available to the network namespace owner
net: Allow userns root to force the scm creds
net: Allow userns root control of the core of the network stack.
net: Allow userns root to control ipv4
net: Allow userns root to control ipv6
net: Allow userns root to control llc, netfilter, netlink, packet, and xfrm
net: Allow userns root to control the network bridge code.
net: Allow the userns root to control vlans.
net: Enable some sysctls that are safe for the userns root
net: Enable a userns root rtnl calls that are safe for unprivilged users
net: Make CAP_NET_BIND_SERVICE per user namespace
Zhao Hongjiang (1):
user_ns: get rid of duplicate code in net_ctl_permissions
fs/proc/proc_sysctl.c | 9 +++++---- include/linux/sysctl.h | 3 +-- include/net/net_namespace.h | 24 ++++++++++++++++-------- kernel/nsproxy.c | 2 +- net/8021q/vlan.c | 12 ++++++------ net/bridge/br_ioctl.c | 25 +++++++++++++------------ net/bridge/br_sysfs_br.c | 10 +++++----- net/bridge/br_sysfs_if.c | 2 +- net/can/gw.c | 6 ++++++ net/core/dev.c | 17 +++++++++++++---- net/core/ethtool.c | 2 +- net/core/neighbour.c | 4 ++++ net/core/net-sysfs.c | 15 ++++++++++----- net/core/net_namespace.c | 23 ++++++++++++----------- net/core/rtnetlink.c | 12 +++++++++++- net/core/scm.c | 6 +++--- net/core/sock.c | 7 ++++--- net/core/sysctl_net_core.c | 5 +++++ net/dcb/dcbnl.c | 3 +++ net/decnet/dn_dev.c | 6 ++++++ net/decnet/dn_fib.c | 6 ++++++ net/ipv4/af_inet.c | 9 ++++++--- net/ipv4/arp.c | 2 +- net/ipv4/devinet.c | 4 ++-- net/ipv4/fib_frontend.c | 2 +- net/ipv4/ip_fragment.c | 4 ++++ net/ipv4/ip_gre.c | 4 ++-- net/ipv4/ip_options.c | 6 +++--- net/ipv4/ip_sockglue.c | 5 +++-- net/ipv4/ip_vti.c | 4 ++-- net/ipv4/ipip.c | 4 ++-- net/ipv4/ipmr.c | 2 +- net/ipv4/netfilter/arp_tables.c | 8 ++++---- net/ipv4/netfilter/ip_tables.c | 8 ++++---- net/ipv4/route.c | 4 ++++ net/ipv4/sysctl_net_ipv4.c | 3 +++ net/ipv4/tcp.c | 2 +- net/ipv4/tcp_cong.c | 3 ++- net/ipv6/addrconf.c | 4 ++-- net/ipv6/af_inet6.c | 5 +++-- net/ipv6/anycast.c | 2 +- net/ipv6/datagram.c | 6 +++--- net/ipv6/ip6_flowlabel.c | 3 ++- net/ipv6/ip6_gre.c | 4 ++-- net/ipv6/ip6_tunnel.c | 4 ++-- net/ipv6/ip6mr.c | 2 +- net/ipv6/ipv6_sockglue.c | 7 ++++--- net/ipv6/netfilter/ip6_tables.c | 8 ++++---- net/ipv6/reassembly.c | 4 ++++ net/ipv6/route.c | 6 +++++- net/ipv6/sit.c | 8 ++++---- net/key/af_key.c | 2 +- net/llc/af_llc.c | 2 +- net/netfilter/ipset/ip_set_core.c | 2 +- net/netfilter/ipvs/ip_vs_ctl.c | 8 ++++++-- net/netfilter/ipvs/ip_vs_lblc.c | 7 ++++++- net/netfilter/ipvs/ip_vs_lblcr.c | 4 ++++ net/netfilter/nf_conntrack_acct.c | 4 ++++ net/netfilter/nf_conntrack_ecache.c | 4 ++++ net/netfilter/nf_conntrack_helper.c | 4 ++++ net/netfilter/nf_conntrack_proto_dccp.c | 8 ++++++-- net/netfilter/nf_conntrack_standalone.c | 4 ++++ net/netfilter/nf_conntrack_timestamp.c | 4 ++++ net/netfilter/nfnetlink.c | 2 +- net/netlink/af_netlink.c | 2 +- net/packet/af_packet.c | 2 +- net/phonet/pn_netlink.c | 6 ++++++ net/sched/act_api.c | 3 +++ net/sched/cls_api.c | 2 ++ net/sched/sch_api.c | 9 +++++++++ net/sctp/socket.c | 8 +++++--- net/sysctl_net.c | 15 ++++++++++++--- net/unix/sysctl_net_unix.c | 4 ++++ net/xfrm/xfrm_sysctl.c | 4 ++++ net/xfrm/xfrm_user.c | 2 +- 75 files changed, 308 insertions(+), 140 deletions(-)