Skip to content
Commit 11eb85ec authored by Dan Carpenter's avatar Dan Carpenter Committed by Johan Hedberg
Browse files

Bluetooth: Fix race condition in hci_release_sock()



Syzbot managed to trigger a use after free "KASAN: use-after-free Write
in hci_sock_bind".  I have reviewed the code manually and one possibly
cause I have found is that we are not holding lock_sock(sk) when we do
the hci_dev_put(hdev) in hci_sock_release().  My theory is that the bind
and the release are racing against each other which results in this use
after free.

Reported-by: default avatar <syzbot+eba992608adf3d796bcc@syzkaller.appspotmail.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 18f81241
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment