{
  "schemaVersion": 1,
  "attribution": [
    {
      "source": "CISA Known Exploited Vulnerabilities",
      "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog",
      "licence": "US government work"
    },
    {
      "source": "GitHub Advisory Database",
      "url": "https://github.com/advisories",
      "licence": "CC BY 4.0"
    },
    {
      "source": "Have I Been Pwned",
      "url": "https://haveibeenpwned.com/",
      "licence": "CC BY 4.0"
    },
    {
      "source": "CVE Program (CVE records)",
      "url": "https://www.cve.org/Legal/TermsOfUse",
      "licence": "CVE Terms of Use",
      "notice": "Copyright © 1999-2026, The MITRE Corporation. CVE is a trademark and the CVE logo is a registered trademark of The MITRE Corporation.",
      "terms": "CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE™). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy."
    },
    {
      "source": "FIRST EPSS",
      "url": "https://www.first.org/epss/",
      "licence": "free to use; FIRST requests attribution"
    }
  ],
  "record": {
    "id": "CVE-2025-38670",
    "sourceURL": "https://www.cve.org/CVERecord?id=CVE-2025-38670",
    "idYear": 2025,
    "status": "PUBLISHED",
    "publishedAt": "2025-08-22T16:03:01.242Z",
    "updatedAt": "2026-08-05T12:03:51.464Z",
    "importedAt": "2026-10-24T01:57:34.152Z",
    "snapshot": {
      "id": "cve_2026-10-24_midnight_baseline",
      "at": "2026-10-24T00:00:00.000Z",
      "source": "https://github.com/CVEProject/cvelistV5/releases/tag/cve_2026-10-24_0100Z"
    },
    "facts": {
      "title": "arm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack()",
      "summary": "In the Linux kernel, the following vulnerability has been resolved:\n\narm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack()\n\n`cpu_switch_to()` and `call_on_irq_stack()` manipulate SP to change\nto different stacks along with the Shadow Call Stack if it is enabled.\nThose two stack changes cannot be done atomically and both functions\ncan be interrupted by SErrors or Debug Exceptions which, though unlikely,\nis very much broken : if interrupted, we can end up with mismatched stacks\nand Shadow Call Stack leading to clobbered stacks.\n\nIn `cpu_switch_to()`, it can happen when SP_EL0 points to the new task,\nbut x18 stills points to the old task's SCS. When the interrupt handler\ntries to save the task's SCS pointer, it will save the old task\nSCS pointer (x18) into the new task struct (pointed to by SP_EL0),\nclobbering it.\n\nIn `call_on_irq_stack()`, it can happen when switching from the task stack\nto the IRQ stack and when switching back. In both cases, we can be\ninterrupted when the SCS pointer points to the IRQ SCS, but SP points to\nthe task stack. The nested interrupt handler pushes its return addresses\non the IRQ SCS. It then detects that SP points to the task stack,\ncalls `call_on_irq_stack()` and clobbers the task SCS pointer with\nthe IRQ SCS pointer, which it will also use !\n\nThis leads to tasks returning to addresses on the wrong SCS,\nor even on the IRQ SCS, triggering kernel panics via CONFIG_VMAP_STACK\nor FPAC if enabled.\n\nThis is possible on a default config, but unlikely.\nHowever, when enabling CONFIG_ARM64_PSEUDO_NMI, DAIF is unmasked and\ninstead the GIC is responsible for filtering what interrupts the CPU\nshould receive based on priority.\nGiven the goal of emulating NMIs, pseudo-NMIs can be received by the CPU\neven in `cpu_switch_to()` and `call_on_irq_stack()`, possibly *very*\nfrequently depending on the system configuration and workload, leading\nto unpredictable kernel panics.\n\nCompletely mask DAIF in `cpu_switch_to()` and restore it when returning.\nDo the same in `call_on_irq_stack()`, but restore and mask around\nthe branch.\nMask DAIF even if CONFIG_SHADOW_CALL_STACK is not enabled for consistency\nof behaviour between all configurations.\n\nIntroduce and use an assembly macro for saving and masking DAIF,\nas the existing one saves but only masks IF.",
      "affected": [
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "3f225f29c69c13ce1cbdb1d607a42efeef080056",
              "status": "affected",
              "versionType": "git",
              "lessThan": "f7e0231eeaa33245c649fac0303cf97209605446"
            },
            {
              "version": "402d2b1d54b7085d0c3bfd01fd50c2701dde64b3",
              "status": "affected",
              "versionType": "git",
              "lessThan": "407047893a64399f2d2390ff35cc6061107d805d"
            },
            {
              "version": "4403c7b7e5e1ad09a266b6e399fd7bf97931508e",
              "status": "affected",
              "versionType": "git",
              "lessThan": "a6b0cb523eaa01efe8a3f76ced493ba60674c6e6"
            },
            {
              "version": "59b37fe52f49955791a460752c37145f1afdcad1",
              "status": "affected",
              "versionType": "git",
              "lessThan": "9433a5f437b0948d6a2d8a02ad7a42ab7ca27a61"
            },
            {
              "version": "59b37fe52f49955791a460752c37145f1afdcad1",
              "status": "affected",
              "versionType": "git",
              "lessThan": "708fd522b86d2a9544c34ec6a86fa3fc23336525"
            },
            {
              "version": "59b37fe52f49955791a460752c37145f1afdcad1",
              "status": "affected",
              "versionType": "git",
              "lessThan": "0f67015d72627bad72da3c2084352e0aa134416b"
            },
            {
              "version": "59b37fe52f49955791a460752c37145f1afdcad1",
              "status": "affected",
              "versionType": "git",
              "lessThan": "d42e6c20de6192f8e4ab4cf10be8c694ef27e8cb"
            },
            {
              "version": "e47ce4f11e26fa3ea99b09521da8b3ac3a7b578d",
              "status": "affected",
              "versionType": "git"
            },
            {
              "version": "5.10.180",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "5.10.210"
            },
            {
              "version": "5.15.111",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "5.15.190"
            },
            {
              "version": "6.1.28",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "6.1.149"
            },
            {
              "version": "6.2.15",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "6.3"
            }
          ]
        },
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "affected",
          "versions": [
            {
              "version": "6.3",
              "status": "affected"
            },
            {
              "version": "0",
              "status": "unaffected",
              "versionType": "semver",
              "lessThan": "6.3"
            },
            {
              "version": "5.10.210",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "5.10.*"
            },
            {
              "version": "5.15.190",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "5.15.*"
            },
            {
              "version": "6.1.149",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.1.*"
            },
            {
              "version": "6.6.101",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.6.*"
            },
            {
              "version": "6.12.41",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.12.*"
            },
            {
              "version": "6.15.9",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.15.*"
            },
            {
              "version": "6.16",
              "status": "unaffected",
              "versionType": "original_commit_for_fix",
              "lessThanOrEqual": "*"
            }
          ]
        }
      ]
    }
  }
}