[patch] superfluous CAP_NET_ADMIN required for some ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

It should be possible to obtain bonding information with
SIOCBOND[SLAVE]INFOQUERY ioctls without root privilege
(like with /proc/net/bonding/bond? or ifconfig).

Laurent

Signed-off-by: Laurent Deniel <laurent.deniel@xxxxxxx>

--- linux-2.6.9.orig/net/core/dev.c     2005-01-08 17:29:55.000000000 +0100
+++ linux-2.6.9/net/core/dev.c  2005-01-08 18:00:01.000000000 +0100
@@ -2692,8 +2692,6 @@ int dev_ioctl(unsigned int cmd, void __u
                case SIOCBONDENSLAVE:
                case SIOCBONDRELEASE:
                case SIOCBONDSETHWADDR:
-               case SIOCBONDSLAVEINFOQUERY:
-               case SIOCBONDINFOQUERY:
                case SIOCBONDCHANGEACTIVE:
                case SIOCBRADDIF:
                case SIOCBRDELIF:
@@ -2705,6 +2703,20 @@ int dev_ioctl(unsigned int cmd, void __u
                        rtnl_unlock();
                        return ret;

+               /*
+                *      These ioctl calls:
+                *      - can be done by all.
+                *      - require strict serialization.
+                *      - return a value (but already copied to user)
+                */
+               case SIOCBONDSLAVEINFOQUERY:
+               case SIOCBONDINFOQUERY:
+                       dev_load(ifr.ifr_name);
+                       rtnl_lock();
+                       ret = dev_ifsioc(&ifr, cmd);
+                       rtnl_unlock();
+                       return ret;
+
                case SIOCGIFMEM:
                        /* Get the per device memory space. We can add this but
                         * currently do not support it */

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux