]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dpt_i2o: Fix up copy*user
authorAlan Cox <alan@linux.intel.com>
Tue, 27 Oct 2009 15:35:35 +0000 (15:35 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:51:55 +0000 (16:51 -0800)
commit ef7562b7f28319e6dd1f85dc1af87df2a7a84832 upstream.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/dpt_i2o.c

index 771614521f307015d431f749317b00ba6755ae6e..2821285f68ece45c524bd3a04779956d1d33c681 100644 (file)
@@ -1918,6 +1918,10 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
                }
                size = size>>16;
                size *= 4;
+               if (size > MAX_MESSAGE_SIZE) {
+                       rcode = EINVAL;
+                       goto cleanup;
+               }
                /* Copy in the user's I2O command */
                if (copy_from_user (msg, user_msg, size)) {
                        rcode = -EFAULT;