Skip to content

Commit 99e67d4

Browse files
committed
Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent
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. Cc: [email protected] Link: https://bugzilla.kernel.org/show_bug.cgi?id=218151 Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 769bf60 commit 99e67d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/bluetooth/hci_event.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2302,7 +2302,8 @@ static void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
23022302
return;
23032303
}
23042304

2305-
set_bit(HCI_INQUIRY, &hdev->flags);
2305+
if (hci_sent_cmd_data(hdev, HCI_OP_INQUIRY))
2306+
set_bit(HCI_INQUIRY, &hdev->flags);
23062307
}
23072308

23082309
static void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)

0 commit comments

Comments
 (0)