• Johan Hovold's avatar
    USB: cdc-acm: fix write and resume race · e144ed28
    Johan Hovold authored
    Fix race between write() and resume() due to improper locking that could
    lead to writes being reordered.
    
    Resume must be done atomically and susp_count be protected by the
    write_lock in order to prevent racing with write(). This could otherwise
    lead to writes being reordered if write() grabs the write_lock after
    susp_count is decremented, but before the delayed urb is submitted.
    
    Fixes: 11ea859d ("USB: additional power savings for cdc-acm devices
    that support remote wakeup")
    
    Cc: <stable@vger.kernel.org>	# v2.6.27
    Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    e144ed28
cdc-acm.c 50.3 KB