# CVE-2022-50432: kernfs: fix use-after-free in \_\_kernfs\_remove

> 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.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-10-01T11:42:10.573Z
- **Modified:** 2026-10-15T22:17:30.407Z

## Who should check

- Anyone running Linux \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 4dfd6a477a1525773469feaf3c514b2c0fef76b5; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 02eb35131050735332658029082f61515b7dfe38; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 028cf780743eea79abffa7206b9dcfc080ad3546; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< c78b0dc6fb7fb389d674e491fd376388cdfb1d53; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 6f72a3977ba9d0e5491a5c01315204272e7f9c44; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 94d2643df1e70a4c310ebb5e2c493eec33df1a06; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< af1b57cc39beca203559576b3046094fc9e5eb32; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 4abc99652812a2ddf932f137515d5c5a04723538
- Anyone running Linux 3.14

## Description

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

kernfs: fix use-after-free in \_\_kernfs\_remove

Syzkaller managed to trigger concurrent calls to
kernfs\_remove\_by\_name\_ns() for the same file resulting in
a KASAN detected use-after-free. The race occurs when the root
node is freed during kernfs\_drain().

To prevent this acquire an additional reference for the root
of the tree that is removed before calling \_\_kernfs\_remove().

Found by syzkaller with the following reproducer (slab\_nomerge is
required):

syz\_mount\_image$ext4(0x0, &(0x7f0000000100)='./file0\\x00', 0x100000, 0x0, 0x0, 0x0, 0x0)
r0 = openat(0xffffffffffffff9c, &(0x7f0000000080)='/proc/self/exe\\x00', 0x0, 0x0)
close(r0)
pipe2(&(0x7f0000000140)={0xffffffffffffffff, \<r1=\>0xffffffffffffffff}, 0x800)
mount$9p\_fd(0x0, &(0x7f0000000040)='./file0\\x00', &(0x7f00000000c0), 0x408, &(0x7f0000000280)={'trans=fd,', {'rfdno', 0x3d, r0}, 0x2c, {'wfdno', 0x3d, r1}, 0x2c, {\[{@cache\_loose}, {@mmap}, {@loose}, {@loose}, {@mmap}\], \[{@mask={'mask', 0x3d, '^MAY\_EXEC'}}, {@fsmagic={'fsmagic', 0x3d, 0x10001}}, {@dont\_hash}\]}})

Sample report:

==================================================================
BUG: KASAN: use-after-free in kernfs\_type include/linux/kernfs.h:335 \[inline\]
BUG: KASAN: use-after-free in kernfs\_leftmost\_descendant fs/kernfs/dir.c:1261 \[inline\]
BUG: KASAN: use-after-free in \_\_kernfs\_remove.part.0+0x843/0x960 fs/kernfs/dir.c:1369
Read of size 2 at addr ffff8880088807f0 by task syz-executor.2/857

CPU: 0 PID: 857 Comm: syz-executor.2 Not tainted 6.0.0-rc3-00363-g7726d4c3e60b \#5
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Call Trace:
 \<TASK\>
 \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
 dump\_stack\_lvl+0x6e/0x91 lib/dump\_stack.c:106
 print\_address\_description mm/kasan/report.c:317 \[inline\]
 print\_report.cold+0x5e/0x5e5 mm/kasan/report.c:433
 kasan\_report+0xa3/0x130 mm/kasan/report.c:495
 kernfs\_type include/linux/kernfs.h:335 \[inline\]
 kernfs\_leftmost\_descendant fs/kernfs/dir.c:1261 \[inline\]
 \_\_kernfs\_remove.part.0+0x843/0x960 fs/kernfs/dir.c:1369
 \_\_kernfs\_remove fs/kernfs/dir.c:1356 \[inline\]
 kernfs\_remove\_by\_name\_ns+0x108/0x190 fs/kernfs/dir.c:1589
 sysfs\_slab\_add+0x133/0x1e0 mm/slub.c:5943
 \_\_kmem\_cache\_create+0x3e0/0x550 mm/slub.c:4899
 create\_cache mm/slab\_common.c:229 \[inline\]
 kmem\_cache\_create\_usercopy+0x167/0x2a0 mm/slab\_common.c:335
 p9\_client\_create+0xd4d/0x1190 net/9p/client.c:993
 v9fs\_session\_init+0x1e6/0x13c0 fs/9p/v9fs.c:408
 v9fs\_mount+0xb9/0xbd0 fs/9p/vfs\_super.c:126
 legacy\_get\_tree+0xf1/0x200 fs/fs\_context.c:610
 vfs\_get\_tree+0x85/0x2e0 fs/super.c:1530
 do\_new\_mount fs/namespace.c:3040 \[inline\]
 path\_mount+0x675/0x1d00 fs/namespace.c:3370
 do\_mount fs/namespace.c:3383 \[inline\]
 \_\_do\_sys\_mount fs/namespace.c:3591 \[inline\]
 \_\_se\_sys\_mount fs/namespace.c:3568 \[inline\]
 \_\_x64\_sys\_mount+0x282/0x300 fs/namespace.c:3568
 do\_syscall\_x64 arch/x86/entry/common.c:50 \[inline\]
 do\_syscall\_64+0x38/0x90 arch/x86/entry/common.c:80
 entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd
RIP: 0033:0x7f725f983aed
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 \<48\> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f725f0f7028 EFLAGS: 00000246 ORIG\_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f725faa3f80 RCX: 00007f725f983aed
RDX: 00000000200000c0 RSI: 0000000020000040 RDI: 0000000000000000
RBP: 00007f725f9f419c R08: 0000000020000280 R09: 0000000000000000
R10: 0000000000000408 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000006 R14: 00007f725faa3f80 R15: 00007f725f0d7000
 \</TASK\>

Allocated by task 855:
 kasan\_save\_stack+0x1e/0x40 mm/kasan/common.c:38
 kasan\_set\_track mm/kasan/common.c:45 \[inline\]
 set\_alloc\_info mm/kasan/common.c:437 \[inline\]
 \_\_kasan\_slab\_alloc+0x66/0x80 mm/kasan/common.c:470
 kasan\_slab\_alloc include/linux/kasan.h:224 \[inline\]
 slab\_post\_alloc\_hook mm/slab.h:7
---truncated---

## Affected and fixed versions

- Linux: \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 4dfd6a477a1525773469feaf3c514b2c0fef76b5; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 02eb35131050735332658029082f61515b7dfe38; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 028cf780743eea79abffa7206b9dcfc080ad3546; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< c78b0dc6fb7fb389d674e491fd376388cdfb1d53; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 6f72a3977ba9d0e5491a5c01315204272e7f9c44; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 94d2643df1e70a4c310ebb5e2c493eec33df1a06; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< af1b57cc39beca203559576b3046094fc9e5eb32; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 4abc99652812a2ddf932f137515d5c5a04723538 (cvelist)
- Linux: 3.14 (cvelist)

## Mitigation

- Upgrade Linux to 4abc99652812a2ddf932f137515d5c5a04723538 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-50432.md
Affected: Linux >= 45a140e587f3d32d8d424ed940dffb61e1739047, < 4dfd6a477a1525773469feaf3c514b2c0fef76b5; >= 45a140e587f3d32d8d424ed940dffb61e1739047, < 02eb35131050735332658029082f61515b7dfe38; >= 45a140e587f3d32d8d424ed940dffb61e1739047, < 028cf780743eea79abffa7206b9dcfc080ad3546; >= 45a140e587f3d32d8d424ed…
Fixed in: Linux 4dfd6a477a1525773469feaf3c514b2c0fef76b5, Linux 02eb35131050735332658029082f61515b7dfe38, Linux 028cf780743eea79abffa7206b9dcfc080ad3546, Linux 6f72a3977ba9d0e5491a5c01315204272e7f9c44, Linux 94d2643df1e70a4c310ebb5e2c493eec33df1a06, Linux 4abc99652812a2ddf932f137515d5c5a04723538

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-2022-50432 being exploited?

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

### How serious is CVE-2022-50432?

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

### Which versions are affected by CVE-2022-50432?

Linux \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 4dfd6a477a1525773469feaf3c514b2c0fef76b5; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 02eb35131050735332658029082f61515b7dfe38; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 028cf780743eea79abffa7206b9dcfc080ad3546; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< c78b0dc6fb7fb389d674e491fd376388cdfb1d53; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 6f72a3977ba9d0e5491a5c01315204272e7f9c44; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 94d2643df1e70a4c310ebb5e2c493eec33df1a06; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< af1b57cc39beca203559576b3046094fc9e5eb32; \>= 45a140e587f3d32d8d424ed940dffb61e1739047, \< 4abc99652812a2ddf932f137515d5c5a04723538; Linux 3.14.

### Is there a fix for CVE-2022-50432?

Yes. Fixed in Linux 4dfd6a477a1525773469feaf3c514b2c0fef76b5, Linux 02eb35131050735332658029082f61515b7dfe38, Linux 028cf780743eea79abffa7206b9dcfc080ad3546, Linux 6f72a3977ba9d0e5491a5c01315204272e7f9c44, Linux 94d2643df1e70a4c310ebb5e2c493eec33df1a06, Linux 4abc99652812a2ddf932f137515d5c5a04723538. Upgrade Linux to 4abc99652812a2ddf932f137515d5c5a04723538 or later.

### How do I check if I'm affected by CVE-2022-50432?

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/4dfd6a477a1525773469feaf3c514b2c0fef76b5>
- patch: <https://git.kernel.org/stable/c/02eb35131050735332658029082f61515b7dfe38>
- patch: <https://git.kernel.org/stable/c/028cf780743eea79abffa7206b9dcfc080ad3546>
- patch: <https://git.kernel.org/stable/c/c78b0dc6fb7fb389d674e491fd376388cdfb1d53>
- patch: <https://git.kernel.org/stable/c/6f72a3977ba9d0e5491a5c01315204272e7f9c44>
- patch: <https://git.kernel.org/stable/c/94d2643df1e70a4c310ebb5e2c493eec33df1a06>
- patch: <https://git.kernel.org/stable/c/af1b57cc39beca203559576b3046094fc9e5eb32>
- patch: <https://git.kernel.org/stable/c/4abc99652812a2ddf932f137515d5c5a04723538>

## 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-2022-50432>

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