{"api_version":"1","generated_at":"2026-12-01T13:32:47+00:00","cve":"CVE-2026-138871","urls":{"html":"https://cve.report/CVE-2026-138871","api":"https://cve.report/api/cve/CVE-2026-138871.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-138871","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-138871"},"summary":{"title":"nilfs2: validate directory position after llseek in readdir","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: validate directory position after llseek in readdir\n\nnilfs_readdir() uses ctx->pos, which userspace can set to an arbitrary\nvalue via llseek, as an offset into the directory folio and parses\nwhatever bytes sit there as a directory entry.  A position pointing\ninto the middle of an entry -- or at unused bytes of a corrupted image\nthat the page validator never inspected -- makes dir_emit() copy up to\n255 (name_len) bytes from a bogus entry, possibly reading past the end\nof the folio and returning unrelated memory contents to userspace.\n\nSnap unaligned positions onto a valid entry boundary by walking the\nrec_len chain from the chunk start before parsing, as ext2 does in\next2_validate_entry().\n\n[ryusuke: fixed offset wrap-around in nilfs_validate_entry() and\n conformed AI tag to guidelines]","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:17:43","updated_at":"2026-12-01 06:17:29"},"problem_types":[],"metrics":[{"version":"3.1","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","score":"9.1","severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","data":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","baseScore":9.1,"baseSeverity":"CRITICAL","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"NONE","availabilityImpact":"HIGH"}},{"version":"3.1","source":"CNA","type":"DECLARED","score":"9.1","severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","data":{"baseScore":9.1,"baseSeverity":"CRITICAL","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","version":"3.1"}}],"references":[{"url":"https://git.kernel.org/stable/c/bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5","name":"https://git.kernel.org/stable/c/bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/de7f49c12566cc5c7437a2f26c6c754b9d4d5648","name":"https://git.kernel.org/stable/c/de7f49c12566cc5c7437a2f26c6c754b9d4d5648","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/a48632160cdb85adadb4b7c8429d90a9511e7e6b","name":"https://git.kernel.org/stable/c/a48632160cdb85adadb4b7c8429d90a9511e7e6b","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/07f671d13067e68dbc840e46027668293c1c3a80","name":"https://git.kernel.org/stable/c/07f671d13067e68dbc840e46027668293c1c3a80","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/7bcffd24502d637b348a2e460093a0cabad4554e","name":"https://git.kernel.org/stable/c/7bcffd24502d637b348a2e460093a0cabad4554e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/fbcbb54a4898984192b16764943af1be262bdb4d","name":"https://git.kernel.org/stable/c/fbcbb54a4898984192b16764943af1be262bdb4d","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/69cf95f47a68b6920c9192a5ea3fe8c1db0a1070","name":"https://git.kernel.org/stable/c/69cf95f47a68b6920c9192a5ea3fe8c1db0a1070","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/dc171da15e46871abac4c05b389730883c15f680","name":"https://git.kernel.org/stable/c/dc171da15e46871abac4c05b389730883c15f680","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-138871","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138871","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2ba466d74ed74f073257f86e61519cb8f8f46184 bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2ba466d74ed74f073257f86e61519cb8f8f46184 69cf95f47a68b6920c9192a5ea3fe8c1db0a1070 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2ba466d74ed74f073257f86e61519cb8f8f46184 07f671d13067e68dbc840e46027668293c1c3a80 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2ba466d74ed74f073257f86e61519cb8f8f46184 a48632160cdb85adadb4b7c8429d90a9511e7e6b git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2ba466d74ed74f073257f86e61519cb8f8f46184 dc171da15e46871abac4c05b389730883c15f680 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2ba466d74ed74f073257f86e61519cb8f8f46184 7bcffd24502d637b348a2e460093a0cabad4554e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2ba466d74ed74f073257f86e61519cb8f8f46184 fbcbb54a4898984192b16764943af1be262bdb4d git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2ba466d74ed74f073257f86e61519cb8f8f46184 de7f49c12566cc5c7437a2f26c6c754b9d4d5648 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2.6.30","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 2.6.30 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.275 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.226 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.193 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.117 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.63 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/nilfs2/dir.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5","status":"affected","version":"2ba466d74ed74f073257f86e61519cb8f8f46184","versionType":"git"},{"lessThan":"69cf95f47a68b6920c9192a5ea3fe8c1db0a1070","status":"affected","version":"2ba466d74ed74f073257f86e61519cb8f8f46184","versionType":"git"},{"lessThan":"07f671d13067e68dbc840e46027668293c1c3a80","status":"affected","version":"2ba466d74ed74f073257f86e61519cb8f8f46184","versionType":"git"},{"lessThan":"a48632160cdb85adadb4b7c8429d90a9511e7e6b","status":"affected","version":"2ba466d74ed74f073257f86e61519cb8f8f46184","versionType":"git"},{"lessThan":"dc171da15e46871abac4c05b389730883c15f680","status":"affected","version":"2ba466d74ed74f073257f86e61519cb8f8f46184","versionType":"git"},{"lessThan":"7bcffd24502d637b348a2e460093a0cabad4554e","status":"affected","version":"2ba466d74ed74f073257f86e61519cb8f8f46184","versionType":"git"},{"lessThan":"fbcbb54a4898984192b16764943af1be262bdb4d","status":"affected","version":"2ba466d74ed74f073257f86e61519cb8f8f46184","versionType":"git"},{"lessThan":"de7f49c12566cc5c7437a2f26c6c754b9d4d5648","status":"affected","version":"2ba466d74ed74f073257f86e61519cb8f8f46184","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/nilfs2/dir.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"2.6.30"},{"lessThan":"2.6.30","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.275","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.226","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.193","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.117","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.63","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.275","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.226","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.193","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.117","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.63","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"2.6.30","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"2.6.30","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: validate directory position after llseek in readdir\n\nnilfs_readdir() uses ctx->pos, which userspace can set to an arbitrary\nvalue via llseek, as an offset into the directory folio and parses\nwhatever bytes sit there as a directory entry.  A position pointing\ninto the middle of an entry -- or at unused bytes of a corrupted image\nthat the page validator never inspected -- makes dir_emit() copy up to\n255 (name_len) bytes from a bogus entry, possibly reading past the end\nof the folio and returning unrelated memory contents to userspace.\n\nSnap unaligned positions onto a valid entry boundary by walking the\nrec_len chain from the chunk start before parsing, as ext2 does in\next2_validate_entry().\n\n[ryusuke: fixed offset wrap-around in nilfs_validate_entry() and\n conformed AI tag to guidelines]"}],"metrics":[{"cvssV3_1":{"baseScore":9.1,"baseSeverity":"CRITICAL","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","version":"3.1"},"scenarios":[{"lang":"en","value":"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.\nAC: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.\nPR: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.\nUI: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.\nS: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.\nC: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.\nI: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.\nA: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."}]}],"providerMetadata":{"dateUpdated":"2026-12-01T05:40:24.935Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5"},{"url":"https://git.kernel.org/stable/c/69cf95f47a68b6920c9192a5ea3fe8c1db0a1070"},{"url":"https://git.kernel.org/stable/c/07f671d13067e68dbc840e46027668293c1c3a80"},{"url":"https://git.kernel.org/stable/c/a48632160cdb85adadb4b7c8429d90a9511e7e6b"},{"url":"https://git.kernel.org/stable/c/dc171da15e46871abac4c05b389730883c15f680"},{"url":"https://git.kernel.org/stable/c/7bcffd24502d637b348a2e460093a0cabad4554e"},{"url":"https://git.kernel.org/stable/c/fbcbb54a4898984192b16764943af1be262bdb4d"},{"url":"https://git.kernel.org/stable/c/de7f49c12566cc5c7437a2f26c6c754b9d4d5648"}],"title":"nilfs2: validate directory position after llseek in readdir","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-138871","datePublished":"2026-11-30T13:25:46.106Z","dateReserved":"2026-11-30T13:22:15.900Z","dateUpdated":"2026-12-01T05:40:24.935Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:17:43","lastModifiedDate":"2026-12-01 06:17:29","problem_types":[],"metrics":{"cvssMetricV31":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","baseScore":9.1,"baseSeverity":"CRITICAL","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"NONE","availabilityImpact":"HIGH"},"exploitabilityScore":3.9,"impactScore":5.2}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"138871","Ordinal":"1","Title":"nilfs2: validate directory position after llseek in readdir","CVE":"CVE-2026-138871","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"138871","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: validate directory position after llseek in readdir\n\nnilfs_readdir() uses ctx->pos, which userspace can set to an arbitrary\nvalue via llseek, as an offset into the directory folio and parses\nwhatever bytes sit there as a directory entry.  A position pointing\ninto the middle of an entry -- or at unused bytes of a corrupted image\nthat the page validator never inspected -- makes dir_emit() copy up to\n255 (name_len) bytes from a bogus entry, possibly reading past the end\nof the folio and returning unrelated memory contents to userspace.\n\nSnap unaligned positions onto a valid entry boundary by walking the\nrec_len chain from the chunk start before parsing, as ext2 does in\next2_validate_entry().\n\n[ryusuke: fixed offset wrap-around in nilfs_validate_entry() and\n conformed AI tag to guidelines]","Type":"Description","Title":"nilfs2: validate directory position after llseek in readdir"}]}}}