]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: use hdev lock in activate_scan for hci_is_adv_monitoring
authorNiels Dossche <dossche.niels@gmail.com>
Thu, 7 Apr 2022 18:06:52 +0000 (20:06 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 13 May 2022 11:05:49 +0000 (13:05 +0200)
commitbd18542ad8407869eb0a61b2f7d0755e47ce237f
tree486c01956e5c0ea0e061d5c1a21cec9fb07d20d8
parenteeecf7aa3f1591844b8098487cb143b82060e2b1
Bluetooth: use hdev lock in activate_scan for hci_is_adv_monitoring

hci_is_adv_monitoring's function documentation states that it must be
called under the hdev lock. Paths that leads to an unlocked call are:
discov_update => start_discovery => interleaved_discov => active_scan
and: discov_update => start_discovery => active_scan

The solution is to take the lock in active_scan during the duration of
the call to hci_is_adv_monitoring.

Fixes: 0642629989e4 ("Bluetooth: disable filter dup when scan for adv monitor")
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_request.c