Commit cfff3e5c authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

staging/bcm: two information leaks in ioctl

There are a couple paths where we don't check how much data we copy back
to the user.

Cc: Dave Jones <davej@redhat.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4e5e9d7c
......@@ -590,6 +590,8 @@ static int bcm_char_ioctl_gpio_multi_request(void __user *argp, struct bcm_mini_
if (IoBuffer.InputLength > sizeof(gpio_multi_info))
return -EINVAL;
if (IoBuffer.OutputLength > sizeof(gpio_multi_info))
IoBuffer.OutputLength = sizeof(gpio_multi_info);
if (copy_from_user(&gpio_multi_info, IoBuffer.InputBuffer, IoBuffer.InputLength))
return -EFAULT;
......@@ -680,6 +682,8 @@ static int bcm_char_ioctl_gpio_mode_request(void __user *argp, struct bcm_mini_a
if (IoBuffer.InputLength > sizeof(gpio_multi_mode))
return -EINVAL;
if (IoBuffer.OutputLength > sizeof(gpio_multi_mode))
IoBuffer.OutputLength = sizeof(gpio_multi_mode);
if (copy_from_user(&gpio_multi_mode, IoBuffer.InputBuffer, IoBuffer.InputLength))
return -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment