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>
This commit is contained in:
parent
253804a25b
commit
5b6567ee84
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue