Subject: CVE-2024-42132: bluetooth/hci: disallow setting handle bigger than HCI_CONN_HANDLE_MAX

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

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

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

bluetooth/hci: disallow setting handle bigger than HCI_CONN_HANDLE_MAX

Syzbot hit warning in hci_conn_del() caused by freeing handle that was
not allocated using ida allocator.

This is caused by handle bigger than HCI_CONN_HANDLE_MAX passed by
hci_le_big_sync_established_evt(), which makes code think it's unset
connection.

Add same check for handle upper bound as in hci_conn_set_handle() to
prevent warning.

The Linux kernel CVE team has assigned CVE-2024-42132 to this issue.

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

	Issue introduced in 6.6.2 with commit 84cb0143fb8a and fixed in 6.6.39 with commit 4970e48f83db
	Issue introduced in 6.7 with commit 181a42edddf5 and fixed in 6.9.9 with commit d311036696fe
	Issue introduced in 6.7 with commit 181a42edddf5 and fixed in 6.10 with commit 1cc18c2ab2e8
	Issue introduced in 6.5.12 with commit e9f708beada5

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-2024-42132
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_conn.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/4970e48f83dbd21d2a6a7cdaaafc2a71f7f45dc4
	https://git.kernel.org/stable/c/d311036696fed778301d08a71a4bef737b86d8c5
	https://git.kernel.org/stable/c/1cc18c2ab2e8c54c355ea7c0423a636e415a0c23