netfilter: nfnetlink_queue: make hash table per queue
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
≥ 6.18.14 · < 6.18.24≥ 6.19.4 · < 6.19.14| No fix yet |
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nfnetlink_queue: make hash table per queue
Sharing a global hash table among all queues is tempting, but it can cause crash:
BUG: KASAN: slab-use-after-free in nfqnl_recv_verdict+0x11ac/0x15e0 [nfnetlink_queue] [..] nfqnl_recv_verdict+0x11ac/0x15e0 [nfnetlink_queue] nfnetlink_rcv_msg+0x46a/0x930 kmem_cache_alloc_node_noprof+0x11e/0x450
struct nf_queue_entry is freed via kfree, but parallel cpu can still encounter such an nf_queue_entry when walking the list.
Alternative fix is to free the nf_queue_entry via kfree_rcu() instead, but as we have to alloc/free for each skb this will cause more mem pressure.
From the CVE record · Linux
A shared hash table in Linux kernel netfilter nfnetlink_queue can cause a use-after-free when one CPU frees a queue entry while another walks the list. This can crash the kernel. The input does not specify whether exploitation requires network access, authentication, or user interaction.
Engineers running Linux kernels with netfilter nfnetlink_queue should check their versions; affected versions are not specified.