* [PATCH] net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN
@ 2018-09-22 8:34 Maciej Żenczykowski
2018-09-23 0:12 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Maciej Żenczykowski @ 2018-09-22 8:34 UTC (permalink / raw)
To: Maciej Żenczykowski, David S . Miller; +Cc: netdev
From: Maciej Żenczykowski <maze@google.com>
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>
---
net/core/ethtool.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 9d4e56d97080..96afc55aa61e 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -2536,6 +2536,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:
--
2.19.0.444.g18242da7ef-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN
2018-09-22 8:34 [PATCH] net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN Maciej Żenczykowski
@ 2018-09-23 0:12 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-09-23 0:12 UTC (permalink / raw)
To: zenczykowski; +Cc: maze, netdev
From: "Maciej Żenczykowski" <zenczykowski@gmail.com>
Date: Sat, 22 Sep 2018 01:34:01 -0700
> From: Maciej Żenczykowski <maze@google.com>
>
> 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>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-23 6:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-22 8:34 [PATCH] net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN Maciej Żenczykowski
2018-09-23 0:12 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).