From: Chuck Anderson Date: Wed, 26 Sep 2012 21:47:28 +0000 (-0700) Subject: CVE-2012-2313: dl2k: Clean up rio_ioctl X-Git-Tag: v2.6.39-400.9.0~222 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dd6589df9c78becfd570c96315e87f6d8dc0f1b4;p=users%2Fjedix%2Flinux-maple.git CVE-2012-2313: dl2k: Clean up rio_ioctl The dl2k driver's rio_ioctl call has a few issues: - No permissions checking - Implements SIOCGMIIREG and SIOCGMIIREG using the SIOCDEVPRIVATE numbers - Has a few ioctls that may have been used for debugging at one point but have no place in the kernel proper. This patch removes all but the MII ioctls, renumbers them to use the standard ones, and adds the proper permission check for SIOCSMIIREG. We can also get rid of the dl2k-specific struct mii_data in favor of the generic struct mii_ioctl_data. Since we have the phyid on hand, we can add the SIOCGMIIPHY ioctl too. Most of the MII code for the driver could probably be converted to use the generic MII library but I don't have a device to test the results. Reported-by: Stephan Mueller Signed-off-by: Jeff Mahoney Signed-off-by: David S. Miller Orabug: 14680245 Signed-off-by: Chuck Anderson --- diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 46ae6e3c06f3e..f9ac5d3e90fb2 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c @@ -15,6 +15,7 @@ #define DRV_RELDATE "2007/08/12" #include "dl2k.h" #include +#include static char version[] __devinitdata = KERN_INFO DRV_NAME " " DRV_VERSION " " DRV_RELDATE "\n";