SIOCETHTOOL history ?
Subsystems (2)
Hi,
Can anyone of the veterans please help me out with a
small code curiosity
Why does the SIOCETHTOOL ioctl needCAP_NET_ADMIN even for harmless commands like
GSET ?
Some sample drivers that I managed to download over the net that supports SIOCETHTOOL has comments like
"no need to check for CAP_NET_ADMIN since that is already present in net/core/dev.c". (And sure enough it was there)
Why would such a blanket checking be present when this ioctl is only an entry point for many sub commands ?
I have used SIOCGMIIPHY before and it seemed not to require any su rights or capabilities. What's then the difference between these 2 ioctls that require more capabilities for SIOCETHTOOL ?
arun
From: "arun" <[email protected]>
Date: Tue, 6 May 2003 18:07:48 +0530
I have used SIOCGMIIPHY before and it seemed not to require any su rights or capabilities.
Yes it does:
/*
* These ioctl calls:
* - require superuser power.
* - require strict serialization.
* - return a value
*/
case SIOCETHTOOL:
case SIOCGMIIPHY:
case SIOCGMIIREG:
if (!capable(CAP_NET_ADMIN))
return -EPERM;