linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] rfcomm: Implement rfcomm as a proper tty_port
@ 2013-07-26 17:18 Gianluca Anzolin
  2013-07-26 17:18 ` [PATCH v4 1/6] rfcomm: Take proper tty_struct references Gianluca Anzolin
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Gianluca Anzolin @ 2013-07-26 17:18 UTC (permalink / raw)
  To: gustavo; +Cc: peter, marcel, linux-bluetooth, gregkh, jslaby, Gianluca Anzolin

This patchset addresses an issue with the rfcomm tty driver in the
current stable kernels that manifests itself as a sudden lockup of the
whole machine or as a OOPS if we are lucky enough (I wasn't).

Triggering the problem is very easy:

1) establish a bluetooth connection with a bluetooth host
2) open the tty it provides with some program
3) turn off the bluetooth host or take it out of range

After a timeout the machine freezes.

Another way to trigger these lockups is to simply release the rfcomm
tty.

This happens because the underlying tty_struct objects and tty_port
objects are freed while being used: the code doesn't take references
properly.

The following patches address the problem by implementing a proper
tty_port driver for rfcomm.

There are still some issues left: one relevant to flow control (which is
also missing in the current code) and another relevant to a corner case
in rfcomm_dev_state_change() that I intend to fix with a future patch.
They are commented with a FIXME.

Thank you,
Gianluca

Gianluca Anzolin (6):
  rfcomm: Take proper tty_struct references
  rfcomm: Remove the device from the list in the destructor
  rfcomm: Move the tty initialization and cleanup out of open/close
  rfcomm: Implement .activate, .shutdown and .carrier_raised methods
  rfcomm: Fix the reference counting of tty_port
  rfcomm: Purge the dlc->tx_queue to avoid circular dependency

 net/bluetooth/rfcomm/tty.c | 263 +++++++++++++++++++++------------------------
 1 file changed, 122 insertions(+), 141 deletions(-)

-- 
1.8.3.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-07-27 12:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-26 17:18 [PATCH v4 0/6] rfcomm: Implement rfcomm as a proper tty_port Gianluca Anzolin
2013-07-26 17:18 ` [PATCH v4 1/6] rfcomm: Take proper tty_struct references Gianluca Anzolin
2013-07-26 17:18 ` [PATCH v4 2/6] rfcomm: Remove the device from the list in the destructor Gianluca Anzolin
2013-07-26 17:18 ` [PATCH v4 3/6] rfcomm: Move the tty initialization and cleanup out of open/close Gianluca Anzolin
2013-07-26 20:04   ` Peter Hurley
2013-07-26 17:18 ` [PATCH v4 4/6] rfcomm: Implement .activate, .shutdown and .carrier_raised methods Gianluca Anzolin
2013-07-26 17:18 ` [PATCH v4 5/6] rfcomm: Fix the reference counting of tty_port Gianluca Anzolin
2013-07-27  0:20   ` Peter Hurley
2013-07-27  4:48     ` Gianluca Anzolin
2013-07-27 12:07       ` Peter Hurley
2013-07-26 17:18 ` [PATCH v4 6/6] rfcomm: Purge the dlc->tx_queue to avoid circular dependency Gianluca Anzolin
2013-07-26 19:56 ` [PATCH v4 0/6] rfcomm: Implement rfcomm as a proper tty_port Peter Hurley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).