lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.10 042/143] USB: serial: fix potential heap buffer overflow
    Date
    3.10-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Johan Hovold <johan@kernel.org>

    commit 5654699fb38512bdbfc0f892ce54fce75bdc2bab upstream.

    Make sure to verify the number of ports requested by subdriver to avoid
    writing beyond the end of fixed-size array in interface data.

    The current usb-serial implementation is limited to eight ports per
    interface but failed to verify that the number of ports requested by a
    subdriver (which could have been determined from device descriptors) did
    not exceed this limit.

    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/usb/serial/usb-serial.c | 5 +++++
    1 file changed, 5 insertions(+)

    --- a/drivers/usb/serial/usb-serial.c
    +++ b/drivers/usb/serial/usb-serial.c
    @@ -876,6 +876,11 @@ static int usb_serial_probe(struct usb_i
    num_ports = type->num_ports;
    }

    + if (num_ports > MAX_NUM_PORTS) {
    + dev_warn(ddev, "too many ports requested: %d\n", num_ports);
    + num_ports = MAX_NUM_PORTS;
    + }
    +
    serial->num_ports = num_ports;
    serial->num_bulk_in = num_bulk_in;
    serial->num_bulk_out = num_bulk_out;



    \
     
     \ /
      Last update: 2014-10-04 01:21    [W:3.890 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site