]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Bluetooth: hci_event: fix potential UAF in SSP passkey handlers
authorShuvam Pandey <shuvampandey1@gmail.com>
Wed, 8 Apr 2026 18:47:30 +0000 (00:32 +0545)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 13 Apr 2026 13:19:42 +0000 (09:19 -0400)
commit85fa3512048793076eef658f66489112dcc91993
tree81ca8abf09de66bca541fbea2c16ede8c44be813
parenta0cff16d0f6e0bcd4173583694b85df42912e644
Bluetooth: hci_event: fix potential UAF in SSP passkey handlers

hci_conn lookup and field access must be covered by hdev lock in
hci_user_passkey_notify_evt() and hci_keypress_notify_evt(), otherwise
the connection can be freed concurrently.

Extend the hci_dev_lock critical section to cover all conn usage in both
handlers.

Keep the existing keypress notification behavior unchanged by routing
the early exits through a common unlock path.

Fixes: 92a25256f142 ("Bluetooth: mgmt: Implement support for passkey notification")
Cc: stable@vger.kernel.org
Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_event.c