nfp: hold IPsec RX state under the XArray lock
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfp: hold IPsec RX state under the XArray lock
nfp_net_ipsec_rx() drops the XArray lock before taking a reference to the xfrm_state it found. The delete path can erase the entry and drop the last state reference in that interval. RX can then try to increment a zero refcount after the state has been queued for destruction.
The driver queues firmware invalidation asynchronously; the delete path does not wait for the command to complete or drain pending RX processing.
The XFRM garbage collector waits for an RCU grace period before freeing the state. That delays reclamation but does not make acquiring a reference from zero valid.
Take the xfrm_state reference before releasing the XArray lock so xa_erase() cannot run between lookup and reference acquisition.
From the CVE record · Linux
The Linux kernel's nfp IPsec receive path can release the XArray lock before taking a reference to an xfrm_state. If that state is deleted between lookup and reference acquisition, RX can try to increment its refcount after it reaches zero. The input does not specify authentication requirements or user interaction.
Engineers running Linux kernels that use the nfp IPsec receive path should check their affected versions; none are specified in the input.