]> git.karo-electronics.de Git - karo-tx-linux.git/commit
usb-storage: don't access beyond the end of the sg buffer
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 22 Feb 2008 22:03:25 +0000 (17:03 -0500)
committerChris Wright <chrisw@sous-sol.org>
Mon, 24 Mar 2008 18:47:14 +0000 (11:47 -0700)
commit90fbe8b1fa081a99616ccd7760f5877fcafa35ef
treee8a8670ea0b4f4f4ba4bfde2ef3147c1fb7ddf21
parent759be208409db44bdc81bd28156c38e4f9501ecd
usb-storage: don't access beyond the end of the sg buffer

This patch (as1038) fixes a bug in usb_stor_access_xfer_buf() and
usb_stor_set_xfer_buf() (the bug was originally found by Boaz
Harrosh): The routine must not attempt to write beyond the end of a
scatter-gather list or beyond the number of bytes requested.

This is the minimal 2.6.24 equivalent to as1035 +
as1037 (7084191d53b224b953c8e1db525ea6c31aca5fc7 "USB:
usb-storage: don't access beyond the end of the sg buffer" +
6d512a80c26d87f8599057c86dc920fbfe0aa3aa "usb-storage: update earlier
scatter-gather bug fix").  Mark Glines has confirmed that it fixes
his problem.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Mark Glines <mark@glines.org>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/protocol.c