[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1300203707-4552-1-git-send-email-sojkam1@fel.cvut.cz>
Date: Tue, 15 Mar 2011 16:41:47 +0100
From: Michal Sojka <sojkam1@....cvut.cz>
To: linux-kernel@...r.kernel.org
Cc: Chris Frey <cdfrey@...rsquare.net>,
Greg Kroah-Hartman <gregkh@...e.de>,
Michal Sojka <sojkam1@....cvut.cz>, stable@...nel.org
Subject: [PATCH] USB: Do not pass negative length to snoop_urb()
When `echo Y > /sys/module/usbcore/parameters/usbfs_snoop` and
usb_control_msg() returns error, a lot of kernel memory is dumped to dmesg
until unhandled kernel paging request occurs.
Signed-off-by: Michal Sojka <sojkam1@....cvut.cz>
Cc: stable@...nel.org
---
drivers/usb/core/devio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index a7131ad..37518df 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -802,7 +802,7 @@ static int proc_control(struct dev_state *ps, void __user *arg)
tbuf, ctrl.wLength, tmo);
usb_lock_device(dev);
snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE,
- tbuf, i);
+ tbuf, max(i, 0));
if ((i > 0) && ctrl.wLength) {
if (copy_to_user(ctrl.data, tbuf, i)) {
free_page((unsigned long)tbuf);
--
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists