]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipv4: add capability check for net administration
authorYang Yang <yang.yang29@zte.com.cn>
Tue, 20 Jul 2021 01:43:28 +0000 (18:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jul 2021 14:15:22 +0000 (07:15 -0700)
commitaccf3d94f2e709596b10cae1ebc3103cf6bfab77
tree0ef685d728205720d2c4f58e95249788d1688b48
parent6bf729c021f87dc7366cc5fe83360d8344a88858
net: ipv4: add capability check for net administration

Root in init user namespace can modify /proc/sys/net/ipv4/ip_forward
without CAP_NET_ADMIN, this doesn't follow the principle of
capabilities. For example, let's take a look at netdev_store(),
root can't modify netdev attribute without CAP_NET_ADMIN.
So let's keep the consistency of permission check logic.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/devinet.c