diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-05-19 14:52:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-20 14:35:47 -0400 |
commit | 2a0ebf80aa95cc758d4725f74a7016e992606a39 (patch) | |
tree | 35fb51826df4e99d781041326e3ce5888afaa76b /drivers/usb | |
parent | 7138143972b7c293267c783fc99a194f0ceff7f2 (diff) |
USB: cxacru: potential underflow in cxacru_cm_get_array()
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>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-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 b7eb86ad6bf2..8a7eb77233b4 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 | |||
686 | { | 686 | { |
687 | int ret, len; | 687 | int ret, len; |
688 | __le32 *buf; | 688 | __le32 *buf; |
689 | int offb, offd; | 689 | int offb; |
690 | unsigned int offd; | ||
690 | const int stride = CMD_PACKET_SIZE / (4 * 2) - 1; | 691 | const int stride = CMD_PACKET_SIZE / (4 * 2) - 1; |
691 | int buflen = ((size - 1) / stride + 1 + size * 2) * 4; | 692 | int buflen = ((size - 1) / stride + 1 + size * 2) * 4; |
692 | 693 | ||