netfilter: conntrack: serialize hash resizes and cleanups
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 |
|
|
5.10.715.14.105.15In the Linux kernel, the following vulnerability has been resolved:
netfilter: conntrack: serialize hash resizes and cleanups
Syzbot was able to trigger the following warning [1]
No repro found by syzbot yet but I was able to trigger similar issue by having 2 scripts running in parallel, changing conntrack hash sizes, and:
for j in `seq 1 1000` ; do unshare -n /bin/true >/dev/null ; done
It would take more than 5 minutes for net_namespace structures to be cleaned up.
This is because nf_ct_iterate_cleanup() has to restart everytime a resize happened.
By adding a mutex, we can serialize hash resizes and cleanups and also make get_next_corpse() faster by skipping over empty buckets.
From the CVE record · Linux
Linux kernel netfilter conntrack cleanup can repeatedly restart when conntrack hash sizes change concurrently. Local activity that changes hash sizes while network namespaces are created and dismantled can delay namespace cleanup for more than five minutes. The input does not specify authentication requirements or user interaction.
Engineers running Linux kernels with netfilter conntrack should check their deployments; affected versions are not specified.