projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3344537
)
Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_evt()
author
Peilin Ye
<yepeilin.cs@gmail.com>
Fri, 10 Jul 2020 21:39:18 +0000
(17:39 -0400)
committer
Marcel Holtmann
<marcel@holtmann.org>
Mon, 13 Jul 2020 16:40:58 +0000
(18:40 +0200)
Check `num_rsp` before using it as for-loop counter.
Cc: stable@vger.kernel.org
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_event.c
patch
|
blob
|
history
diff --git
a/net/bluetooth/hci_event.c
b/net/bluetooth/hci_event.c
index
927bde5
..
b97d024
100644
(file)
--- a/
net/bluetooth/hci_event.c
+++ b/
net/bluetooth/hci_event.c
@@
-2517,7
+2517,7
@@
static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb)
BT_DBG("%s num_rsp %d", hdev->name, num_rsp);
- if (!num_rsp)
+ if (!num_rsp
|| skb->len < num_rsp * sizeof(*info) + 1
)
return;
if (hci_dev_test_flag(hdev, HCI_PERIODIC_INQ))