diff options
author | Maciej Żenczykowski <maze@google.com> | 2019-11-21 22:19:08 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-22 04:15:20 +0100 |
commit | 35fc59c95680afe958893f64e6b6f8ff69daf092 (patch) | |
tree | 292156f3b440a8e065df2e7819d65b345b1f6153 /net/ipv6/ipv6_sockglue.c | |
parent | sfc: Only cancel the PPS workqueue if it exists (diff) | |
download | linux-35fc59c95680afe958893f64e6b6f8ff69daf092.tar.xz linux-35fc59c95680afe958893f64e6b6f8ff69daf092.zip |
net-ipv6: IPV6_TRANSPARENT - check NET_RAW prior to NET_ADMIN
NET_RAW is less dangerous, so more likely to be available to a process,
so check it first to prevent some spurious logging.
This matches IP_TRANSPARENT which checks NET_RAW first.
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 264c292e7dcc..79fc012dd2ca 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -363,8 +363,8 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, break; case IPV6_TRANSPARENT: - if (valbool && !ns_capable(net->user_ns, CAP_NET_ADMIN) && - !ns_capable(net->user_ns, CAP_NET_RAW)) { + if (valbool && !ns_capable(net->user_ns, CAP_NET_RAW) && + !ns_capable(net->user_ns, CAP_NET_ADMIN)) { retv = -EPERM; break; } |