Commit 53b63616 authored by Thilo-Alexander Ginkel's avatar Thilo-Alexander Ginkel Committed by Greg Kroah-Hartman
Browse files

usb: cdc-acm: Fix acm_tty_hangup() vs. acm_tty_close() race



[Not upstream s it was fixed differently there for 3.3 with a much more
"intrusive" rework of the driver - gregkh]

There is a race condition involving acm_tty_hangup() and acm_tty_close()
where hangup() would attempt to access tty->driver_data without proper
locking and NULL checking after close() has potentially already set it
to NULL.  One possibility to (sporadically) trigger this behavior is to
perform a suspend/resume cycle with a running WWAN data connection.

This patch addresses the issue by introducing a NULL check for
tty->driver_data in acm_tty_hangup() protected by open_mutex and exiting
gracefully when hangup() is invoked on a device that has already been
closed.

Signed-off-by: default avatarThilo-Alexander Ginkel <thilo@ginkel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cdd2a1da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment