From: Peter Hurley <peter@hurleysoftware.com>
To: linux-bluetooth <linux-bluetooth@vger.kernel.org>
Subject: [PATCH 0/2] Fix unsafe hci conn add/del
Date: Tue, 30 Aug 2011 09:22:17 -0400 [thread overview]
Message-ID: <1314710537.2232.9.camel@THOR> (raw)
These two patches address several problems relating to concurrent
access of the connection list and avail tx buffer counts when
hci connections are added and deleted.
Firstly, both the tx & rx tasklets must be disabled while the
unacked pkts are added back to the avail tx buffers counts during
a connection deletion (because the updates are not performed
atomically here or elsewhere -- yet).
Since hci_conn_del is called in both rx_task context and process
context, disabling the rx_task must be performed conditionally
so as to avoid deadlock (if the local cpu is in rx_task tasklet
context and attempts to disable the rx_task, it will wait forever
for the tasklet it's running to end).
Note that the re-enable of the rx_task is performed after the
connection list is modified. This is because hci_num_comp_pkts_evt
does not acquire the device lock while accessing the connection list.
Rather than claim the device lock (which would render useless efforts to
perform tx buffer count arithmetic atomically), instead disable the
rx_task tasklet while the hci connection list is updated.
Peter Hurley (2):
Bluetooth: Fix unsafe tx buffer count updates
Bluetooth: Fix unsafe connection list access
net/bluetooth/hci_conn.c | 16 +++++++++++++---
net/bluetooth/hci_core.c | 4 ----
2 files changed, 13 insertions(+), 7 deletions(-)
--
1.7.4.1
reply other threads:[~2011-08-30 13:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314710537.2232.9.camel@THOR \
--to=peter@hurleysoftware.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).