Bluetooth: use hdev lock for accept_list and reject_list in conn req
authorNiels Dossche <dossche.niels@gmail.com>
Tue, 5 Apr 2022 17:37:52 +0000 (19:37 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 13 May 2022 11:05:49 +0000 (13:05 +0200)
commitfb048cae51bacdfbbda2954af3c213fdb1d484f4
tree96641604e4a77081c2e4b01add51dc00f1a1642b
parent50a3633ae5e98cf1b80ef5b73c9e341aee9ad896
Bluetooth: use hdev lock for accept_list and reject_list in conn req

All accesses (both reads and modifications) to
hdev->{accept,reject}_list are protected by hdev lock,
except the ones in hci_conn_request_evt. This can cause a race
condition in the form of a list corruption.
The solution is to protect these lists in hci_conn_request_evt as well.

I was unable to find the exact commit that introduced the issue for the
reject list, I was only able to find it for the accept list.

Fixes: a55bd29d5227 ("Bluetooth: Add white list lookup for incoming connection requests")
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_event.c