{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-53148",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-53148"
  ],
  "published": "2024-12-24T11:29:52Z",
  "summary": "comedi: Flush partial mappings in error case",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ncomedi: Flush partial mappings in error case\n\nIf some remap_pfn_range() calls succeeded before one failed, we still have\nbuffer pages mapped into the userspace page tables when we drop the buffer\nreference with comedi_buf_map_put(bm). The userspace mappings are only\ncleaned up later in the mmap error path.\n\nFix it by explicitly flushing all mappings in our VMA on the error path.\n\nSee commit 79a61cc3fc04 (\"mm: avoid leaving partial pfn mappings around in\nerror case\").",
  "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.120",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-53148"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/57f048c2d205b85e34282a9b0b0ae177e84c2f44"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b9322408d83accc8b96322bc7356593206288c56"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8797b7712de704dc231f9e821d8eb3b9aeb3a032"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/16c507df509113c037cdc0ba642b9ab3389bd26c"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9b07fb464eb69a752406e78e62ab3a60bfa7b00d"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c6963a06ce5c61d3238751ada04ee1569663a828"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/297f14fbb81895f4ccdb0ad25d196786d6461e00"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ce8f9fb651fac95dd41f69afe54d935420b945bd"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerability is reached only via mmap(2) on a local comedi character device node (/dev/comediN); there is no network or physical-bus interface involved.\nAC:L - The attacker controls both sides of the condition \u2014 inducing the partial remap_pfn_range failure via memory pressure and racing a concurrent buffer free (BUFCONFIG/detach) \u2014 so per the UAF/attacker-controlled-race guidance this is Low.\nPR:L - Once a driver is attached (a common one-time privileged setup), an unprivileged local user with access to the device node can allocate a buffer and mmap it without any capability; the vulnerable comedi_mmap and buffer-resize paths have no CAP check.\nUI:N - The attacker performs the open, buffer allocation, and mmap entirely on their own; no victim action is required.\nS:U - The corruption stays within the kernel's own security authority (kernel-managed memory); no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The dangling userspace PTEs point at physical pages that are freed and reallocated to arbitrary kernel or other-process uses, giving the attacker a read primitive over reused memory.\nI:H - The stale mappings are writable (PAGE_SHARED), so userspace can write into freed/reallocated physical pages \u2014 an arbitrary write primitive suitable for privilege escalation.\nA:H - Dangling PTEs to reused physical pages readily corrupt kernel memory, causing oopses/panics and system instability."
    }
  }
}
