Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8835ba4a authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman
Browse files

USB: cdc-acm: more sanity checking



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: default avatarOliver Neukum <ONeukum@suse.com>
CC: stable@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0b818e39
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1179,6 +1179,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;
	}