Skip to contentSkip to conversation

CVE-2026-90224: nfc: nci: fix double completion race in nci_data_exchange_complete

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 17

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: nci: fix double completion race in nci_data_exchange_complete

nci_close_device() and nci_rx_work can both call nci_data_exchange_complete() concurrently. After commit 4527025d440ce8 ("nfc: nci: fix circular locking dependency in nci_close_device") moved flush_workqueue(ndev->rx_wq) after mutex_unlock(&ndev->req_lock), rx_work is no longer serialized with the explicit completion call in the close path. Both callers read the non-NULL callback pointer and invoke rawsock_data_exchange_complete(), which calls sock_put() -- but only one sock_hold() was taken, so the second sock_put() underflows the refcount and frees the socket while it is still in use.

Replace the bare clear_bit(NCI_DATA_EXCHANGE) with test_and_clear_bit() so that only the first caller proceeds to invoke the callback.

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

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

	Issue introduced in 5.10.253 with commit 7ed00a3edc8597fe2333f524401e2889aa1b5edf and fixed in 5.10.270 with commit 3f075832734005310740d148d1cf1c1e792ebdca
	Issue introduced in 5.15.203 with commit 5eef9ebec7f5738f12cadede3545c05b34bf5ac3 and fixed in 5.15.221 with commit 588ccd19a6e69eca72d54608c3ab3b45709b2305
	Issue introduced in 6.1.168 with commit ca54e904a071aa65ef3ad46ba42d51aaac6b73b4 and fixed in 6.1.188 with commit cf646a9f5554bc07d6ccb59c327812b3a0c6a368
	Issue introduced in 6.6.131 with commit eb435d150ca74b4d40f77f1a2266f3636ed64a79 and fixed in 6.6.157 with commit 9030a1bbe2c6b1e3e54cef462d159b5248f09fd2
	Issue introduced in 6.12.80 with commit 1edc12d2bbcb7a8d0f1088e6fccb9d8c01bb1289 and fixed in 6.12.110 with commit bfdf412208fea7fc0d5b32d68a35b25261917393
	Issue introduced in 6.18.21 with commit d89b74bf08f067b55c03d7f999ba0a0e73177eb3 and fixed in 6.18.52 with commit ba4c776af3dc21ed04e315e6545e99703bb1b53a
	Issue introduced in 7.0 with commit 4527025d440ce84bf56e75ce1df2e84cb8178616 and fixed in 7.2.6 with commit ee08414d78b851e3d1856d6e4d631939b01a1bbe
	Issue introduced in 7.0 with commit 4527025d440ce84bf56e75ce1df2e84cb8178616 and fixed in 7.3-rc1 with commit 8265a626cc14a48e46e6dc8c47667e72b4232ac2
	Issue introduced in 6.19.11 with commit 09143c0e8f3b03517e6233aad42f45c794d8df8e

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-90224

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/data.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/3f075832734005310740d148d1cf1c1e792ebdca
	https://git.kernel.org/stable/c/588ccd19a6e69eca72d54608c3ab3b45709b2305
	https://git.kernel.org/stable/c/cf646a9f5554bc07d6ccb59c327812b3a0c6a368
	https://git.kernel.org/stable/c/9030a1bbe2c6b1e3e54cef462d159b5248f09fd2
	https://git.kernel.org/stable/c/bfdf412208fea7fc0d5b32d68a35b25261917393
	https://git.kernel.org/stable/c/ba4c776af3dc21ed04e315e6545e99703bb1b53a
	https://git.kernel.org/stable/c/ee08414d78b851e3d1856d6e4d631939b01a1bbe
	https://git.kernel.org/stable/c/8265a626cc14a48e46e6dc8c47667e72b4232ac2