Commit 03d4199e authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] janitor: skfddi copy*user fixes

From: Daniele Bellucci <bellucda@tiscali.it>

This patch audits some copy_from/to_user in the SysKonnect FDDI device
driver.
parent 673ea6e3
......@@ -56,6 +56,8 @@
* 12-Nov-99 CG Source code release
* 22-Nov-99 CG Included in kernel source.
* 07-May-00 DM 64 bit fixes, new dma interface
* 31-Jul-03 DB Audit copy_*_user in skfp_ioctl
* Daniele Bellucci <bellucda@tiscali.it>
*
* Compilation options (-Dxxx):
* DRIVERDEBUG print lots of messages to log file
......@@ -1266,11 +1268,13 @@ static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
struct s_skfp_ioctl ioc;
int status = 0;
copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl));
if (copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl)))
return -EFAULT;
switch (ioc.cmd) {
case SKFP_GET_STATS: /* Get the driver statistics */
ioc.len = sizeof(lp->MacStat);
copy_to_user(ioc.data, skfp_ctl_get_stats(dev), ioc.len);
status = copy_to_user(ioc.data, skfp_ctl_get_stats(dev), ioc.len)
? -EFAULT : 0;
break;
case SKFP_CLR_STATS: /* Zero out the driver statistics */
if (!capable(CAP_NET_ADMIN)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment