Message ID | 20240220181319.368485-1-luiz.dentz@gmail.com |
---|---|
State | New |
Headers | show |
Series | [v1] Bluetooth: hci_sync: Fix UAF on create_le_conn_complete | expand |
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 7306020ccda3..669099cf9b1a 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -6708,6 +6708,9 @@ static void create_le_conn_complete(struct hci_dev *hdev, void *data, int err) hci_dev_lock(hdev); + if (!hci_conn_valid(hdev, conn)) + goto done; + if (!err) { hci_connect_le_scan_cleanup(conn, 0x00); goto done;