OSDN Git Service

net: cxgb3_main: Add CAP_NET_ADMIN check to CHELSIO_GET_MEM
[tomoyo/tomoyo-test1.git] / drivers / net / ethernet / chelsio / cxgb3 / cxgb3_main.c
index 58f89f6..97ff860 100644 (file)
@@ -2448,6 +2448,8 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
 
                if (!is_offload(adapter))
                        return -EOPNOTSUPP;
+               if (!capable(CAP_NET_ADMIN))
+                       return -EPERM;
                if (!(adapter->flags & FULL_INIT_DONE))
                        return -EIO;    /* need the memory controllers */
                if (copy_from_user(&t, useraddr, sizeof(t)))