* [BUG] net: bluetooth: a possible sleep-in-atomic-context bug in disconnect_all_peers()
@ 2019-12-18 12:37 Jia-Ju Bai
0 siblings, 0 replies; only message in thread
From: Jia-Ju Bai @ 2019-12-18 12:37 UTC (permalink / raw)
To: marcel, johan.hedberg; +Cc: linux-bluetooth, netdev, linux-kernel
The kernel module may sleep while holding a spinlock.
The function call path (from bottom to top) in Linux 4.19 is:
net/bluetooth/l2cap_core.c, 840:
mutex_lock in l2cap_get_ident
net/bluetooth/l2cap_core.c, 1402:
l2cap_get_ident in l2cap_send_disconn_req
net/bluetooth/l2cap_core.c, 736:
l2cap_send_disconn_req in l2cap_chan_close
net/bluetooth/6lowpan.c, 1053:
l2cap_chan_close in disconnect_all_peers
net/bluetooth/6lowpan.c, 1051:
spin_lock in disconnect_all_peers
mutex_lock() can sleep at runtime.
I am not sure how to properly fix this possible bug, so I only report it.
This bug is found by a static analysis tool STCheck written by myself.
Best wishes,
Jia-Ju Bai
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-12-18 12:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 12:37 [BUG] net: bluetooth: a possible sleep-in-atomic-context bug in disconnect_all_peers() Jia-Ju Bai
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).