In the Linux kernel, the following vulnerability has been resolved: 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.
https://git.kernel.org/stable/c/fb2770d886057cd962bec407fd0c89d4bf7b2099
https://git.kernel.org/stable/c/ef38f9f49f33b16f1e5c3d024c5ce08d76e2b5b4
https://git.kernel.org/stable/c/e71b7f7760d9d612d4a65c0080c219f20433f645
https://git.kernel.org/stable/c/c711be46cea5ff8cb405497b794b43afe0736a1c
https://git.kernel.org/stable/c/9836164821a46af07428bb2a5e14137bf0c7bd6e
https://git.kernel.org/stable/c/5eb6c498ba97c65056966759aaab9e16e6fb88f1
https://git.kernel.org/stable/c/3a2494170b4f21e4e76ded3ec6fdd961720c9c15
https://git.kernel.org/stable/c/121ffd619f0fc9b6b381d1cc10debd30b7554cdf