aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2010-02-16 12:20:04 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-02-16 12:20:04 -0800
commitcfaec35098c3751917ce70f8b5027ab857d5a62d (patch)
tree74ad92dbec1da8917d06e5f4d16adc36e9e06a10
parent9d50402d2fe2dd94dca0cfccd1c1b0674316967d (diff)
downloadpatches-cfaec35098c3751917ce70f8b5027ab857d5a62d.tar.gz
another usb patch
-rw-r--r--series1
-rw-r--r--usb.current/usb-usbfs-only-copy-the-actual-data-received.patch49
2 files changed, 50 insertions, 0 deletions
diff --git a/series b/series
index 17001767024336..7e2e68134eea11 100644
--- a/series
+++ b/series
@@ -20,6 +20,7 @@ tty.current/serial-8250-add-serial-transmitter-fully-empty-test.patch
#################################
# USB patches for 2.6.33
#################################
+usb.current/usb-usbfs-only-copy-the-actual-data-received.patch
usb.current/usb-ftdi_sio-new-device-id-for-papouch-ad4usb.patch
usb.current/usb-storage-remove-unneeded-sc-pr-from-unusual_devs.h.patch
usb.current/usb-ftdi_sio-add-device-ids-several-elv-one-mindstorms-nxt.patch
diff --git a/usb.current/usb-usbfs-only-copy-the-actual-data-received.patch b/usb.current/usb-usbfs-only-copy-the-actual-data-received.patch
new file mode 100644
index 00000000000000..9064607e94c824
--- /dev/null
+++ b/usb.current/usb-usbfs-only-copy-the-actual-data-received.patch
@@ -0,0 +1,49 @@
+From security-bounces@linux.kernel.org Mon Feb 15 09:38:09 2010
+From: Greg KH <greg@kroah.com>
+Date: Mon, 15 Feb 2010 09:37:46 -0800
+Subject: USB: usbfs: only copy the actual data received
+To: Alan Stern <stern@rowland.harvard.edu>
+Cc: Marcus Meissner <meissner@suse.de>
+
+We need to only copy the data received by the device to userspace, not
+the whole kernel buffer, which can contain "stale" data.
+
+Thanks to Marcus Meissner for pointing this out and testing the fix.
+
+Reported-by: Marcus Meissner <meissner@suse.de>
+Tested-by: Marcus Meissner <meissner@suse.de>
+Cc: Alan Stern <stern@rowland.harvard.edu>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/devio.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/core/devio.c
++++ b/drivers/usb/core/devio.c
+@@ -1312,9 +1312,9 @@ static int processcompl(struct async *as
+ void __user *addr = as->userurb;
+ unsigned int i;
+
+- if (as->userbuffer)
++ if (as->userbuffer && urb->actual_length)
+ if (copy_to_user(as->userbuffer, urb->transfer_buffer,
+- urb->transfer_buffer_length))
++ urb->actual_length))
+ goto err_out;
+ if (put_user(as->status, &userurb->status))
+ goto err_out;
+@@ -1475,9 +1475,9 @@ static int processcompl_compat(struct as
+ void __user *addr = as->userurb;
+ unsigned int i;
+
+- if (as->userbuffer)
++ if (as->userbuffer && urb->actual_length)
+ if (copy_to_user(as->userbuffer, urb->transfer_buffer,
+- urb->transfer_buffer_length))
++ urb->actual_length))
+ return -EFAULT;
+ if (put_user(as->status, &userurb->status))
+ return -EFAULT;