From: Dan Carpenter Date: Sun, 19 May 2013 18:52:20 +0000 (+0300) Subject: USB: cxacru: potential underflow in cxacru_cm_get_array() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2a0ebf80aa95cc758d4725f74a7016e992606a39;p=linux-beck.git 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 Cc: stable Signed-off-by: Greg Kroah-Hartman --- 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 { 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;