Subject: CVE-2023-52507: nfc: nci: assert requested protocol is valid

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

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

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

nfc: nci: assert requested protocol is valid

The protocol is used in a bit mask to determine if the protocol is
supported. Assert the provided protocol is less than the maximum
defined so it doesn't potentially perform a shift-out-of-bounds and
provide a clearer error for undefined protocols vs unsupported ones.

The Linux kernel CVE team has assigned CVE-2023-52507 to this issue.

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

	Issue introduced in 3.2 with commit 6a2968aaf50c and fixed in 4.14.328 with commit 2c231a247a1d
	Issue introduced in 3.2 with commit 6a2968aaf50c and fixed in 4.19.297 with commit a686f8410168
	Issue introduced in 3.2 with commit 6a2968aaf50c and fixed in 5.4.259 with commit 95733ea130e3
	Issue introduced in 3.2 with commit 6a2968aaf50c and fixed in 5.10.199 with commit a424807d860b
	Issue introduced in 3.2 with commit 6a2968aaf50c and fixed in 5.15.136 with commit 25dd54b95abf
	Issue introduced in 3.2 with commit 6a2968aaf50c and fixed in 6.1.59 with commit 853dda54ba59
	Issue introduced in 3.2 with commit 6a2968aaf50c and fixed in 6.5.8 with commit 6584eba7688d
	Issue introduced in 3.2 with commit 6a2968aaf50c and fixed in 6.6 with commit 354a6e707e29

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-2023-52507
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/nfc/nci/core.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/2c231a247a1d1628e41fa1eefd1a5307c41c5f53
	https://git.kernel.org/stable/c/a686f84101680b8442181a8846fbd3c934653729
	https://git.kernel.org/stable/c/95733ea130e35ef9ec5949a5908dde3feaba92cb
	https://git.kernel.org/stable/c/a424807d860ba816aaafc3064b46b456361c0802
	https://git.kernel.org/stable/c/25dd54b95abfdca423b65a4ee620a774777d8213
	https://git.kernel.org/stable/c/853dda54ba59ea70d5580a298b7ede4707826848
	https://git.kernel.org/stable/c/6584eba7688dcf999542778b07f63828c21521da
	https://git.kernel.org/stable/c/354a6e707e29cb0c007176ee5b8db8be7bd2dee0