summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-10-27 15:35:35 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2009-11-09 16:22:14 -0800
commit01019ab600200ce6f43a52d0e8f7ab5d24a82da3 (patch)
tree224606bbbde727ac3f493df5191cfc44ff9cec7d /drivers/scsi
parent4d4c684cd460ca0e1f3daacde10e201776616c3f (diff)
downloadlwn-01019ab600200ce6f43a52d0e8f7ab5d24a82da3.tar.gz
lwn-01019ab600200ce6f43a52d0e8f7ab5d24a82da3.zip
dpt_i2o: Fix up copy*user
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/dpt_i2o.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index b6af63ca980b..7d1aac31ec8d 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -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;