Skip to content

Commit 470896e

Browse files
Vudentzgregkh
authored andcommitted
Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent
commit 99e67d4 upstream. 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: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=218151 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d36d945 commit 470896e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/bluetooth/hci_event.c

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

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

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

0 commit comments

Comments
 (0)