# CVE-2021-47106: netfilter: nf\_tables: fix use-after-free in nft\_set\_catchall\_destroy()

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.22% (percentile 7, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-03-04T18:15:20.190Z
- **Modified:** 2026-08-05T08:46:01.395Z

## Who should check

- Anyone running Linux \>= aaa31047a6d25da0fa101da1ed544e1247949b40, \< 9d558e5f0d6fdd0a568f73dceb0b40c4f5012e5a; \>= aaa31047a6d25da0fa101da1ed544e1247949b40, \< 0f7d9b31ce7abdbb29bf018131ac920c9f698518
- Anyone running Linux 5.13

## Description

In the Linux kernel, the following vulnerability has been resolved:

netfilter: nf\_tables: fix use-after-free in nft\_set\_catchall\_destroy()

We need to use list\_for\_each\_entry\_safe() iterator
because we can not access @catchall after kfree\_rcu() call.

syzbot reported:

BUG: KASAN: use-after-free in nft\_set\_catchall\_destroy net/netfilter/nf\_tables\_api.c:4486 \[inline\]
BUG: KASAN: use-after-free in nft\_set\_destroy net/netfilter/nf\_tables\_api.c:4504 \[inline\]
BUG: KASAN: use-after-free in nft\_set\_destroy+0x3fd/0x4f0 net/netfilter/nf\_tables\_api.c:4493
Read of size 8 at addr ffff8880716e5b80 by task syz-executor.3/8871

CPU: 1 PID: 8871 Comm: syz-executor.3 Not tainted 5.16.0-rc5-syzkaller \#0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 \<TASK\>
 \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
 dump\_stack\_lvl+0xcd/0x134 lib/dump\_stack.c:106
 print\_address\_description.constprop.0.cold+0x8d/0x2ed mm/kasan/report.c:247
 \_\_kasan\_report mm/kasan/report.c:433 \[inline\]
 kasan\_report.cold+0x83/0xdf mm/kasan/report.c:450
 nft\_set\_catchall\_destroy net/netfilter/nf\_tables\_api.c:4486 \[inline\]
 nft\_set\_destroy net/netfilter/nf\_tables\_api.c:4504 \[inline\]
 nft\_set\_destroy+0x3fd/0x4f0 net/netfilter/nf\_tables\_api.c:4493
 \_\_nft\_release\_table+0x79f/0xcd0 net/netfilter/nf\_tables\_api.c:9626
 nft\_rcv\_nl\_event+0x4f8/0x670 net/netfilter/nf\_tables\_api.c:9688
 notifier\_call\_chain+0xb5/0x200 kernel/notifier.c:83
 blocking\_notifier\_call\_chain kernel/notifier.c:318 \[inline\]
 blocking\_notifier\_call\_chain+0x67/0x90 kernel/notifier.c:306
 netlink\_release+0xcb6/0x1dd0 net/netlink/af\_netlink.c:788
 \_\_sock\_release+0xcd/0x280 net/socket.c:649
 sock\_close+0x18/0x20 net/socket.c:1314
 \_\_fput+0x286/0x9f0 fs/file\_table.c:280
 task\_work\_run+0xdd/0x1a0 kernel/task\_work.c:164
 tracehook\_notify\_resume include/linux/tracehook.h:189 \[inline\]
 exit\_to\_user\_mode\_loop kernel/entry/common.c:175 \[inline\]
 exit\_to\_user\_mode\_prepare+0x27e/0x290 kernel/entry/common.c:207
 \_\_syscall\_exit\_to\_user\_mode\_work kernel/entry/common.c:289 \[inline\]
 syscall\_exit\_to\_user\_mode+0x19/0x60 kernel/entry/common.c:300
 do\_syscall\_64+0x42/0xb0 arch/x86/entry/common.c:86
 entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae
RIP: 0033:0x7f75fbf28adb
Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 \<48\> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44
RSP: 002b:00007ffd8da7ec10 EFLAGS: 00000293 ORIG\_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00007f75fbf28adb
RDX: 00007f75fc08e828 RSI: ffffffffffffffff RDI: 0000000000000003
RBP: 00007f75fc08a960 R08: 0000000000000000 R09: 00007f75fc08e830
R10: 00007ffd8da7ed10 R11: 0000000000000293 R12: 00000000002067c3
R13: 00007ffd8da7ed10 R14: 00007f75fc088f60 R15: 0000000000000032
 \</TASK\>

Allocated by task 8886:
 kasan\_save\_stack+0x1e/0x50 mm/kasan/common.c:38
 kasan\_set\_track mm/kasan/common.c:46 \[inline\]
 set\_alloc\_info mm/kasan/common.c:434 \[inline\]
 \_\_\_\_kasan\_kmalloc mm/kasan/common.c:513 \[inline\]
 \_\_\_\_kasan\_kmalloc mm/kasan/common.c:472 \[inline\]
 \_\_kasan\_kmalloc+0xa6/0xd0 mm/kasan/common.c:522
 kasan\_kmalloc include/linux/kasan.h:269 \[inline\]
 kmem\_cache\_alloc\_trace+0x1ea/0x4a0 mm/slab.c:3575
 kmalloc include/linux/slab.h:590 \[inline\]
 nft\_setelem\_catchall\_insert net/netfilter/nf\_tables\_api.c:5544 \[inline\]
 nft\_setelem\_insert net/netfilter/nf\_tables\_api.c:5562 \[inline\]
 nft\_add\_set\_elem+0x232e/0x2f40 net/netfilter/nf\_tables\_api.c:5936
 nf\_tables\_newsetelem+0x6ff/0xbb0 net/netfilter/nf\_tables\_api.c:6032
 nfnetlink\_rcv\_batch+0x1710/0x25f0 net/netfilter/nfnetlink.c:513
 nfnetlink\_rcv\_skb\_batch net/netfilter/nfnetlink.c:634 \[inline\]
 nfnetlink\_rcv+0x3af/0x420 net/netfilter/nfnetlink.c:652
 netlink\_unicast\_kernel net/netlink/af\_netlink.c:1319 \[inline\]
 netlink\_unicast+0x533/0x7d0 net/netlink/af\_netlink.c:1345
 netlink\_sendmsg+0x904/0xdf0 net/netlink/af\_netlink.c:1921
 sock\_sendmsg\_nosec net/
---truncated---

## Affected and fixed versions

- Linux: \>= aaa31047a6d25da0fa101da1ed544e1247949b40, \< 9d558e5f0d6fdd0a568f73dceb0b40c4f5012e5a; \>= aaa31047a6d25da0fa101da1ed544e1247949b40, \< 0f7d9b31ce7abdbb29bf018131ac920c9f698518 (cvelist)
- Linux: 5.13 (cvelist)

## Mitigation

- Upgrade Linux to 0f7d9b31ce7abdbb29bf018131ac920c9f698518 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47106.md
Affected: Linux >= aaa31047a6d25da0fa101da1ed544e1247949b40, < 9d558e5f0d6fdd0a568f73dceb0b40c4f5012e5a; >= aaa31047a6d25da0fa101da1ed544e1247949b40, < 0f7d9b31ce7abdbb29bf018131ac920c9f698518; Linux 5.13
Fixed in: Linux 9d558e5f0d6fdd0a568f73dceb0b40c4f5012e5a, Linux 0f7d9b31ce7abdbb29bf018131ac920c9f698518

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-47106 being exploited?

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= aaa31047a6d25da0fa101da1ed544e1247949b40, \< 9d558e5f0d6fdd0a568f73dceb0b40c4f5012e5a; \>= aaa31047a6d25da0fa101da1ed544e1247949b40, \< 0f7d9b31ce7abdbb29bf018131ac920c9f698518; Linux 5.13.

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

Yes. Fixed in Linux 9d558e5f0d6fdd0a568f73dceb0b40c4f5012e5a, Linux 0f7d9b31ce7abdbb29bf018131ac920c9f698518. Upgrade Linux to 0f7d9b31ce7abdbb29bf018131ac920c9f698518 or later.

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

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/9d558e5f0d6fdd0a568f73dceb0b40c4f5012e5a>
- patch: <https://git.kernel.org/stable/c/0f7d9b31ce7abdbb29bf018131ac920c9f698518>

## 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-47106>

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