Description of problem:
Local RedHat Enterprise Linux DoS – RHEL 7.1 Kernel crashes on invalid
USB device descriptors (ati_remote2 driver bug1) [local-DoS]
Version-Release number of selected component (if applicable):
OpenSource Security Ralf Spenneberg
Am Bahnhof 3-5
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 (ati_remote2 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
(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 ati_remote2 driver.
Detailed product description
We confirmed the bug on the following system:
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 #########
This is the configuration descriptor containing only one interface descriptor.
The ati_remote2 driver assumes that there will be at least two interface-descriptors with associated endpoint-descriptors.
Since the ati_remote2 driver is expecting a second interface descriptor, the driver tries to dereference a null-pointer.
This results in a crash of the system.
The null-pointer dereference happens in usb_driver_claim_interface() because the ati_remote2 driver passes in the second parameter a null-pointer:
$ nm ati_remote2.ko.debug | grep ati_remote2_probe
0000000000001300 t ati_remote2_probe
$ addr2line -e ati_remote2.ko.debug 1399
**** CentOS-Kernel linux-3.10.0-229.14.1.el7 (drivers/input/misc/ati_remote2.c)
820 ar2->intf = interface;
821 ar2->ep = &alt->endpoint.desc;
823 ar2->intf = usb_ifnum_to_if(udev, 1); /* <-- usb_ifnum_to_if returns a null-pointer if there is only one interface configured */
824 r = usb_driver_claim_interface(&ati_remote2_driver, ar2->intf, ar2); /* the second parameter is obviously a null-pointer which crashes the system */
825 if (r)
826 goto fail1;
827 alt = ar2->intf->cur_altsetting;
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.
Stacktrace, vUSBf-Payload, additional vUSBf-Descriptorfile 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)
Created attachment 1096258 [details]
This vUSBf-Payload requires a file named ati_remote2_bug1.txt located in vUSBf/dev_desc. This file is also attached to this bug-report (* see vUSBf-Descriptorfile *).
Created attachment 1096259 [details]
Modified vUSBf descriptor file
Created attachment 1096260 [details]
Created attachment 1096261 [details]
Arduino firmware demonstrating the bug
CVE-2016-2185 which is Red Hat's private CVE ID was assigned to this security flaw. Please, use it in the public communications regarding this flaw, thank you.
public via: http://seclists.org/bugtraq/2016/Mar/90
patch posted upstream (linux-usb@ and linux-input@ lists):
http://marc.info/?l=linux-usb&m=145874840924378&w=2 | http://article.gmane.org/gmane.linux.usb.general/139169 | http://www.spinics.net/lists/linux-usb/msg138107.html
http://marc.info/?l=linux-input&m=145874841024379&w=2 | http://www.spinics.net/lists/linux-input/msg43818.html
Thank you for reporting this flaw. The Product Security has rated this flaw as having low security impact (bz#1317014), so the patch is currently not planned to be added to the RHEL source trees. If accepted to the upstream, the patch may get to the RHEL trees later at the next USB subsystem code rebase.