USB: usbfs: only copy the actual data received
commitacbf8a14113c8abeb10a21cefc551d03bdd8f3f7
authorGreg KH <greg@kroah.com>
Tue, 16 Feb 2010 01:37:46 +0000 (15 17:37 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:55:43 +0000 (1 15:55 -0700)
tree4645cb3101b72344a9f5ef94726507df6b6933ab
parent97fde87ccff1bf623631c58a1f032533983cb090
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>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Jeff Mahoney <jeffm@suse.com>
drivers/usb/core/devio.c