]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: hci_event: Fix checking for invalid handle on error status
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 22 Apr 2022 19:58:16 +0000 (12:58 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 26 Apr 2022 18:09:07 +0000 (20:09 +0200)
commit29e7f43dfab0e0b2e36f4519964a0a076515fa78
tree94ca42dbea61debf9f91f8ce1dd251c536795ce4
parentd64972b55dd2517b1d18a32abfd449350e05a7d4
Bluetooth: hci_event: Fix checking for invalid handle on error status

Commit db37ab5f3d4f3 introduces checks for handle range
(e.g HCI_CONN_HANDLE_MAX) but controllers like Intel AX200 don't seem
to respect the valid range int case of error status:

> HCI Event: Connect Complete (0x03) plen 11
        Status: Page Timeout (0x04)
        Handle: 65535
        Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&
Sound Products Inc)
        Link type: ACL (0x01)
        Encryption: Disabled (0x00)
[1644965.827560] Bluetooth: hci0: Ignoring HCI_Connection_Complete for invalid handle

Because of it is impossible to cleanup the connections properly since
the stack would attempt to cancel the connection which is no longer in
progress causing the following trace:

< HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
        Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&
Sound Products Inc)
= bluetoothd: src/profile.c:record_cb() Unable to get Hands-Free Voice
gateway SDP record: Connection timed out
> HCI Event: Command Complete (0x0e) plen 10
      Create Connection Cancel (0x01|0x0008) ncmd 1
        Status: Unknown Connection Identifier (0x02)
        Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&
Sound Products Inc)
< HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
        Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&
Sound Products Inc)

Fixes: db37ab5f3d4f3 ("Bluetooth: hci_event: Ignore multiple conn complete events")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci.h
net/bluetooth/hci_event.c