From: Dan Carpenter Date: Sun, 20 Feb 2011 12:49:53 +0000 (+0300) Subject: staging: ath6kl: buffer overflow in SEND_FRAME ioctl X-Git-Tag: MMI-PSA29.97-13-9~20521^2~460 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b6567ee84d6e8f7015eaa7d7c4926b4fd81746e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Acked-by: Vipin Mehta Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ath6kl/os/linux/ioctl.c b/drivers/staging/ath6kl/os/linux/ioctl.c index 82c7611c2081..4f30b255fc1a 100644 --- a/drivers/staging/ath6kl/os/linux/ioctl.c +++ b/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;