Skip to content

Commit aea7791

Browse files
peilin-yegregkh
authored andcommitted
Bluetooth: Fix slab-out-of-bounds read in hci_extended_inquiry_result_evt()
commit 51c19bf upstream. Check upon `num_rsp` is insufficient. A malformed event packet with a large `num_rsp` number makes hci_extended_inquiry_result_evt() go out of bounds. Fix it. This patch fixes the following syzbot bug: https://syzkaller.appspot.com/bug?id=4bf11aa05c4ca51ce0df86e500fce486552dc8d2 Reported-by: [email protected] Cc: [email protected] Signed-off-by: Peilin Ye <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5a48144 commit aea7791

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bluetooth/hci_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3826,7 +3826,7 @@ static void hci_extended_inquiry_result_evt(struct hci_dev *hdev,
38263826

38273827
BT_DBG("%s num_rsp %d", hdev->name, num_rsp);
38283828

3829-
if (!num_rsp)
3829+
if (!num_rsp || skb->len < num_rsp * sizeof(*info) + 1)
38303830
return;
38313831

38323832
if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ))

0 commit comments

Comments
 (0)