Bug 566624 (CVE-2010-1083) - CVE-2010-1083 kernel: information leak via userspace USB interface
Summary: CVE-2010-1083 kernel: information leak via userspace USB interface
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2010-1083
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 566625 566626 566627 566628 566629 566630
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-19 01:12 UTC by Eugene Teo (Security Response)
Modified: 2023-05-12 18:45 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-06 07:30:07 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2010:0394 0 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2010-05-05 13:05:05 UTC
Red Hat Product Errata RHSA-2010:0631 0 normal SHIPPED_LIVE Important: kernel-rt security and bug fix update 2010-08-18 07:58:39 UTC
Red Hat Product Errata RHSA-2010:0723 0 normal SHIPPED_LIVE Important: kernel security and bug fix update 2010-09-29 14:53:22 UTC

Description Eugene Teo (Security Response) 2010-02-19 01:12:34 UTC
Description of problem:
Reported by Marcus Meissner. While programming a USB device using libusb he found that a usb read from the device returned data it should not.

Looking into the code showed that in USB commands that fail during device communication (with e.g. USB timeouts) return the transfer buffer unmodified back to userspace.

This transfer buffer is allocated with kmalloc before and not initialized, so userspace gets to see recently freed data of the kernel.

Greg, Linus and Alan produced a fix that was commited to mainline:

commit d4a4683ca054ed9917dfc9e3ff0f7ecf74ad90d6

The issue seems to have been in the kernel for the whole 2.6 series (oldest kernel he looked at was 2.6.5, he tested down to 2.6.25).

Access to USB userspace devices either requires root access or desktop user access via udev/hal ACLs on non-mass-storage Digital Cameras or Media Players. (So the desktop user needs to plugin such a ACL getting device before being able 
to read the memory).

Comment 2 Linda Wang 2010-02-20 04:14:46 UTC
2.6.32-stable review patch. 

------------------
From: Greg KH <greg>

commit d4a4683ca054ed9917dfc9e3ff0f7ecf74ad90d6 upstream.

We need to only copy the data received by the device to userspace, not
the whole kernel buffer, which can contain "stale" data.

Thanks to Marcus Meissner for pointing this out and testing the fix.

Reported-by: Marcus Meissner <meissner>
Tested-by: Marcus Meissner <meissner>
Cc: Alan Stern <stern.edu>
Cc: Linus Torvalds <torvalds>
Signed-off-by: Greg Kroah-Hartman <gregkh>

---
 drivers/usb/core/devio.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1312,9 +1312,9 @@ static int processcompl(struct async *as
 	void __user *addr = as->userurb;
 	unsigned int i;
 
-	if (as->userbuffer)
+	if (as->userbuffer && urb->actual_length)
 		if (copy_to_user(as->userbuffer, urb->transfer_buffer,
-				 urb->transfer_buffer_length))
+				 urb->actual_length))
 			goto err_out;
 	if (put_user(as->status, &userurb->status))
 		goto err_out;
@@ -1435,9 +1435,9 @@ static int processcompl_compat(struct as
 	void __user *addr = as->userurb;
 	unsigned int i;
 
-	if (as->userbuffer)
+	if (as->userbuffer && urb->actual_length)
 		if (copy_to_user(as->userbuffer, urb->transfer_buffer,
-				 urb->transfer_buffer_length))
+				 urb->actual_length))
 			return -EFAULT;
 	if (put_user(as->status, &userurb->status))
 		return -EFAULT;

Comment 3 errata-xmlrpc 2010-05-05 13:05:24 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2010:0394 https://rhn.redhat.com/errata/RHSA-2010-0394.html

Comment 4 Eugene Teo (Security Response) 2010-07-08 02:40:30 UTC
Acknowledgements:

Red Hat would like to thank Marcus Meissner for reporting this issue.

Comment 5 errata-xmlrpc 2010-08-17 15:53:21 UTC
This issue has been addressed in following products:

  MRG for RHEL-5

Via RHSA-2010:0631 https://rhn.redhat.com/errata/RHSA-2010-0631.html

Comment 6 errata-xmlrpc 2010-09-29 14:54:12 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2010:0723 https://rhn.redhat.com/errata/RHSA-2010-0723.html


Note You need to log in before you can comment on or make changes to this bug.