# CVE-2026-74342: kernfs: link kn to its parent before the LSM init hook

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.20% (percentile 5, 2026-11-26)
- **Published:** 2026-08-15T05:58:31.924Z
- **Modified:** 2026-08-17T06:19:28.763Z

## Who should check

- Anyone running Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 319b82e8b46edaf557436ad858e734e583f78ec9; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 6cccc49b027c7551ffc1d2532f2ef1922661f3da; \< 7.1.5
- Anyone running Linux all versions

## Description

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

kernfs: link kn to its parent before the LSM init hook

After commit 12e9e3cd03b5 ("simpe\_xattr: use per-sb cache"),
kernfs\_xattr\_set() and kernfs\_xattr\_get() compute the cache via
kernfs\_root(kn) before any other check.  kernfs\_root(kn) walks
kn-\>\_\_parent first and falls back to kn-\>dir.root, both of which are
NULL on a freshly kmem\_cache\_zalloc()'d kn. kn-\>\_\_parent was being set
in kernfs\_new\_node() after \_\_kernfs\_new\_node() returned, and kn-\>dir.root
is set even later by kernfs\_create\_dir\_ns() / kernfs\_create\_empty\_dir().

The LSM kernfs\_init\_security hook is invoked from inside
\_\_kernfs\_new\_node(), before either field has been initialized.
selinux\_kernfs\_init\_security() ends with kernfs\_xattr\_set(kn,
XATTR\_NAME\_SELINUX, ...).  kernfs\_root(kn) then returns NULL, and
&((struct kernfs\_root \*)NULL)-\>xa\_cache evaluates to
offsetof(struct kernfs\_root, xa\_cache) which faults:

  BUG: kernel NULL pointer dereference, address: 00000000000000e0
  RIP: 0010:simple\_xattr\_set+0x27/0x8b0
  Call Trace:
   kernfs\_xattr\_set+0x63/0xb0
   selinux\_kernfs\_init\_security+0x13b/0x270
   security\_kernfs\_init\_security+0x36/0xc0
   \_\_kernfs\_new\_node+0x182/0x290
   kernfs\_new\_node+0x80/0xc0
   kernfs\_create\_dir\_ns+0x2b/0xa0
   cgroup\_create+0x116/0x380
   cgroup\_mkdir+0x7c/0x1a0

Reproduces deterministically at PID 1 (systemd) on an SELinux-enabled
distro. The first cgroup mkdir under /sys/fs/cgroup with a labelled
parent panics the kernel.

The LSM hook's contract is that the kn\_dir argument is the parent of
the new kn, so kn-\>\_\_parent should already point at kn\_dir when the
hook runs.  Move kernfs\_get(parent) and rcu\_assign\_pointer of
kn-\>\_\_parent from kernfs\_new\_node() into \_\_kernfs\_new\_node() right
before the security hook, and unwind the parent reference on the
err\_out4 path.  kernfs\_root(kn) then takes its parent branch during
the hook and returns parent-\>dir.root, which is the correct root.

This also closes the same-shape latent bug in kernfs\_xattr\_get() (which
today is hidden only by kernfs\_iattrs\_noalloc() returning NULL on a
fresh kn).

## Affected and fixed versions

- Linux: \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 319b82e8b46edaf557436ad858e734e583f78ec9; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 6cccc49b027c7551ffc1d2532f2ef1922661f3da; \< 7.1.5 (cvelist)
- Linux: all versions (cvelist)

## Mitigation

- Upgrade Linux to 7.1.5 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-74342.md
Affected: Linux >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 319b82e8b46edaf557436ad858e734e583f78ec9; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 6cccc49b027c7551ffc1d2532f2ef1922661f3da; < 7.1.5; Linux all versions
Fixed in: Linux 319b82e8b46edaf557436ad858e734e583f78ec9, Linux 6cccc49b027c7551ffc1d2532f2ef1922661f3da, Linux 7.1.5

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-2026-74342 being exploited?

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

### How serious is CVE-2026-74342?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-74342?

Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 319b82e8b46edaf557436ad858e734e583f78ec9; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 6cccc49b027c7551ffc1d2532f2ef1922661f3da; \< 7.1.5; Linux all versions.

### Is there a fix for CVE-2026-74342?

Yes. Fixed in Linux 319b82e8b46edaf557436ad858e734e583f78ec9, Linux 6cccc49b027c7551ffc1d2532f2ef1922661f3da, Linux 7.1.5. Upgrade Linux to 7.1.5 or later.

### How do I check if I'm affected by CVE-2026-74342?

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

- other: <https://git.kernel.org/stable/c/319b82e8b46edaf557436ad858e734e583f78ec9>
- other: <https://git.kernel.org/stable/c/6cccc49b027c7551ffc1d2532f2ef1922661f3da>

## 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-2026-74342>

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