{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "2ba466d74ed74f073257f86e61519cb8f8f46184"
            },
            {
              "fixed": "bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5"
            },
            {
              "fixed": "69cf95f47a68b6920c9192a5ea3fe8c1db0a1070"
            },
            {
              "fixed": "07f671d13067e68dbc840e46027668293c1c3a80"
            },
            {
              "fixed": "a48632160cdb85adadb4b7c8429d90a9511e7e6b"
            },
            {
              "fixed": "dc171da15e46871abac4c05b389730883c15f680"
            },
            {
              "fixed": "7bcffd24502d637b348a2e460093a0cabad4554e"
            },
            {
              "fixed": "fbcbb54a4898984192b16764943af1be262bdb4d"
            },
            {
              "fixed": "de7f49c12566cc5c7437a2f26c6c754b9d4d5648"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.6.30"
            },
            {
              "fixed": "5.10.275"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.11.0"
            },
            {
              "fixed": "5.15.226"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.16.0"
            },
            {
              "fixed": "6.1.193"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.2.0"
            },
            {
              "fixed": "6.6.163"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.7.0"
            },
            {
              "fixed": "6.12.117"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.13.0"
            },
            {
              "fixed": "6.18.63"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "7.3.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138871.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: validate directory position after llseek in readdir\n\nnilfs_readdir() uses ctx-\u003epos, 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]",
  "id": "CVE-2026-138871",
  "modified": "2026-12-01T06:45:17.931755806Z",
  "published": "2026-11-30T13:25:46.106Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/07f671d13067e68dbc840e46027668293c1c3a80"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/69cf95f47a68b6920c9192a5ea3fe8c1db0a1070"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/7bcffd24502d637b348a2e460093a0cabad4554e"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/a48632160cdb85adadb4b7c8429d90a9511e7e6b"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/bdfc5b64f8f606df9c1dc18c2e00200884c8e6f5"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/dc171da15e46871abac4c05b389730883c15f680"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/de7f49c12566cc5c7437a2f26c6c754b9d4d5648"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/fbcbb54a4898984192b16764943af1be262bdb4d"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138871.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-138871"
    }
  ],
  "schema_version": "1.9.2",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "nilfs2: validate directory position after llseek in readdir"
}