diff options
| author | Florian Westphal <fw@strlen.de> | 2026-09-29 15:09:39 +0200 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2026-10-18 02:34:49 +0200 |
| commit | 9836164821a46af07428bb2a5e14137bf0c7bd6e (patch) | |
| tree | 2ec07d353773c317420c854a7bf3b37bed9f467a /include/linux/debugobjects.h | |
| parent | 853d419bfb342318a38915087726a5ac3b992d4c (diff) | |
netfilter: conntrack: fix unlikely UaF in gc worker
When early-drop scan is enabled, gc_worker() reads tmp->ct_net, resolves
cnet with nf_ct_pernet(), and reads cnet->count with RCU read lock held but
before acquiring a reference to tmp.
Its unlikely but possible that the worker gets preempted before reading
cnet->count while nf_conntrack_cleanup_net_list manages to unlink all
conntracks and returns in the mean time.
This allows for the pernet memory to get free'd.
On resume, use after free would occur when the worker reads cnet->count.
This can be solved either via another synchronize_rcu() in
nf_conntrack_cleanup_net_list or via cheaper flush_work(). If work
wasn't running no race can happen as next call cannot observe
already-unlinked conntrack objects.
This is an LLM finding with no reproducer, but it appears to be correct.
Fixes: c6dd940b1f74 ("netfilter: allow early drop of assured conntracks")
Reported-by: Vega <vega@nebusec.ai>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
