From 5b6567ee84d6e8f7015eaa7d7c4926b4fd81746e Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sun, 20 Feb 2011 15:49:53 +0300 Subject: [PATCH] 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 --- drivers/staging/ath6kl/os/linux/ioctl.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.20.1