mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2026-06-25 11:43:20 +02:00
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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
79a575e829
commit
c50eccdcbb
|
|
@ -926,6 +926,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user