[PATCH] missing copy_to_user check in pc300 wan driver

From: davej
Date: Mon Aug 11 2003 - 11:32:14 EST


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/net/wan/pc300_drv.c linux-2.5/drivers/net/wan/pc300_drv.c
--- bk-linus/drivers/net/wan/pc300_drv.c 2003-08-04 01:00:28.000000000 +0100
+++ linux-2.5/drivers/net/wan/pc300_drv.c 2003-08-06 18:59:40.000000000 +0100
@@ -2623,7 +2623,8 @@ int cpc_ioctl(struct net_device *dev, st
sizeof(struct net_device_stats));
if (card->hw.type == PC300_TE)
memcpy(&pc300stats.te_stats,&chan->falc,sizeof(falc_t));
- copy_to_user(arg, &pc300stats, sizeof(pc300stats_t));
+ if (copy_to_user(arg, &pc300stats, sizeof(pc300stats_t)))
+ return -EFAULT;
}
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/