]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: hci_sync: Push sync command cancellation to workqueue
authorBenjamin Berg <bberg@redhat.com>
Fri, 17 Dec 2021 15:28:09 +0000 (16:28 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 22 Dec 2021 22:01:27 +0000 (23:01 +0100)
commit7a0f42a950fc1b9067344fe8b998a825b324eeb4
tree3b98ed43f097ae8e357b895c93078b1932207e6b
parentf29b581aaa636699fb0001bdd691e9e7d6c8a5a9
Bluetooth: hci_sync: Push sync command cancellation to workqueue

syzbot reported that hci_cmd_sync_cancel may sleep from the wrong
context. To avoid this, create a new work item that pushes the relevant
parts into a different context.

Note that we keep the old implementation with the name
__hci_cmd_sync_cancel as the sleeping behaviour is desired in some
cases.

Reported-and-tested-by: syzbot+485cc00ea7cf41dfdbf1@syzkaller.appspotmail.com
Fixes: e0c85ac18264 ("Bluetooth: btusb: Cancel sync commands for certain URB errors")
Signed-off-by: Benjamin Berg <bberg@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
include/net/bluetooth/hci_sync.h
net/bluetooth/hci_core.c
net/bluetooth/hci_request.c
net/bluetooth/hci_sync.c