Skip to contentSkip to conversation

net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN

PATCH In review Maciej Żenczykowski 2 participants 2 messages Sep 22, 2018 – Sep 23, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN

From: Maciej Żenczykowski <[email protected]>

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 <[email protected]>
---
 net/core/ethtool.c | 1 +
 1 file changed, 1 insertion(+)
net/core/ethtool.c +1 -0
index 9d4e56d97080..96afc55aa61e 100644
@@ -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:
Signature · 1 line
2.19.0.444.g18242da7ef-goog
maintainer
#1 lore raw

From: "Maciej Żenczykowski" <[email protected]>
Date: Sat, 22 Sep 2018 01:34:01 -0700

Quoted 17 lines

From: Maciej Żenczykowski <[email protected]>

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

Quoted 7 lines

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 <[email protected]>

Applied and queued up for -stable, thanks.