e0b4d23
From 7adc5cbc25dcc47dc3856108d9823d08da75da9d Mon Sep 17 00:00:00 2001
e0b4d23
From: Kangjie Lu <kangjielu@gmail.com>
e0b4d23
Date: Tue, 3 May 2016 16:32:16 -0400
e0b4d23
Subject: [PATCH] USB: usbfs: fix potential infoleak in devio
e0b4d23
MIME-Version: 1.0
e0b4d23
Content-Type: text/plain; charset=UTF-8
e0b4d23
Content-Transfer-Encoding: 8bit
e0b4d23
e0b4d23
The stack object “ci” has a total size of 8 bytes. Its last 3 bytes
e0b4d23
are padding bytes which are not initialized and leaked to userland
e0b4d23
via “copy_to_user”.
e0b4d23
e0b4d23
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
e0b4d23
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e0b4d23
---
e0b4d23
 drivers/usb/core/devio.c | 9 +++++----
e0b4d23
 1 file changed, 5 insertions(+), 4 deletions(-)
e0b4d23
e0b4d23
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
e0b4d23
index 52c4461dfccd..9b7f1f75e887 100644
e0b4d23
--- a/drivers/usb/core/devio.c
e0b4d23
+++ b/drivers/usb/core/devio.c
e0b4d23
@@ -1316,10 +1316,11 @@ static int proc_getdriver(struct usb_dev_state *ps, void __user *arg)
e0b4d23
 
e0b4d23
 static int proc_connectinfo(struct usb_dev_state *ps, void __user *arg)
e0b4d23
 {
e0b4d23
-	struct usbdevfs_connectinfo ci = {
e0b4d23
-		.devnum = ps->dev->devnum,
e0b4d23
-		.slow = ps->dev->speed == USB_SPEED_LOW
e0b4d23
-	};
e0b4d23
+	struct usbdevfs_connectinfo ci;
e0b4d23
+
e0b4d23
+	memset(&ci, 0, sizeof(ci));
e0b4d23
+	ci.devnum = ps->dev->devnum;
e0b4d23
+	ci.slow = ps->dev->speed == USB_SPEED_LOW;
e0b4d23
 
e0b4d23
 	if (copy_to_user(arg, &ci, sizeof(ci)))
e0b4d23
 		return -EFAULT;
e0b4d23
-- 
e0b4d23
2.5.5
e0b4d23