Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_with_rssi_evt()
authorPeilin Ye <yepeilin.cs@gmail.com>
Fri, 10 Jul 2020 21:45:26 +0000 (17:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Aug 2020 13:35:32 +0000 (15:35 +0200)
commitc9c49205b2f130b5cd258e6f8abdbd3fda429ffe
tree71d77f6984facf6bae9e5b5789fa7575cf4dc840
parente70b3552ac337c9480d9a74b3c6459710fe8364c
Bluetooth: Prevent out-of-bounds read in hci_inquiry_result_with_rssi_evt()

commit 629b49c848ee71244203934347bd7730b0ddee8d upstream.

Check `num_rsp` before using it as for-loop counter. Add `unlock` label.

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