staging: ath6kl: buffer overflow in SEND_FRAME ioctl
authorDan Carpenter <error27@gmail.com>
Sun, 20 Feb 2011 12:49:53 +0000 (15:49 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Feb 2011 22:00:13 +0000 (14:00 -0800)
We should check that optTxFrmCmd.optIEDataLen isn't too large before we
copy it into the data buffer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Vipin Mehta <vipin.mehta@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/ath6kl/os/linux/ioctl.c

index 82c7611c2081a9cd897ecda715edf8fe521495f4..4f30b255fc1a704cefe27da385e303ac9e4805c4 100644 (file)
@@ -3175,6 +3175,11 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
                 break;
             }
 
+            if (optTxFrmCmd.optIEDataLen > MAX_OPT_DATA_LEN) {
+                ret = -EINVAL;
+                break;
+            }
+
             if (copy_from_user(data, userdata+sizeof(WMI_OPT_TX_FRAME_CMD) - 1,
                                    optTxFrmCmd.optIEDataLen)) {
                 ret = -EFAULT;