Skip to content

Commit 51c19bf

Browse files
peilin-yeholtmann
authored andcommitted
Bluetooth: Fix slab-out-of-bounds read in hci_extended_inquiry_result_evt()
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]>
1 parent 51b64c4 commit 51c19bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/bluetooth/hci_event.c

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

43764376
BT_DBG("%s num_rsp %d", hdev->name, num_rsp);
43774377

4378-
if (!num_rsp)
4378+
if (!num_rsp || skb->len < num_rsp * sizeof(*info) + 1)
43794379
return;
43804380

43814381
if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ))

0 commit comments

Comments
 (0)