diff options
-rw-r--r-- | drivers/message/i2o/i2o_config.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 5451beff183f..a60c188c2bd9 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, | |||
687 | } | 687 | } |
688 | size = size >> 16; | 688 | size = size >> 16; |
689 | size *= 4; | 689 | size *= 4; |
690 | if (size > sizeof(rmsg)) { | ||
691 | rcode = -EINVAL; | ||
692 | goto sg_list_cleanup; | ||
693 | } | ||
694 | |||
690 | /* Copy in the user's I2O command */ | 695 | /* Copy in the user's I2O command */ |
691 | if (copy_from_user(rmsg, user_msg, size)) { | 696 | if (copy_from_user(rmsg, user_msg, size)) { |
692 | rcode = -EFAULT; | 697 | rcode = -EFAULT; |
@@ -922,6 +927,11 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
922 | } | 927 | } |
923 | size = size >> 16; | 928 | size = size >> 16; |
924 | size *= 4; | 929 | size *= 4; |
930 | if (size > sizeof(rmsg)) { | ||
931 | rcode = -EFAULT; | ||
932 | goto sg_list_cleanup; | ||
933 | } | ||
934 | |||
925 | /* Copy in the user's I2O command */ | 935 | /* Copy in the user's I2O command */ |
926 | if (copy_from_user(rmsg, user_msg, size)) { | 936 | if (copy_from_user(rmsg, user_msg, size)) { |
927 | rcode = -EFAULT; | 937 | rcode = -EFAULT; |