aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKangjie Lu <kangjielu@gmail.com>2016-05-03 16:32:16 -0400
committerZiyan <jaraidaniel@gmail.com>2016-10-29 01:34:14 +0200
commit2846046f71d9d10b70b5b4a660f33c92022d66c8 (patch)
tree0a5f2864fa1436f4378143f0e829e36768f91aa3
parentf76ddb6cc6fce22ae526e8f1d19c9965d6b7dc04 (diff)
downloadkernel_samsung_tuna-2846046f71d9d10b70b5b4a660f33c92022d66c8.zip
kernel_samsung_tuna-2846046f71d9d10b70b5b4a660f33c92022d66c8.tar.gz
kernel_samsung_tuna-2846046f71d9d10b70b5b4a660f33c92022d66c8.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 b08fcd2..87c54db 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1004,10 +1004,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;