USB: usbfs: only copy the actual data received
authorGreg KH <greg@kroah.com>
Mon, 15 Feb 2010 17:37:46 +0000 (09:37 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Feb 2010 15:37:57 +0000 (07:37 -0800)
commit2bac497bb2f16f1c01a61a0132d2f7a8dabd0e2a
tree6b823d323955aa05cff5bf88a67150e5271e5210
parenta206591bd37f7f63d1ccaabf73cbaff25b29f51d
USB: usbfs: only copy the actual data received

commit d4a4683ca054ed9917dfc9e3ff0f7ecf74ad90d6 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c