Skip to contentSkip to conversation

CVE-2026-31629: nfc: llcp: add missing return after LLCP_CLOSED checks

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 24

lore
Share & tools
lore
#0 lore raw

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

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

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

nfc: llcp: add missing return after LLCP_CLOSED checks

In nfc_llcp_recv_hdlc() and nfc_llcp_recv_disc(), when the socket state is LLCP_CLOSED, the code correctly calls release_sock() and nfc_llcp_sock_put() but fails to return. Execution falls through to the remainder of the function, which calls release_sock() and nfc_llcp_sock_put() again. This results in a double release_sock() and a refcount underflow via double nfc_llcp_sock_put(), leading to a use-after-free.

Add the missing return statements after the LLCP_CLOSED branches in both functions to prevent the fall-through.

The Linux kernel CVE team has assigned CVE-2026-31629 to this issue.

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

	Fixed in 6.12.83 with commit 796e0cac058252d0ad34ebe288e6f7979b5fc9b2
	Fixed in 6.18.24 with commit 8977fad2b3c6eefd414131168d597c5d1d5e1abf
	Fixed in 6.19.14 with commit ff3d9e8f7244293e303f7b6ef70774291c7c27e9
	Fixed in 7.0.1 with commit aba4712e8f0381cd5d196534ce2ad082626a5ab6

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-2026-31629

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/llcp_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/796e0cac058252d0ad34ebe288e6f7979b5fc9b2
	https://git.kernel.org/stable/c/8977fad2b3c6eefd414131168d597c5d1d5e1abf
	https://git.kernel.org/stable/c/ff3d9e8f7244293e303f7b6ef70774291c7c27e9
	https://git.kernel.org/stable/c/aba4712e8f0381cd5d196534ce2ad082626a5ab6
	https://git.kernel.org/stable/c/2b5dd4632966c39da6ba74dbc8689b309065e82c