diff options
author | Vasiliy Kulikov <segooon@gmail.com> | 2010-11-06 17:41:28 +0300 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2010-12-14 23:40:13 +0100 |
commit | 08dfe568671b01bf3c19c97b0dd91ea3a863123b (patch) | |
tree | f6cbe12ec9fa7a10de317ef9299303f7263cb4fd /drivers | |
parent | 5f5e68292004921ff329aa58d27023f5e10ac27a (diff) |
usb: core: fix information leak to userland
commit 886ccd4520064408ce5876cfe00554ce52ecf4a7 upstream.
Structure usbdevfs_connectinfo is copied to userland with padding byted
after "slow" field uninitialized. It leads to leaking of contents of
kernel stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/devio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index c2f62a3993d..da050245a5c 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -965,10 +965,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; + struct usbdevfs_connectinfo ci = { + .devnum = ps->dev->devnum, + .slow = ps->dev->speed == USB_SPEED_LOW + }; - ci.devnum = ps->dev->devnum; - ci.slow = ps->dev->speed == USB_SPEED_LOW; if (copy_to_user(arg, &ci, sizeof(ci))) return -EFAULT; return 0; |