Skip to content

Commit

Permalink
staging: ath6kl: buffer overflow in SEND_FRAME ioctl
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Feb 23, 2011
1 parent 253804a commit 5b6567e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/staging/ath6kl/os/linux/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5b6567e

Please sign in to comment.