diff options
author | Kangjie Lu <kangjielu@gmail.com> | 2016-05-03 20:32:16 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-03 21:32:07 (GMT) |
commit | 681fef8380eb818c0b845fca5d2ab1dcbab114ee (patch) | |
tree | f3f41b4a1a87cc8101b627ab61ee96b2b4ba48c9 /drivers/usb/core | |
parent | 973986126a4152ab83d09263a02bf7d2d1bf3b6e (diff) | |
download | linux-681fef8380eb818c0b845fca5d2ab1dcbab114ee.tar.xz |
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”.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/devio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 73ce871..e9f5043 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1316,10 +1316,11 @@ static int proc_getdriver(struct usb_dev_state *ps, void __user *arg) static int proc_connectinfo(struct usb_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; |