{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-22045",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-22045"
  ],
  "published": "2025-04-16T14:14:59Z",
  "summary": "x86/mm: Fix flush_tlb_range() when used for zapping normal PMDs",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nx86/mm: Fix flush_tlb_range() when used for zapping normal PMDs\n\nOn the following path, flush_tlb_range() can be used for zapping normal\nPMD entries (PMD entries that point to page tables) together with the PTE\nentries in the pointed-to page table:\n\n    collapse_pte_mapped_thp\n      pmdp_collapse_flush\n        flush_tlb_range\n\nThe arm64 version of flush_tlb_range() has a comment describing that it can\nbe used for page table removal, and does not use any last-level\ninvalidation optimizations. Fix the X86 version by making it behave the\nsame way.\n\nCurrently, X86 only uses this information for the following two purposes,\nwhich I think means the issue doesn't have much impact:\n\n - In native_flush_tlb_multi() for checking if lazy TLB CPUs need to be\n   IPI'd to avoid issues with speculative page table walks.\n - In Hyper-V TLB paravirtualization, again for lazy TLB stuff.\n\nThe patch \"x86/mm: only invalidate final translations with INVLPGB\" which\nis currently under review (see\n<https://lore.kernel.org/all/20241230175550.4046587-13-riel@surriel.com/>)\nwould probably be making the impact of this a lot worse.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.134",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-22045"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/618d5612ecb7bfc1c85342daafeb2b47e29e77a3"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/556d446068f90981e5d71ca686bdaccdd545d491"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0a8f806ea6b5dd64b3d1f05ff774817d5f7ddbd1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0708fd6bd8161871bfbadced2ca4319b84ab44fe"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7085895c59e4057ffae17f58990ccb630087d0d2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/93224deb50a8d20df3884f3672ce9f982129aa50"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/320ac1af4c0bdb92c864dc9250d1329234820edf"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/78d6f9a9eb2a5da6fcbd76d6191d24b0dcc321be"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3ef938c3503563bfc2ac15083557f880d29c2e64"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerable path is reached from the `madvise(MADV_COLLAPSE)` syscall (or khugepaged) on the calling process's own address space, requiring local access to the system. There is no remote or adjacent-network entry point into `pmdp_collapse_flush()`.\nAC:L - The attacker controls every element needed: triggering the PMD zap via `MADV_COLLAPSE` on demand, pinning threads so remote CPUs enter lazy TLB mode with the mm still in CR3, generating kernel work so those lazy CPUs are actively executing, and spraying the page-table page after `pte_free_defer()` releases it. Both sides of the window are attacker-created and the sequence can be repeated indefinitely.\nPR:L - `MADV_COLLAPSE` on the caller's own mm has no capability check in `mm/madvise.c` (the `CAP_SYS_ADMIN` test at line 1362 covers `MADV_HWPOISON`, and `CAP_SYS_NICE` at line 1803 only applies to remote mms). Any unprivileged local user, including one inside a container or user namespace, can drive the path.\nUI:N - The attacker triggers the collapse entirely from its own process via a syscall; no action by any other user or administrator is needed. khugepaged also reaches the same path autonomously.\nS:U - The stale paging-structure state and any resulting corruption stay within the kernel's own security authority on the affected host or guest. No IOMMU, hypervisor, or VM boundary is crossed.\nC:H - A lazy-TLB CPU speculatively walking the freed-and-reused page-table page interprets attacker-sprayable memory as PTEs, which can map user virtual addresses to arbitrary physical frames and expose their contents through transient execution. That amounts to an arbitrary physical-memory read primitive rather than a bounded leak.\nI:H - The same bogus paging-structure entries constructed from attacker-controlled data can point a user virtual address at arbitrary physical memory, giving a write primitive over kernel or other-process pages. Corruption of page-table translations is directly leverageable for control-flow hijacking and privilege escalation.\nA:H - Speculative page-table walks over a freed page can resolve to non-existent or non-RAM physical addresses, producing machine checks, oopses, or otherwise unpredictable CPU behavior that panics the machine. Any resulting translation corruption also crashes the affected process and kernel."
    }
  }
}
