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>
Tue, 11 Aug 2020 13:35:32 +0000 (15:35 +0200)
commite70b3552ac337c9480d9a74b3c6459710fe8364c
treec8981a27952dcee3f7590d76e71fb80227566b1c
parent886a27c346901b6b5a3d5b12ca50ca821817185d
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