summaryrefslogtreecommitdiff
path: root/net/core/ethtool.c
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2018-09-22 01:34:01 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-18 09:16:20 +0200
commit4b7b26024f52a5cdeca20b56657f90d74a0a1995 (patch)
tree48506354987943916c5306d50fb15afec122e460 /net/core/ethtool.c
parent98c77f2eef29ffe9288edd84f8b5bc3fe2a3a614 (diff)
net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN
[ Upstream commit 474ff2600889e16280dbc6ada8bfecb216169a70 ] So it should not fail with EPERM even though it is no longer implemented... This is a fix for: (userns)$ egrep ^Cap /proc/self/status CapInh: 0000003fffffffff CapPrm: 0000003fffffffff CapEff: 0000003fffffffff CapBnd: 0000003fffffffff CapAmb: 0000003fffffffff (userns)$ tcpdump -i usb_rndis0 tcpdump: WARNING: usb_rndis0: SIOCETHTOOL(ETHTOOL_GUFO) ioctl failed: Operation not permitted Warning: Kernel filter failed: Bad file descriptor tcpdump: can't remove kernel filter: Bad file descriptor With this change it returns EOPNOTSUPP instead of EPERM. See also https://github.com/the-tcpdump-group/libpcap/issues/689 Fixes: 08a00fea6de2 "net: Remove references to NETIF_F_UFO from ethtool." Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core/ethtool.c')
-rw-r--r--net/core/ethtool.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 490eab16b04b..0ae5ac5e090f 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -2572,6 +2572,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
case ETHTOOL_GPHYSTATS:
case ETHTOOL_GTSO:
case ETHTOOL_GPERMADDR:
+ case ETHTOOL_GUFO:
case ETHTOOL_GGSO:
case ETHTOOL_GGRO:
case ETHTOOL_GFLAGS: