X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fmessage%2Fi2o%2Fi2o_config.c;h=a60c188c2bd937255f60f42920e4b9fbba68cb88;hb=a49fe6d59aae7f7835288df508b709ed2d69cbab;hp=5451beff183ffdf69e24d5d1ca016d11215882a2;hpb=6ed1914982e9cd46e37a6a6aa9e1fd1de6a50bf7;p=~andy%2Flinux diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 5451beff183..a60c188c2bd 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c @@ -687,6 +687,11 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, } size = size >> 16; size *= 4; + if (size > sizeof(rmsg)) { + rcode = -EINVAL; + goto sg_list_cleanup; + } + /* Copy in the user's I2O command */ if (copy_from_user(rmsg, user_msg, size)) { rcode = -EFAULT; @@ -922,6 +927,11 @@ static int i2o_cfg_passthru(unsigned long arg) } size = size >> 16; size *= 4; + if (size > sizeof(rmsg)) { + rcode = -EFAULT; + goto sg_list_cleanup; + } + /* Copy in the user's I2O command */ if (copy_from_user(rmsg, user_msg, size)) { rcode = -EFAULT;