{"id":"CVE-2026-138871","aliases":["CVE-2026-138871"],"related":[],"kind":"vulnerability","state":"published","title":"nilfs2: validate directory position after llseek in readdir","summary":"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]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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]","source":"cvelist"}],"published":"2026-11-30T13:25:46.106Z","modified":"2026-12-01T06:17:29.450Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","score":9.1,"rating":"CRITICAL"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"69cf95f47a68b6920c9192a5ea3fe8c1db0a1070","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"07f671d13067e68dbc840e46027668293c1c3a80","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"a48632160cdb85adadb4b7c8429d90a9511e7e6b","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"dc171da15e46871abac4c05b389730883c15f680","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"7bcffd24502d637b348a2e460093a0cabad4554e","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"fbcbb54a4898984192b16764943af1be262bdb4d","status":"affected"},{"type":"git","introduced":"2ba466d74ed74f073257f86e61519cb8f8f46184","fixed":"de7f49c12566cc5c7437a2f26c6c754b9d4d5648","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.30","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.30","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/69cf95f47a68b6920c9192a5ea3fe8c1db0a1070","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/07f671d13067e68dbc840e46027668293c1c3a80","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a48632160cdb85adadb4b7c8429d90a9511e7e6b","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/dc171da15e46871abac4c05b389730883c15f680","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7bcffd24502d637b348a2e460093a0cabad4554e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fbcbb54a4898984192b16764943af1be262bdb4d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/de7f49c12566cc5c7437a2f26c6c754b9d4d5648","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138871","url":"https://www.cve.org/CVERecord?id=CVE-2026-138871","licence":"CVE Terms of Use","modified":"2026-12-01T05:40:24.935Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138871","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138871","licence":"Public domain","modified":"2026-12-01T06:17:29.450Z"}],"updatedAt":"2026-12-01T06:32:16.820Z","epss":{"score":0.01384,"percentile":0.72981,"date":"2026-12-01T12:00:22.000Z"}}