Subject: CVE-2021-47620: Bluetooth: refactor malicious adv data check

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

Bluetooth: refactor malicious adv data check

Check for out-of-bound read was being performed at the end of while
num_reports loop, and would fill journal with false positives. Added
check to beginning of loop processing so that it doesn't get checked
after ptr has been advanced.

The Linux kernel CVE team has assigned CVE-2021-47620 to this issue.

Affected and fixed versions
===========================

	Fixed in 4.4.302 with commit 305e92f52545
	Fixed in 4.9.300 with commit 7889b38a7f21
	Fixed in 4.14.265 with commit 5a539c08d743
	Fixed in 4.19.228 with commit 8819f93cd4a4
	Fixed in 5.4.176 with commit 835d37068525
	Fixed in 5.10.96 with commit 83d5196b65d1
	Fixed in 5.15.19 with commit bcea886771c3
	Fixed in 5.16.5 with commit 5c968affa804
	Fixed in 5.17 with commit 899663be5e75

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2021-47620
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	net/bluetooth/hci_event.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/305e92f525450f3e1b5f5c9dc7eadb152d66a082
	https://git.kernel.org/stable/c/7889b38a7f21ed19314f83194622b195d328465c
	https://git.kernel.org/stable/c/5a539c08d743d9910631448da78af5e961664c0e
	https://git.kernel.org/stable/c/8819f93cd4a443dfe547aa622b21f723757df3fb
	https://git.kernel.org/stable/c/835d3706852537bf92eb23eb8635b8dee0c0aa67
	https://git.kernel.org/stable/c/83d5196b65d1b29e27d7dd16a3b9b439fb1d2dba
	https://git.kernel.org/stable/c/bcea886771c3f22a590c8c8b9139a107bd7f1e1c
	https://git.kernel.org/stable/c/5c968affa804ba98c3c603f37ffea6fba618025e
	https://git.kernel.org/stable/c/899663be5e75dc0174dc8bda0b5e6826edf0b29a