]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
USB: usbfs: fix potential infoleak in devio
authorKangjie Lu <kangjielu@gmail.com>
Fri, 15 Jul 2016 19:08:18 +0000 (15:08 -0400)
committerWilly Tarreau <w@1wt.eu>
Sun, 21 Aug 2016 21:22:34 +0000 (23:22 +0200)
commit 681fef8380eb818c0b845fca5d2ab1dcbab114ee upstream.

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".

CVE-2016-4482

Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ciwillia@brocade.com: backported to 3.10: adjusted context]
Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/usb/core/devio.c

index 62e532fb82ad4a4230094becb2fa676a1a9b9d78..cfce807531f620833f60ae569aee27a6ec259914 100644 (file)
@@ -1106,10 +1106,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;