Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2026-138871

published critical CVSS 3.1 · 9.1

nilfs2: validate directory position after llseek in readdir

Published
30 Nov 2026, 13:25:46 UTC
Updated
01 Dec 2026, 05:40:24 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Linux — Linux2ba466d74ed74f073257f86e61519cb8f8f46184 to < bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5 · 2ba466d74ed74f073257f86e61519cb8f8f46184 to < 69cf95f47a68b6920c9192a5ea3fe8c1db0a1070 · 2ba466d74ed74f073257f86e61519cb8f8f46184 to < 07f671d13067e68dbc840e46027668293c1c3a80 · 2ba466d74ed74f073257f86e61519cb8f8f46184 to < a48632160cdb85adadb4b7c8429d90a9511e7e6b · 2ba466d74ed74f073257f86e61519cb8f8f46184 to < dc171da15e46871abac4c05b389730883c15f680 · 2ba466d74ed74f073257f86e61519cb8f8f46184 to < 7bcffd24502d637b348a2e460093a0cabad4554e · 2ba466d74ed74f073257f86e61519cb8f8f46184 to < fbcbb54a4898984192b16764943af1be262bdb4d · 2ba466d74ed74f073257f86e61519cb8f8f46184 to < de7f49c12566cc5c7437a2f26c6c754b9d4d5648 · Other versions: unaffected Affected Not stated Linux
Linux — Linux2.6.30 (affected) · 0 to < 2.6.30 (unaffected · semver) · 5.10.275 through 5.10.* (unaffected · semver) · 5.15.226 through 5.15.* (unaffected · semver) · 6.1.193 through 6.1.* (unaffected · semver) · 6.6.163 through 6.6.* (unaffected · semver) · 6.12.117 through 6.12.* (unaffected · semver) · 6.18.63 through 6.18.* (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected Version-specific Not stated Linux
Amazon Linux AL2 Release evaluation Pending Fix; Not Affected Not stated Amazon Linux assessment
Amazon Linux AL2023 Release evaluation Not Affected Not required Amazon Linux assessment

Description

In the Linux kernel, the following vulnerability has been resolved: nilfs2: validate directory position after llseek in readdir nilfs_readdir() uses ctx->pos, which userspace can set to an arbitrary value via llseek, as an offset into the directory folio and parses whatever bytes sit there as a directory entry. A position pointing into the middle of an entry -- or at unused bytes of a corrupted image that the page validator never inspected -- makes dir_emit() copy up to 255 (name_len) bytes from a bogus entry, possibly reading past the end of the folio and returning unrelated memory contents to userspace. Snap unaligned positions onto a valid entry boundary by walking the rec_len chain from the chunk start before parsing, as ext2 does in ext2_validate_entry(). [ryusuke: fixed offset wrap-around in nilfs_validate_entry() and conformed AI tag to guidelines]

en · Linux · cna

Vendor advisories explicitly linked to this CVE.

0

No linked advisories were found for this CVE.

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
3.1
Base score
9.1 / 10
Severity
critical
Provider
Linux · cna
Vector string
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Scenarios
en: AV:N - nilfs_readdir() parses at ctx->pos taken from f_pos. nfsd3_proc_readdir()/nfsd4_readdir() hand the client's READDIR cookie to nfsd_readdir(), which does vfs_llseek(SEEK_SET) via generic_file_llseek then iterate_dir(), so on an NFS-exported nilfs2 volume the wire cookie is the bad offset, CREATE filenames supply the fake entry bytes, and READDIR entry names carry the over-read back. Local lseek+getdents64 hits the same path. AC:L - The attacker produces the trigger state: the high bytes of every entry's 64-bit inode field and nilfs_make_empty()'s memset slack are zero, so a cookie there deterministically hits de->rec_len == 0. For the leak, it learns entry offsets from d_off/READDIR cookies and seeks into its own filename near the page end. No race, no heap or layout luck. PR:N - check_security_flavor() accepts RPC_AUTH_NULL/RPC_AUTH_UNIX on an export with no sec= option, and nfsd_readdir() only requires NFSD_MAY_READ, so an unauthenticated AUTH_SYS client can send the bad cookie; CREATE for the fake name only needs an asserted uid. Locally, any user who can open a directory on a mounted nilfs2 volume suffices. UI:N - No crafted image or mount is involved: the fake entry is built from the attacker's own legitimate filenames (or existing zero bytes) on an already-mounted, uncorrupted volume, and the attacker issues the seek/READDIR itself. S:U - The over-read past the directory folio and the nilfs_error() remount or panic stay within the host kernel's own authority; no VM, IOMMU or sandbox boundary is crossed. C:H - de may sit at PAGE_SIZE-16, so de->name begins 4 bytes before the folio end and dir_emit() copies an attacker-chosen name_len up to 255, about 251 bytes of the physically adjacent page, into getdents64 d_name or the NFS entry name (nfsd_buffered_filldir() memcpy, no '/' filter). Repeatable over many directory pages to sample slab, page-cache and pointer data. I:N - The defect is a read: nilfs_readdir() only parses the bogus entry and dir_emit() copies it out. Nothing attacker-controlled is written to kernel memory or file data; the NILFS_ERROR_FS superblock flag set by nilfs_error() is the availability effect. A:H - A position whose rec_len bytes are zero hits nilfs_error("zero-length directory entry"). With the default errors=remount-ro, __nilfs_error() sets SB_RDONLY and persists NILFS_ERROR_FS, taking the whole volume read-only for every user and NFS client; errors=panic panics the host. The over-read can also fault on an unmapped neighbour page.

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
Linux Linux 2ba466d74ed74f073257f86e61519cb8f8f46184 to < bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5 (affected · git)2ba466d74ed74f073257f86e61519cb8f8f46184 to < 69cf95f47a68b6920c9192a5ea3fe8c1db0a1070 (affected · git)2ba466d74ed74f073257f86e61519cb8f8f46184 to < 07f671d13067e68dbc840e46027668293c1c3a80 (affected · git)2ba466d74ed74f073257f86e61519cb8f8f46184 to < a48632160cdb85adadb4b7c8429d90a9511e7e6b (affected · git)2ba466d74ed74f073257f86e61519cb8f8f46184 to < dc171da15e46871abac4c05b389730883c15f680 (affected · git)2ba466d74ed74f073257f86e61519cb8f8f46184 to < 7bcffd24502d637b348a2e460093a0cabad4554e (affected · git)2ba466d74ed74f073257f86e61519cb8f8f46184 to < fbcbb54a4898984192b16764943af1be262bdb4d (affected · git)2ba466d74ed74f073257f86e61519cb8f8f46184 to < de7f49c12566cc5c7437a2f26c6c754b9d4d5648 (affected · git)Default: unaffected Linux · cna
Linux Linux 2.6.30 (affected)0 to < 2.6.30 (unaffected · semver)5.10.275 through 5.10.* (unaffected · semver)5.15.226 through 5.15.* (unaffected · semver)6.1.193 through 6.1.* (unaffected · semver)6.6.163 through 6.6.* (unaffected · semver)6.12.117 through 6.12.* (unaffected · semver)6.18.63 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected Linux · cna

Weaknesses

0

No weakness assertions.

References

8

Provider assertions

1

Linux · cna

nilfs2: validate directory position after llseek in readdir

Provenance

Schema
5.2
Searchable
yes
Content hash
1599f2afbc2f995a6e8d69e24fd71380099e7f2ab86e488f1bdb41262f15a437
Ingested
01 Dec 2026, 05:47:22 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected