Ver Fonte

staging: ath6kl: buffer overflow in SEND_FRAME ioctl

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>
Dan Carpenter há 14 anos atrás
pai
commit
5b6567ee84
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      drivers/staging/ath6kl/os/linux/ioctl.c

+ 5 - 0
drivers/staging/ath6kl/os/linux/ioctl.c

@@ -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;