Skip to content

Commit 5a17406

Browse files
author
CKI Backport Bot
committed
Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()
JIRA: https://issues.redhat.com/browse/RHEL-81268 CVE: CVE-2024-57987 commit 3c15082 Author: Max Chou <max.chou@realtek.com> Date: Tue Dec 31 14:57:19 2024 +0800 Bluetooth: btrtl: check for NULL in btrtl_setup_realtek() If insert an USB dongle which chip is not maintained in ic_id_table, it will hit the NULL point accessed. Add a null point check to avoid the Kernel Oops. Fixes: b39910b ("Bluetooth: Populate hci_set_hw_info for Intel and Realtek") Reviewed-by: Alex Lu <alex_lu@realsil.com.cn> Signed-off-by: Max Chou <max.chou@realtek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 5150d3a commit 5a17406

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/bluetooth/btrtl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,12 +1351,14 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
13511351

13521352
btrtl_set_quirks(hdev, btrtl_dev);
13531353

1354-
hci_set_hw_info(hdev,
1354+
if (btrtl_dev->ic_info) {
1355+
hci_set_hw_info(hdev,
13551356
"RTL lmp_subver=%u hci_rev=%u hci_ver=%u hci_bus=%u",
13561357
btrtl_dev->ic_info->lmp_subver,
13571358
btrtl_dev->ic_info->hci_rev,
13581359
btrtl_dev->ic_info->hci_ver,
13591360
btrtl_dev->ic_info->hci_bus);
1361+
}
13601362

13611363
btrtl_free(btrtl_dev);
13621364
return ret;

0 commit comments

Comments
 (0)