# CVE-2021-47408: netfilter: conntrack: serialize hash resizes and cleanups

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **Published:** 2024-05-21T15:04:00.651Z
- **Modified:** 2026-06-17T04:17:24.303Z

## Who should check

- Anyone running Linux \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< e2d192301a0df8160d1555b66ae8611e8050e424; \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< 7ea6f5848281182ce0cff6cafdcf3fbdeb8ca7e1; \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< e9edc188fc76499b0b9bd60364084037f6d03773
- Anyone running Linux 4.13

## Description

In 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.

Even without resizes in the picture, this patch considerably
speeds up network namespace dismantles.

\[1\]
INFO: task syz-executor.0:8312 can't die for more than 144 seconds.
task:syz-executor.0  state:R  running task     stack:25672 pid: 8312 ppid:  6573 flags:0x00004006
Call Trace:
 context\_switch kernel/sched/core.c:4955 \[inline\]
 \_\_schedule+0x940/0x26f0 kernel/sched/core.c:6236
 preempt\_schedule\_common+0x45/0xc0 kernel/sched/core.c:6408
 preempt\_schedule\_thunk+0x16/0x18 arch/x86/entry/thunk\_64.S:35
 \_\_local\_bh\_enable\_ip+0x109/0x120 kernel/softirq.c:390
 local\_bh\_enable include/linux/bottom\_half.h:32 \[inline\]
 get\_next\_corpse net/netfilter/nf\_conntrack\_core.c:2252 \[inline\]
 nf\_ct\_iterate\_cleanup+0x15a/0x450 net/netfilter/nf\_conntrack\_core.c:2275
 nf\_conntrack\_cleanup\_net\_list+0x14c/0x4f0 net/netfilter/nf\_conntrack\_core.c:2469
 ops\_exit\_list+0x10d/0x160 net/core/net\_namespace.c:171
 setup\_net+0x639/0xa30 net/core/net\_namespace.c:349
 copy\_net\_ns+0x319/0x760 net/core/net\_namespace.c:470
 create\_new\_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
 unshare\_nsproxy\_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226
 ksys\_unshare+0x445/0x920 kernel/fork.c:3128
 \_\_do\_sys\_unshare kernel/fork.c:3202 \[inline\]
 \_\_se\_sys\_unshare kernel/fork.c:3200 \[inline\]
 \_\_x64\_sys\_unshare+0x2d/0x40 kernel/fork.c:3200
 do\_syscall\_x64 arch/x86/entry/common.c:50 \[inline\]
 do\_syscall\_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae
RIP: 0033:0x7f63da68e739
RSP: 002b:00007f63d7c05188 EFLAGS: 00000246 ORIG\_RAX: 0000000000000110
RAX: ffffffffffffffda RBX: 00007f63da792f80 RCX: 00007f63da68e739
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000
RBP: 00007f63da6e8cc4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f63da792f80
R13: 00007fff50b75d3f R14: 00007f63d7c05300 R15: 0000000000022000

Showing all locks held in the system:
1 lock held by khungtaskd/27:
 \#0: ffffffff8b980020 (rcu\_read\_lock){....}-{1:2}, at: debug\_show\_all\_locks+0x53/0x260 kernel/locking/lockdep.c:6446
2 locks held by kworker/u4:2/153:
 \#0: ffff888010c69138 ((wq\_completion)events\_unbound){+.+.}-{0:0}, at: arch\_atomic64\_set arch/x86/include/asm/atomic64\_64.h:34 \[inline\]
 \#0: ffff888010c69138 ((wq\_completion)events\_unbound){+.+.}-{0:0}, at: arch\_atomic\_long\_set include/linux/atomic/atomic-long.h:41 \[inline\]
 \#0: ffff888010c69138 ((wq\_completion)events\_unbound){+.+.}-{0:0}, at: atomic\_long\_set include/linux/atomic/atomic-instrumented.h:1198 \[inline\]
 \#0: ffff888010c69138 ((wq\_completion)events\_unbound){+.+.}-{0:0}, at: set\_work\_data kernel/workqueue.c:634 \[inline\]
 \#0: ffff888010c69138 ((wq\_completion)events\_unbound){+.+.}-{0:0}, at: set\_work\_pool\_and\_clear\_pending kernel/workqueue.c:661 \[inline\]
 \#0: ffff888010c69138 ((wq\_completion)events\_unbound){+.+.}-{0:0}, at: process\_one\_work+0x896/0x1690 kernel/workqueue.c:2268
 \#1: ffffc9000140fdb0 ((kfence\_timer).work){+.+.}-{0:0}, at: process\_one\_work+0x8ca/0x1690 kernel/workqueue.c:2272
1 lock held by systemd-udevd/2970:
1 lock held by in:imklog/6258:
 \#0: ffff88807f970ff0 (&f-\>f\_pos\_lock){+.+.}-{3:3}, at: \_\_fdget\_pos+0xe9/0x100 fs/file.c:990
3 locks held by kworker/1:6/8158:
1 lock held by syz-executor.0/8312:
2 locks held by kworker/u4:13/9320:
1 lock held by
---truncated---

## Affected and fixed versions

- Linux: \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< e2d192301a0df8160d1555b66ae8611e8050e424; \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< 7ea6f5848281182ce0cff6cafdcf3fbdeb8ca7e1; \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< e9edc188fc76499b0b9bd60364084037f6d03773 (cvelist)
- Linux: 4.13 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47408. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47408.md
Affected: Linux >= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, < e2d192301a0df8160d1555b66ae8611e8050e424; >= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, < 7ea6f5848281182ce0cff6cafdcf3fbdeb8ca7e1; >= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, < e9edc188fc76499b0b9bd60364084037f6d03773; Linux 4.13
Fixed in: Linux 7ea6f5848281182ce0cff6cafdcf3fbdeb8ca7e1

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47408 being exploited?

There is no confirmed exploitation: CVE-2021-47408 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47408?

Medium: CVSS 4.7 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2021-47408?

Linux \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< e2d192301a0df8160d1555b66ae8611e8050e424; \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< 7ea6f5848281182ce0cff6cafdcf3fbdeb8ca7e1; \>= 0d02d5646eb84403766a11a1d3b19e670a3d45d5, \< e9edc188fc76499b0b9bd60364084037f6d03773; Linux 4.13.

### Is there a fix for CVE-2021-47408?

Yes. Fixed in Linux 7ea6f5848281182ce0cff6cafdcf3fbdeb8ca7e1. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2021-47408?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/e2d192301a0df8160d1555b66ae8611e8050e424>
- patch: <https://git.kernel.org/stable/c/7ea6f5848281182ce0cff6cafdcf3fbdeb8ca7e1>
- patch: <https://git.kernel.org/stable/c/e9edc188fc76499b0b9bd60364084037f6d03773>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47408>

HTML: <https://flawdb.com/CVE-2021-47408> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47408>
