]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dl2k: Clean up rio_ioctl
authorJeff Mahoney <jeffm@suse.com>
Thu, 2 Aug 2012 12:04:00 +0000 (05:04 -0700)
committerGuangyu Sun <guangyu.sun@oracle.com>
Fri, 3 Aug 2012 22:18:39 +0000 (15:18 -0700)
commit89dcfd3c96bd91c568ae3aaf67cc5452c43e7a97
tree2644f7830e5d6dbaafa8fa89cc59942e0d94078b
parent95a7319c9de78c19a9e295e1322c0766cb6e93f1
dl2k: Clean up rio_ioctl

Orabug: 14126896
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.
This fixes: CVE-2012-2313

Reported-by: Stephan Mueller <stephan.mueller@atsec.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
drivers/net/dl2k.c
drivers/net/dl2k.h