This is a patch against the 2.5 usb-storage tree.  Greg, please apply.

The purpose of this patch is to trap all commands which have a bogus
request_bufflen.  Much logic is devoted to calculating the proper length of
the transfer, but according to discussions I've had on linux-scsi, this is
really a bug in whatever is originating the bad command.

Hopefully, after people use this patch for a while, we'll eliminate all the
offending sources and can remove quite a bit of logic from the driver.

Matt

# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.592   -> 1.593  
#       drivers/usb/storage/transport.c 1.34    -> 1.35   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/13      [EMAIL PROTECTED]       1.593
# Catch all cases of commands which have bad request_bufflen fields.
# Bad is defined, in this case, to mean the command requests a different
# (usually smaller) amount of data.
# --------------------------------------------
#
diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
--- a/drivers/usb/storage/transport.c   Sat Jul 13 17:28:34 2002
+++ b/drivers/usb/storage/transport.c   Sat Jul 13 17:28:34 2002
@@ -344,6 +344,12 @@
                           len = srb->request_bufflen;
           }
 
+       /* According to the linux-scsi people, any command sent which
+        * violates this invariant is a bug.  In the hopes of removing
+        * all the complex logic above, let's find them and eliminate them.
+        */
+       BUG_ON(len != srb->request_bufflen);
+
        return len;
 }
 

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

G:  Money isn't everything, A.J.
AJ: Who convinced you of that?
G:  The Chief, at my last salary review.
                                        -- Mike and Greg
User Friendly, 11/3/1998

Attachment: msg07751/pgp00000.pgp
Description: PGP signature

Reply via email to