CVE-2026-90224: nfc: nci: fix double completion race in nci_data_exchange_complete
In the Linux kernel, the following vulnerability has been resolved:
nfc: nci: fix double completion race in ncidataexchangecomplete
nciclosedevice() and ncirxwork can both call ncidataexchangecomplete() concurrently. After commit 4527025d440ce8 ("nfc: nci: fix circular locking dependency in nciclosedevice") moved flushworkqueue(ndev->rxwq) after mutexunlock(&ndev->reqlock), rxwork is no longer serialized with the explicit completion call in the close path. Both callers read the non-NULL callback pointer and invoke rawsockdataexchangecomplete(), which calls sockput() -- but only one sockhold() was taken, so the second sockput() underflows the refcount and frees the socket while it is still in use.
Replace the bare clearbit(NCIDATAEXCHANGE) with testandclearbit() so that only the first caller proceeds to invoke the callback.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel nfc: ncito a version that resolves this vulnerability.Patch 4527025d440ce8 - Compensating control
Ensure close path serialization by flushing nd av rx workqueue after releasing req_lock: call flush_workqueue(ndev->rx_wq) after mutex_unlock(&ndev->req_lock) to prevent concurrent nci_close_device() and nci_rx_work calling nci_data_exchange_complete().
Event History
Frequently Asked Questions
When can the refcount underflow occur?
It requires nci_close_device() and nci_rx_work to call nci_data_exchange_complete() concurrently. Both paths can observe the callback pointer as non-NULL and invoke rawsock_data_exchange_complete() even though only one sock_hold() was taken.
What is the resulting failure mode?
The second sock_put() can underflow the socket reference count and free a socket that is still in use.
What change resolves the race?
The fix replaces the unconditional clear_bit(NCI_DATA_EXCHANGE) with test_and_clear_bit(). This ensures only the first completion path invokes the callback.