lkml.org 
[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 035/241] usb: misc: lvs: fix race condition in disconnect handling
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

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

    From: Oliver Neukum <oneukum@suse.com>


    [ Upstream commit c4ba329cabca7c839ab48fb58b5bcc2582951a48 ]

    There is a small window during which the an URB may
    remain active after disconnect has returned. If in that case
    already freed memory may be accessed and executed.

    The fix is to poison the URB befotre the work is flushed.

    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/usb/misc/lvstest.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/drivers/usb/misc/lvstest.c
    +++ b/drivers/usb/misc/lvstest.c
    @@ -433,6 +433,7 @@ static void lvs_rh_disconnect(struct usb
    struct lvs_rh *lvs = usb_get_intfdata(intf);

    sysfs_remove_group(&intf->dev.kobj, &lvs_attr_group);
    + usb_poison_urb(lvs->urb); /* used in scheduled work */
    flush_work(&lvs->rh_work);
    usb_free_urb(lvs->urb);
    }

    \
     
     \ /
      Last update: 2018-03-19 20:56    [W:5.767 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site