{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "66c9c713de597f9b40a319ebda4d3466ce2cdff0"
            },
            {
              "fixed": "34dbcdd0562461805f2fd276593517794b41e487"
            },
            {
              "fixed": "df333b72c0e14d6cffec72ce9a00503f12d1e28d"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "7.0.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-138870.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: cfi: Bounds check restore token before swap\n\nCurrently the user-provided shadow stack restore token is not checked\nbefore being used as the address in ssamoswap.d. While an invalid\nrestore token will be caught and raise SIGSEGV, this happens after\nwriting 4 bytes of zeroes anywhere in the address space. Check that the\nrestore token is at least a valid user address before the swap to ensure\nwe do not scribble over kernel memory.",
  "id": "CVE-2026-138870",
  "modified": "2026-12-01T06:45:51.998446250Z",
  "published": "2026-11-30T13:25:45.456Z",
  "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/34dbcdd0562461805f2fd276593517794b41e487"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/df333b72c0e14d6cffec72ce9a00503f12d1e28d"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138870.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-138870"
    }
  ],
  "schema_version": "1.9.2",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "riscv: cfi: Bounds check restore token before swap"
}