CVE-2026-139185: net: atlantic: Unregister before clearing RXNFC rules
In the Linux kernel, the following vulnerability has been resolved:
net: atlantic: Unregister before clearing RXNFC rules
aqpciremove() clears the driver's RXNFC rule list before unregistering the netdevice. Until unregisternetdev() returns, ethtool operations can still call aqgetrxnfcrule(), aqgetrxnfcallrules(), aqaddrxnfcrule(), or aqdelrxnfcrule(). Those paths traverse the same unlocked hlist that aqclearrxnfcallrules() is mutating and freeing.
The race is reachable by issuing RXNFC ethtool commands concurrently with PCI device removal or driver unbind. A reader can dereference a node that has just been freed, and two writers can corrupt the list or free the same rule more than once, causing KASAN reports, list corruption, or a kernel panic.
Reverse the removal order: unregister the netdevice first, then clear the RXNFC rules. After unregisternetdev() returns, ethtool can no longer enter the driver, while the PCI device is still available for the rule-clearing routine to issue hardware commands.
Found during a static-analysis-assisted audit: candidate sites were surfaced by a Coccinelle rule, and the reader/writer paths were confirmed by LLM-assisted (GLM-5.3) code inspection. The issue was not observed at runtime; it is identified by code inspection only.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In aq_pci_remove(), unregister the netdevice before clearing the driver's RXNFC rule list.