Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_evt()
authorPeilin Ye <yepeilin.cs@gmail.com>
Fri, 10 Jul 2020 21:39:18 +0000 (17:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 08:52:55 +0000 (10:52 +0200)
commita3cc6834b0e2c39c9e8d84f67745c501b33867b1
treefb5e8f3b7e51f96469ddd2d15be979c64b59b240
parent491602ede684bb8554254f12f4b1bd242dd15c61
Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_evt()

commit 75bbd2ea50ba1c5d9da878a17e92eac02fe0fd3a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bluetooth/hci_event.c