]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Bluetooth: Ignore too large handle values in BIG
authorEdward Adam Davis <eadavis@qq.com>
Mon, 17 Jun 2024 11:09:37 +0000 (19:09 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 28 Jun 2024 18:30:40 +0000 (14:30 -0400)
hci_le_big_sync_established_evt is necessary to filter out cases where the
handle value is belonging to ida id range, otherwise ida will be erroneously
released in hci_conn_cleanup.

Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=b2545b087a01a7319474
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_event.c

index 5d23bcf18716319a26fb0c1cd6fa85e141d07be5..93f7ac905cecea7ce7c90ea0e7c36366b995034a 100644 (file)
@@ -6916,6 +6916,10 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
 
                bis = hci_conn_hash_lookup_handle(hdev, handle);
                if (!bis) {
+                       if (handle > HCI_CONN_HANDLE_MAX) {
+                               bt_dev_dbg(hdev, "ignore too large handle %u", handle);
+                               continue;
+                       }
                        bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY,
                                           HCI_ROLE_SLAVE, handle);
                        if (IS_ERR(bis))