Skip to content

Commit

Permalink
cdc-acm: fix uninitialized variable
Browse files Browse the repository at this point in the history
variable struct usb_cdc_parsed_header h may be used
uninitialized in acm_probe.

In kernel 4.8.

    /* handle quirks deadly to normal probing*/
    if (quirks == NO_UNION_NORMAL)

        ...

        goto skip_normal_probe;
    }

we bypass call to

    cdc_parse_cdc_header(&h, intf, buffer, buflen);

but later use h in

    if (h.usb_cdc_country_functional_desc) { /* export the country data */

Signed-off-by: Oliver Neukum <[email protected]>
CC: [email protected]
Reported-by: Victor Sologoubov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
oneukum authored and gregkh committed Nov 7, 2016
1 parent c289d0e commit 7309aa8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,8 @@ static int acm_probe(struct usb_interface *intf,
if (quirks == IGNORE_DEVICE)
return -ENODEV;

memset(&h, 0x00, sizeof(struct usb_cdc_parsed_header));

num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;

/* handle quirks deadly to normal probing*/
Expand Down

0 comments on commit 7309aa8

Please sign in to comment.