[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F985197.1060607@suse.com>
Date: Wed, 25 Apr 2012 15:33:43 -0400
From: Jeff Mahoney <jeffm@...e.com>
To: Network Development <netdev@...r.kernel.org>
Subject: [PATCH] dl2k: Tighten ioctl permissions
dl2k's rio_ioctl function defines several ioctls that involve
operations that should be denied to regular users.
SIOCDEVPRIVATE + 2 is a renumbered SIOCSMIIREG.
SIOCDEVPRIVATE + 5 calls netif_stop_queue.
SIOCDEVPRIVATE + 6 calls netif_wake_queue.
Reported-by: Stephan Mueller <stephan.mueller@...ec.com>
Signed-off-by: Jeff Mahoney <jeffm@...e.com>
---
drivers/net/ethernet/dlink/dl2k.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/drivers/net/ethernet/dlink/dl2k.c
+++ b/drivers/net/ethernet/dlink/dl2k.c
@@ -1264,6 +1264,14 @@ rio_ioctl (struct net_device *dev, struc
struct netdev_desc *desc;
int i;
+ switch (cmd) {
+ case SIOCDEVPRIVATE + 2:
+ case SIOCDEVPRIVATE + 5:
+ case SIOCDEVPRIVATE + 6:
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+ };
+
phy_addr = np->phy_addr;
switch (cmd) {
case SIOCDEVPRIVATE:
--
Jeff Mahoney
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists