Vulnerability · Linux kernel (nilfs2 filesystem driver, fs/nilfs2/dir.c) · updated

CVE-2026-138871: Linux kernel nilfs2 readdir bug can leak kernel memory

A bug in the Linux kernel's nilfs2 filesystem driver (CVE-2026-138871) lets a process reading a directory on a nilfs2 filesystem get back up to 255 bytes of unrelated kernel memory at a time. Fixed kernels are out, and if none of your hosts use nilfs2 your real-world risk is low.

FixReleased
ExploitationNone reported
Public exploit codeNot public
CISA KEVNot listed
Severity9.1 (CVSS 3.1, CNA)

Quick answers

What is CVE-2026-138871?

CVE-2026-138871 (CVE-2026-138871) is a vulnerability in Linux kernel (nilfs2 filesystem driver, fs/nilfs2/dir.c). A bug in the Linux kernel's nilfs2 filesystem driver (CVE-2026-138871) lets a process reading a directory on a nilfs2 filesystem get back up to 255 bytes of unrelated kernel memory at a time. Fixed kernels are out, and if none of your hosts use nilfs2 your real-world risk is low.

Am I affected by CVE-2026-138871?

CVE-2026-138871 affects upstream Linux kernels from 2.6.30 up to, but not including, 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63 and 7.3.4, depending on the branch. It only matters in practice on hosts where a nilfs2 filesystem is mounted or where someone can get a crafted nilfs2 image mounted. Distribution kernels use their own version numbers, so check your vendor's advisory for the fixed package.

Which versions fix CVE-2026-138871?

5.10 and older (from 2.6.30): 5.10.275; 5.11 to 5.15: 5.15.226; 5.16 to 6.1: 6.1.193; 6.2 to 6.6: 6.6.163; 6.7 to 6.12: 6.12.117; 6.13 to 6.18: 6.18.63; 6.19 to 7.3: 7.3.4

Is CVE-2026-138871 being exploited?

No exploitation in the wild has been reported; it is not in the CISA KEV catalog.

Is there a workaround for CVE-2026-138871?

The fix for CVE-2026-138871 is to run a Linux kernel that includes the nilfs2 readdir patch. That means upstream stable 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63 or 7.3.4 or later, or a distribution kernel that backports upstream commit de7f49c12566. The host must boot into the new kernel before the fix is active. The Linux kernel developers have not published an official workaround for CVE-2026-138871. The vulnerable code in nilfs_readdir() only runs when a directory on a mounted nilfs2 filesystem is read, so hosts with no nilfs2 mounts do not reach it. As our own hardening suggestion, not part of the advisory, hosts that never use nilfs2 can block the nilfs2 module from loading. This does not help where nilfs2 is built in (CONFIG_NILFS2_FS=y), and it does not unload a module that is already loaded. Until you patch, do not mount nilfs2 images from untrusted sources. The commit notes that crafted or corrupted images widen the problem. Also review who can mount filesystems on shared hosts, including desktop auto-mount services.

What this means for your business

Memory disclosure: a process can receive kernel memory it should never see. That memory could hold data from other processes or the kernel itself.

The CNA rates it 9.1 (CVSS 3.1, AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H). The kernel commit describes the trigger differently: a userspace process calling llseek on a nilfs2 directory, which implies local access to a host with nilfs2 mounted.

Only hosts that mount a nilfs2 filesystem, or that can be made to mount a crafted nilfs2 image, run the vulnerable code.

No known exploitation, no public proof of concept and no CISA KEV listing as of 2026-12-01.

Is this about you? CVE-2026-138871 affects upstream Linux kernels from 2.6.30 up to, but not including, 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63 and 7.3.4, depending on the branch. It only matters in practice on hosts where a nilfs2 filesystem is mounted or where someone can get a crafted nilfs2 image mounted. Distribution kernels use their own version numbers, so check your vendor's advisory for the fixed package.

Ask your team or provider:

How fast: No known exploitation as of 2026-12-01. If any host mounts nilfs2 and also runs untrusted code or mounts untrusted images, patch within 7 days. Otherwise, include the fixed kernel in your next regular patch cycle.

Not sure if you are exposed?

We check your servers and containers with read-only access, tell you what is exposed, and patch it in a window you approve.

For engineers

LineAffectedFixed in
5.10 and older (from 2.6.30)2.6.30 to 5.10.2745.10.275
5.11 to 5.155.11.0 to 5.15.2255.15.226
5.16 to 6.15.16.0 to 6.1.1926.1.193
6.2 to 6.66.2.0 to 6.6.1626.6.163
6.7 to 6.126.7.0 to 6.12.1166.12.117
6.13 to 6.186.13.0 to 6.18.626.18.63
6.19 to 7.36.19.0 to 7.3.37.3.4

Ranges come from the OSV record. The bug was introduced by commit 2ba466d74ed7 ("nilfs2: directory entry operations"). Branches older than 5.10 (for example 5.4 or 4.19) and in-between lines such as 6.7 to 6.11 have no fix listed of their own; the listed path is the next fixed release shown. The upstream fix is commit de7f49c12566cc5c7437a2f26c6c754b9d4d5648; the bundle does not say which mainline release first includes it. Distribution kernels (Ubuntu, RHEL, Azure Linux and others) backport fixes under their own version numbers, and the bundle has no distro advisories, so check your vendor.

When it can be exploited

Check if you are affected

uname -r
grep -w nilfs2 /proc/filesystems
lsmod | grep -w nilfs2
findmnt -t nilfs2
grep CONFIG_NILFS2_FS /boot/config-$(uname -r)
losetup -l
kubectl get nodes -o wide

All commands are read-only. uname -r gives the running kernel; compare upstream versions against the table, and for distro kernels compare against your vendor's advisory. If findmnt -t nilfs2 prints nothing, no nilfs2 filesystem is mounted right now and the vulnerable path is not in use. grep -w nilfs2 /proc/filesystems and lsmod show whether nilfs2 support is loaded. CONFIG_NILFS2_FS=m means a loadable module, =y means built in, and no line means not built. losetup -l lists loop-mounted image files worth a second look. For AKS, kubectl get nodes -o wide shows each node's KERNEL-VERSION column.

If you can't upgrade today

The fix for CVE-2026-138871 is to run a Linux kernel that includes the nilfs2 readdir patch. That means upstream stable 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63 or 7.3.4 or later, or a distribution kernel that backports upstream commit de7f49c12566. The host must boot into the new kernel before the fix is active. The Linux kernel developers have not published an official workaround for CVE-2026-138871. The vulnerable code in nilfs_readdir() only runs when a directory on a mounted nilfs2 filesystem is read, so hosts with no nilfs2 mounts do not reach it. As our own hardening suggestion, not part of the advisory, hosts that never use nilfs2 can block the nilfs2 module from loading. This does not help where nilfs2 is built in (CONFIG_NILFS2_FS=y), and it does not unload a module that is already loaded. Until you patch, do not mount nilfs2 images from untrusted sources. The commit notes that crafted or corrupted images widen the problem. Also review who can mount filesystems on shared hosts, including desktop auto-mount services.

# /etc/modprobe.d/disable-nilfs2.conf
# SoftImply hardening suggestion, not from the kernel advisory.
# Only use on hosts where `findmnt -t nilfs2` shows no mounts.
install nilfs2 /bin/false

Signs you were already hit

According to the commit, this is a read-only memory disclosure, and the bundle describes no indicators of compromise. A leak like this is unlikely to leave a clear log trail. Look for nilfs2 mounts or loop-mounted images you did not expect (findmnt -t nilfs2, losetup -l). Search kernel logs for nilfs2 activity (journalctl -k | grep -i nilfs2), and check who has mount rights on shared hosts. If you find an unexpected nilfs2 mount on a host running untrusted code, treat secrets handled on that host as possibly exposed, and rotate them after patching.

Prompt for your coding agent

Paste this into Claude Code, Codex or Cursor, opened in the repository that holds your server and deployment configuration. It only reads and proposes changes; review the diff before you apply it.

You are helping assess exposure to CVE-2026-138871, a Linux kernel bug in the nilfs2 filesystem driver (nilfs_readdir in fs/nilfs2/dir.c) that can return unrelated kernel memory to userspace. Upstream fixed versions are 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63 and 7.3.4 (upstream commit de7f49c12566cc5c7437a2f26c6c754b9d4d5648). Investigate this repository only; do not apply changes, deploy, reboot, restart or run anything against live systems. Tasks: 1) Find every place that pins or selects a Linux kernel or OS image: Terraform/Bicep/ARM VM and VMSS image references, AKS node pool OS SKU and node image versions, Packer templates, cloud-init, Ansible roles, Dockerfiles for VM or CI images, and kernel package pins. 2) Search for any use of nilfs2: mount units, fstab entries, mkfs.nilfs2, nilfs-utils packages, modprobe configs and image-mounting scripts. 3) Report a table of each location, the kernel or image version it implies, whether that is in an affected range (note that distro kernels need the vendor advisory, so mark those as needs vendor check), and whether nilfs2 is used. 4) Propose, as a diff for human review only, changes that move image or kernel pins to versions containing the fix. Where nilfs2 is clearly unused, optionally add a modprobe.d file containing 'install nilfs2 /bin/false' and label it as optional hardening. Do not guess fixed distro package versions; leave a TODO where a vendor version is needed. Stop after presenting the findings and the proposed diff.

Timeline

  1. Fix authored by Jake Labelle (author date on stable commit 7bcffd24502d).

  2. First stable backport committed (7bcffd24502d).

  3. More stable backports committed (69cf95f47a68, 07f671d13067, a48632160cdb).

  4. CVE-2026-138871 published, CVSS 9.1 from the CNA.

  5. CVE record updated. No KEV listing, EPSS score or public proof of concept in our data.

Sources

Checked 1 Dec 2026. We update this page when the vendor, CISA or the distributions change the picture.