public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2/2] staging: ath6kl: buffer overflow in SEND_FRAME ioctl
@ 2011-02-20 12:49 Dan Carpenter
  2011-02-20 15:18 ` [patch 2/2] staging: ath6kl: buffer overflow in SEND_FRAME Vipin Mehta
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-02-20 12:49 UTC (permalink / raw)
  To: kernel-janitors

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>

diff --git a/drivers/staging/ath6kl/os/linux/ioctl.c b/drivers/staging/ath6kl/os/linux/ioctl.c
index 17ba543..9a9a324 100644
--- a/drivers/staging/ath6kl/os/linux/ioctl.c
+++ b/drivers/staging/ath6kl/os/linux/ioctl.c
@@ -3153,6 +3153,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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-23 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-20 12:49 [patch 2/2] staging: ath6kl: buffer overflow in SEND_FRAME ioctl Dan Carpenter
2011-02-20 15:18 ` [patch 2/2] staging: ath6kl: buffer overflow in SEND_FRAME Vipin Mehta
2011-02-23 18:40 ` [patch 2/2] staging: ath6kl: buffer overflow in SEND_FRAME ioctl Luis R. Rodriguez
2011-02-23 18:54 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox