2023-11-20 15:10:54

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH v1] 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.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=218151
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
---
net/bluetooth/hci_event.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 5b6fd625fc09..a94decff233e 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -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)
--
2.42.0



2023-11-20 15:33:39

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v1] Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent

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

2023-11-22 17:40:33

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH v1] Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent

Hello:

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

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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html