All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] bluetooth:Fix concurrent access issue in the function chan_close_cb
@ 2015-12-20  7:30 Nicholas Krause
  0 siblings, 0 replies; only message in thread
From: Nicholas Krause @ 2015-12-20  7:30 UTC (permalink / raw)
  To: marcel
  Cc: gustavo, johan.hedberg, davem, linux-bluetooth, netdev, linux-kernel

This fixes a concurrent access issue in the function chan_close_cb
by not locking and unlocking around the function peer_lockup_chan
by use of the function locking pair rcu_read_lock/unlock in order
to have actual protection from concurrent threads of execution when
calling this particular function in the function chan_close_cb.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 net/bluetooth/6lowpan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 2fb7b30..7fc20cb 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -955,7 +955,9 @@ static void chan_close_cb(struct l2cap_chan *chan)
 
 	list_for_each_entry_rcu(entry, &bt_6lowpan_devices, list) {
 		dev = lowpan_dev(entry->netdev);
+		rcu_read_lock();
 		peer = __peer_lookup_chan(dev, chan);
+		rcu_read_unlock();
 		if (peer) {
 			last = peer_del(dev, peer);
 			err = 0;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-20  7:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-20  7:30 [PATCH RESEND] bluetooth:Fix concurrent access issue in the function chan_close_cb Nicholas Krause

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.