netfilter: flowtable: publish HW_DEAD after worker is done
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2c8897953f3b2ff5498f3f275708a742bfcdbc24 · < b0ef9450e93f2adeb77593db14c2ac7c6c8f5060| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
netfilter: flowtable: publish HW_DEAD after worker is done
flow_offload_work_del() sets NF_FLOW_HW_DEAD before the work handler clears NF_FLOW_HW_PENDING. Once a flow is both HW_DYING and HW_DEAD, a concurrent garbage collection pass can remove it and schedule it for RCU freeing.
The offload worker holds neither an RCU read lock nor a reference to the flow. If it is preempted after publishing HW_DEAD, the RCU callback can free the flow before the worker resumes and clears HW_PENDING, resulting in a use-after-free.
Move HW_DEAD publication to the common worker epilogue after the pending bit is cleared, making it the final flow access by destroy work. Order all preceding flow accesses before publishing the bit that allows garbage collection to free the object.
From the CVE record · Linux
The Linux kernel netfilter flowtable can free a flow while its offload worker still uses it, causing a use-after-free. This requires the worker to be preempted after marking the flow dead and a concurrent garbage collection pass to remove it. The input does not specify an attacker path, authentication requirement, or user interaction.
Anyone running the Linux kernel should check whether their version includes the netfilter flowtable fix; affected versions are not specified.