Skip to contentSkip to conversation

ethtool: allow non-netadmin to query settings

PATCH Applied Stephen Hemminger 3 participants 4 messages Aug 23, 2010 – Aug 24, 2010

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

PATCH 1/1 ethtool: allow non-netadmin to query settings

The SNMP daemon uses ethtool to determine the speed of network interfaces. This fails on Debian (and probably elsewhere) because for security SNMP daemon runs as non-root user (snmp).

Note: A similar patch was rejected previously because of a concern about the possibility that on some hardware querying the ethtool settings requires access to the PHY and could slow the machine down. But the security risk of requiring SNMP daemon (and related services) to run as root far out weighs the risk of denial-of-service.

net/core/ethtool.c +1 -0
@@ -1423,6 +1423,7 @@ int dev_ethtool(struct net *net, struct 
 
 	/* Allow some commands to be done by anyone */
 	switch (ethcmd) {
+	case ETHTOOL_GSET:
 	case ETHTOOL_GDRVINFO:
 	case ETHTOOL_GMSGLVL:
 	case ETHTOOL_GCOALESCE:
#1 lore raw
Quoted 9 lines · Stephen Hemminger

The SNMP daemon uses ethtool to determine the speed of network interfaces. This fails on Debian (and probably elsewhere) because for security SNMP daemon runs as non-root user (snmp).

Note: A similar patch was rejected previously because of a concern about the possibility that on some hardware querying the ethtool settings requires access to the PHY and could slow the machine down. But the security risk of requiring SNMP daemon (and related services) to run as root far out weighs the risk of denial-of-service.

[...]

Speed and duplex are now exposed through world-readable attributes in sysfs. Currently this is implemented by calling the ethtool get_settings() operations but that could be improved on by adding speed and duplex fields to struct net_device or by allowing drivers to implement a cheaper operation that provides just this information.

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
#2 lore raw
Quoted 10 lines · On Mon, 23 Aug 2010 22:24:38 +0100 Ben Hutchings <[email protected]>…
Quoted 9 lines · Stephen Hemminger

The SNMP daemon uses ethtool to determine the speed of network interfaces. This fails on Debian (and probably elsewhere) because for security SNMP daemon runs as non-root user (snmp).

Note: A similar patch was rejected previously because of a concern about the possibility that on some hardware querying the ethtool settings requires access to the PHY and could slow the machine down. But the security risk of requiring SNMP daemon (and related services) to run as root far out weighs the risk of denial-of-service.

Quoted 8 lines

[...]

Speed and duplex are now exposed through world-readable attributes in sysfs. Currently this is implemented by calling the ethtool get_settings() operations but that could be improved on by adding speed and duplex fields to struct net_device or by allowing drivers to implement a cheaper operation that provides just this information.

Changing daemon is possible, but changing every driver to do this is not a practical option.

maintainer Applied
#3 lore raw
In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>
Date: Mon, 23 Aug 2010 13:24:18 -0700

Quoted 11 lines

The SNMP daemon uses ethtool to determine the speed of network interfaces. This fails on Debian (and probably elsewhere) because for security SNMP daemon runs as non-root user (snmp).

Note: A similar patch was rejected previously because of a concern about the possibility that on some hardware querying the ethtool settings requires access to the PHY and could slow the machine down. But the security risk of requiring SNMP daemon (and related services) to run as root far out weighs the risk of denial-of-service.

Applied.