• C
    USB: fix thread-unsafe anchor utiliy routines · b3e67044
    Christian Lamparter 提交于
    This patch fixes a race condition in two utility routines
    related to the removal/unlinking of urbs from an anchor.
    
    If two threads are concurrently accessing the same anchor,
    both could end up with the same urb - thinking they are
    the exclusive owner.
    
    Alan Stern pointed out a related issue in
    usb_unlink_anchored_urbs:
    
    "The URB isn't removed from the anchor until it completes
     (as a by-product of completion, in fact), which might not
     be for quite some time after the unlink call returns.
     In the meantime, the subroutine will keep trying to unlink
     it, over and over again."
    
    Cc: stable <stable@kernel.org>
    Cc: Oliver Neukum <oneukum@suse.de>
    Cc: Greg Kroah-Hartman <greg@kroah.com>
    Acked-by: NAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: NChristian Lamparter <chunkeey@googlemail.com>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
    
    b3e67044
urb.c 27.3 KB