aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKangjie Lu <kangjielu@gmail.com>2016-05-03 16:32:16 -0400
committerSimon Shields <keepcalm444@gmail.com>2016-05-28 20:24:37 +1000
commit1d1882a85994f5b466be01c07e8db902dae032b8 (patch)
tree4e419709443e6a777f7b4590e6544a3ae0a9b50b
parente359fdd28d3ed3984d1305b3e7ba80fdb1c6e003 (diff)
downloadkernel_samsung_smdk4412-1d1882a85994f5b466be01c07e8db902dae032b8.zip
kernel_samsung_smdk4412-1d1882a85994f5b466be01c07e8db902dae032b8.tar.gz
kernel_samsung_smdk4412-1d1882a85994f5b466be01c07e8db902dae032b8.tar.bz2
USB: usbfs: fix potential infoleak in devio
The stack object “ci” has a total size of 8 bytes. Its last 3 bytes are padding bytes which are not initialized and leaked to userland via “copy_to_user”. Change-Id: Icd49231ee1862682739a871ae78a5602ee104731 Signed-off-by: Kangjie Lu <kjlu@gatech.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/devio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 461e785..8aff636 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1012,10 +1012,11 @@ static int proc_getdriver(struct dev_state *ps, void __user *arg)
static int proc_connectinfo(struct dev_state *ps, void __user *arg)
{
- struct usbdevfs_connectinfo ci = {
- .devnum = ps->dev->devnum,
- .slow = ps->dev->speed == USB_SPEED_LOW
- };
+ struct usbdevfs_connectinfo ci;
+
+ memset(&ci, 0, sizeof(ci));
+ ci.devnum = ps->dev->devnum;
+ ci.slow = ps->dev->speed == USB_SPEED_LOW;
if (copy_to_user(arg, &ci, sizeof(ci)))
return -EFAULT;