{
  "id": "CVE-2026-99018",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-99018",
  "published_at": "2026-10-23T12:20:54.888Z",
  "title": "riscv: entry: gate shadow call stack reload on sstatus.SPP, not tp",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: entry: gate shadow call stack reload on sstatus.SPP, not tp\n\nUnder CONFIG_SHADOW_CALL_STACK, handle_exception() reloads the kernel\nshadow call stack pointer (gp) only when the trap came from userspace.\nIt made that decision with scs_load_current_if_task_changed, which\ncompares the trap-time tp (read back from sscratch into s5) against the\ncurrent tp:\n\n\tbeq\t\\prev, tp, _skip_scs\n\tscs_load_current\n_skip_scs:\n\ntp is a user-writable register.  A user task that sets tp to the\nlinear-map address of its own task_struct (\u0026current) before trapping\nmakes the comparison succeed (can achieve by brute force with KASLR\nenable under our test), so the kernel skips scs_load_current and\nkeeps running with the gp that userspace left in place.  Under\nCONFIG_SHADOW_CALL_STACK gp is the shadow call stack pointer and\nload_global_pointer is a no-op, so the compiler-emitted\n\"sd ra, -8(gp)\" / \"ld ra, -8(gp)\" in every non-leaf function then write\nto, and return through, an attacker-controlled address -- an\nunprivileged kernel arbitrary-write and control-flow-hijack primitive.\nThe poisoned gp is saved to task_struct.scs_sp on return, so the reload\nis skipped on every subsequent entry as well.\n\nDecide \"came from userspace\" from the hardware sstatus.SPP bit (already\nin s1 at this point) instead of from tp, mirroring the check that\nret_from_exception already uses a few instructions later.  SPP is\nwritten by hardware on trap entry and cannot be forged from U-mode.\nLegitimate behaviour is unchanged: user entries (SPP=0) reload the task\nshadow call stack, nested kernel entries (SPP=1) skip it.",
  "cvss_by_source": {
    "cna": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= d1584d791a297aa8ed93503382a682a6ecfc4218, \u003c 6639735367a7d491977e9e5e7afc50b489d81d83",
          "\u003e= d1584d791a297aa8ed93503382a682a6ecfc4218, \u003c 7d1367a53137e379498eb8791295e58854378636",
          "\u003e= d1584d791a297aa8ed93503382a682a6ecfc4218, \u003c 37b4401ee6fa06046446d55e97e8d11784080843",
          "\u003e= d1584d791a297aa8ed93503382a682a6ecfc4218, \u003c 4d0697f192975dab5985e921989be1d85cf580e9"
        ],
        "fixed_in": [
          "6639735367a7d491977e9e5e7afc50b489d81d83",
          "7d1367a53137e379498eb8791295e58854378636",
          "37b4401ee6fa06046446d55e97e8d11784080843",
          "4d0697f192975dab5985e921989be1d85cf580e9"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.7"
        ],
        "fixed_in": [
          "0",
          "6.12.113",
          "6.18.57",
          "7.2.11",
          "7.3"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 6639735367a7d491977e9e5e7afc50b489d81d83 or 7d1367a53137e379498eb8791295e58854378636 or 37b4401ee6fa06046446d55e97e8d11784080843 or 4d0697f192975dab5985e921989be1d85cf580e9 or later.",
      "Upgrade Linux to 0 or 6.12.113 or 6.18.57 or 7.2.11 or 7.3 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
