Skip to contentSkip to conversation

Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent

PATCH Applied Luiz Augusto von Dentz 3 participants 3 messages Nov 20, 2023 – Nov 22, 2023

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent

From: Luiz Augusto von Dentz <[email protected]>

Before setting HCI_INQUIRY bit check if HCI_OP_INQUIRY was really sent otherwise the controller maybe be generating invalid events or, more likely, it is a result of fuzzing tools attempting to test the right behavior of the stack when unexpected events are generated.

---
 net/bluetooth/hci_event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/bluetooth/hci_event.c +2 -1
index 5b6fd625fc09..a94decff233e 100644
@@ -2302,7 +2302,8 @@ static void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
 		return;
 	}
 
-	set_bit(HCI_INQUIRY, &hdev->flags);
+	if (hci_sent_cmd_data(hdev, HCI_OP_INQUIRY))
+		set_bit(HCI_INQUIRY, &hdev->flags);
 }
 
 static void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
Signature · 1 line
2.42.0
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=802524

---Test result---

Test Summary:

CheckPatch                    PASS      0.71 seconds
GitLint                       PASS      0.33 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      27.88 seconds
CheckAllWarning               PASS      30.85 seconds
CheckSparse                   WARNING   36.12 seconds
CheckSmatch                   WARNING   100.11 seconds
BuildKernel32                 PASS      27.33 seconds
TestRunnerSetup               PASS      423.24 seconds
TestRunner_l2cap-tester       PASS      23.05 seconds
TestRunner_iso-tester         PASS      40.89 seconds
TestRunner_bnep-tester        PASS      7.07 seconds
TestRunner_mgmt-tester        PASS      163.01 seconds
TestRunner_rfcomm-tester      PASS      11.40 seconds
TestRunner_sco-tester         PASS      14.61 seconds
TestRunner_ioctl-tester       PASS      12.23 seconds
TestRunner_mesh-tester        PASS      9.09 seconds
TestRunner_smp-tester         PASS      9.90 seconds
TestRunner_userchan-tester    PASS      7.48 seconds
IncrementalBuild              PASS      26.48 seconds

Details
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Luiz Augusto von Dentz
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 8 lines · On Mon, 20 Nov 2023 10:10:39 -0500 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

Before setting HCI_INQUIRY bit check if HCI_OP_INQUIRY was really sent otherwise the controller maybe be generating invalid events or, more likely, it is a result of fuzzing tools attempting to test the right behavior of the stack when unexpected events are generated.

[...]

Here is the summary with links:
- [v1] Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent

    https://git.kernel.org/bluetooth/bluetooth-next/c/24ce9ab6c3a3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html