diff options
| author | Oliver Neukum <oneukum@suse.com> | 2016-03-15 10:14:04 +0100 |
|---|---|---|
| committer | Luis Henriques <luis.henriques@canonical.com> | 2016-03-30 14:49:47 +0100 |
| commit | 173d111b4a26744a2c8f230901a0a418d083efa0 (patch) | |
| tree | 0554cc3db4abc814db0f86a8b7e11444c8e7f90c | |
| parent | 7ea6b63a62afde28feaae499cc8094426b0b4241 (diff) | |
USB: cdc-acm: more sanity checking
commit 8835ba4a39cf53f705417b3b3a94eb067673f2c9 upstream.
An attack has become available which pretends to be a quirky
device circumventing normal sanity checks and crashes the kernel
by an insufficient number of interfaces. This patch adds a check
to the code path for quirky devices.
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Moritz Muehlenhoff <jmm@inutil.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
| -rw-r--r-- | drivers/usb/class/cdc-acm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 332be4c5745c..54061a3bc5e9 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1104,6 +1104,9 @@ static int acm_probe(struct usb_interface *intf, if (quirks == NO_UNION_NORMAL) { data_interface = usb_ifnum_to_if(usb_dev, 1); control_interface = usb_ifnum_to_if(usb_dev, 0); + /* we would crash */ + if (!data_interface || !control_interface) + return -ENODEV; goto skip_normal_probe; } |
