Commit 204028a
Bluetooth: hci_event: fix potential UAF in SSP passkey handlers
commit 85fa351 upstream.
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: 92a2525 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 6cbf217 commit 204028a
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5409 | 5409 | | |
5410 | 5410 | | |
5411 | 5411 | | |
| 5412 | + | |
| 5413 | + | |
5412 | 5414 | | |
5413 | 5415 | | |
5414 | | - | |
| 5416 | + | |
5415 | 5417 | | |
5416 | 5418 | | |
5417 | 5419 | | |
| |||
5420 | 5422 | | |
5421 | 5423 | | |
5422 | 5424 | | |
| 5425 | + | |
| 5426 | + | |
| 5427 | + | |
5423 | 5428 | | |
5424 | 5429 | | |
5425 | 5430 | | |
| |||
5430 | 5435 | | |
5431 | 5436 | | |
5432 | 5437 | | |
| 5438 | + | |
| 5439 | + | |
5433 | 5440 | | |
5434 | 5441 | | |
5435 | | - | |
| 5442 | + | |
5436 | 5443 | | |
5437 | 5444 | | |
5438 | 5445 | | |
5439 | 5446 | | |
5440 | | - | |
| 5447 | + | |
5441 | 5448 | | |
5442 | 5449 | | |
5443 | 5450 | | |
| |||
5452 | 5459 | | |
5453 | 5460 | | |
5454 | 5461 | | |
5455 | | - | |
| 5462 | + | |
5456 | 5463 | | |
5457 | 5464 | | |
5458 | 5465 | | |
5459 | 5466 | | |
5460 | 5467 | | |
5461 | 5468 | | |
| 5469 | + | |
| 5470 | + | |
| 5471 | + | |
5462 | 5472 | | |
5463 | 5473 | | |
5464 | 5474 | | |
| |||
0 commit comments