lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241118151947.3323927-1-andre.groenewald@streamunlimited.com>
Date: Mon, 18 Nov 2024 16:19:47 +0100
From: André Groenewald <andre.groenewald@...eamunlimited.com>
To: marcel@...tmann.org,
	johan.hedberg@...il.com,
	luiz.dentz@...il.com,
	linux-bluetooth@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: André Groenewald <andre.groenewald@...eamunlimited.com>
Subject: [PATCH] Bluetooth: hci_sync: fix LE init stage 3 failure

A controller may indicate support for the extended advertising feature but
doesn't support the HCI_LE_Read_Number_of_Supported_Advertising_Sets
command, which will cause the initialization to fail.

Signed-off-by: André Groenewald <andre.groenewald@...eamunlimited.com>
---
 net/bluetooth/hci_sync.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index c86f4e42e69c..c07be5813113 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4416,6 +4416,15 @@ static int hci_le_read_num_support_adv_sets_sync(struct hci_dev *hdev)
 	if (!ext_adv_capable(hdev))
 		return 0;
 
+	/* Checking for extended advertising capabilities is not enough; refine
+	 * by checking if the HCI_LE_Read_Number_of_Supported_Advertising_Sets
+	 * command is supported. Since this command is part of the LE init
+	 * stage 3, the initialization will fail whenever the command is not
+	 * supported for devices that indicate extended advertising features.
+	 */
+	if (!(hdev->commands[36] & 0x80))
+		return 0;
+
 	return __hci_cmd_sync_status(hdev,
 				     HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS,
 				     0, NULL, HCI_CMD_TIMEOUT);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ