Skip to content

Commit

Permalink
cdc-acm: hardening against malicious devices
Browse files Browse the repository at this point in the history
This should fix the last holes against malicious devices
still open in cdc-acm. It cannot go into stable due to
the introduction of the common parser.
The fix for stable already merged also covers the problems this patch
fixes.

Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
oneukum authored and gregkh committed Sep 21, 2016
1 parent 3a383cc commit 2ad9d54
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,9 @@ static int acm_probe(struct usb_interface *intf,
return -EINVAL;
}

if (!intf->cur_altsetting)
return -EINVAL;

if (!buflen) {
if (intf->cur_altsetting->endpoint &&
intf->cur_altsetting->endpoint->extralen &&
Expand Down Expand Up @@ -1232,6 +1235,8 @@ static int acm_probe(struct usb_interface *intf,
dev_dbg(&intf->dev, "no interfaces\n");
return -ENODEV;
}
if (!data_interface->cur_altsetting || !control_interface->cur_altsetting)
return -ENODEV;

if (data_intf_num != call_intf_num)
dev_dbg(&intf->dev, "Separate call control interface. That is not fully supported.\n");
Expand Down

0 comments on commit 2ad9d54

Please sign in to comment.