mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
USB: cdc-acm: more sanity checking
commit 8835ba4a39 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a85722c650
commit
1ea680abf7
@@ -1114,6 +1114,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user