Return-Path: Message-Id: <20130703184045.950231533@goodmis.org> Date: Wed, 03 Jul 2013 14:39:05 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , Greg Kroah-Hartman Subject: [008/141] USB: cxacru: potential underflow in cxacru_cm_get_array() References: <20130703183857.307196999@goodmis.org> Content-Disposition: inline; filename=0008-USB-cxacru-potential-underflow-in-cxacru_cm_get_arra.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.6 stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit 2a0ebf80aa95cc758d4725f74a7016e992606a39 ] 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 Signed-off-by: Steven Rostedt --- drivers/usb/atm/cxacru.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index b7eb86a..8a7eb77 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; -- 1.7.10.4