Skip to content

Commit 8835ba4

Browse files
oneukumgregkh
authored andcommitted
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: Oliver Neukum <ONeukum@suse.com> CC: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0b818e3 commit 8835ba4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/usb/class/cdc-acm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,9 @@ static int acm_probe(struct usb_interface *intf,
11791179
if (quirks == NO_UNION_NORMAL) {
11801180
data_interface = usb_ifnum_to_if(usb_dev, 1);
11811181
control_interface = usb_ifnum_to_if(usb_dev, 0);
1182+
/* we would crash */
1183+
if (!data_interface || !control_interface)
1184+
return -ENODEV;
11821185
goto skip_normal_probe;
11831186
}
11841187

0 commit comments

Comments
 (0)