diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-05-19 21:52:20 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-07 12:46:35 -0700 |
commit | 2d722d28a3614fcd7959adc6e7debf9959b4bb8c (patch) | |
tree | b415f56fe6b94d80260cec7c6b74642b3a3cf905 | |
parent | e50d48c8f67b2b96797bc5d66eb3c717d24744ff (diff) | |
download | kernel_samsung_smdk4412-2d722d28a3614fcd7959adc6e7debf9959b4bb8c.zip kernel_samsung_smdk4412-2d722d28a3614fcd7959adc6e7debf9959b4bb8c.tar.gz kernel_samsung_smdk4412-2d722d28a3614fcd7959adc6e7debf9959b4bb8c.tar.bz2 |
USB: cxacru: potential underflow in cxacru_cm_get_array()
commit 2a0ebf80aa95cc758d4725f74a7016e992606a39 upstream.
The value of "offd" comes off the instance->rcv_buf[] and we used it as
the offset into an array. The problem is that we check the upper bound
but not for negative values.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/atm/cxacru.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index a845f8b..9497171 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c @@ -686,7 +686,8 @@ static int cxacru_cm_get_array(struct cxacru_data *instance, enum cxacru_cm_requ { int ret, len; __le32 *buf; - int offb, offd; + int offb; + unsigned int offd; const int stride = CMD_PACKET_SIZE / (4 * 2) - 1; int buflen = ((size - 1) / stride + 1 + size * 2) * 4; |