{"id":"CVE-2024-53148","state":"PUBLISHED","title":"comedi: Flush partial mappings in error case","description":"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\").","publishedAt":"2024-12-24T11:28:48.619Z","updatedAt":"2026-08-05T11:44:10.150Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"57f048c2d205b85e34282a9b0b0ae177e84c2f44","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"b9322408d83accc8b96322bc7356593206288c56","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"8797b7712de704dc231f9e821d8eb3b9aeb3a032","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"16c507df509113c037cdc0ba642b9ab3389bd26c","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"9b07fb464eb69a752406e78e62ab3a60bfa7b00d","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"c6963a06ce5c61d3238751ada04ee1569663a828","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"297f14fbb81895f4ccdb0ad25d196786d6461e00","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"ce8f9fb651fac95dd41f69afe54d935420b945bd","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/comedi/comedi_fops.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.29","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.29","versionType":"semver"},{"version":"5.4.287","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.231","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.174","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.120","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.64","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.11","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12.2","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/comedi/comedi_fops.c"]}],"references":["https://git.kernel.org/stable/c/57f048c2d205b85e34282a9b0b0ae177e84c2f44","https://git.kernel.org/stable/c/b9322408d83accc8b96322bc7356593206288c56","https://git.kernel.org/stable/c/8797b7712de704dc231f9e821d8eb3b9aeb3a032","https://git.kernel.org/stable/c/16c507df509113c037cdc0ba642b9ab3389bd26c","https://git.kernel.org/stable/c/9b07fb464eb69a752406e78e62ab3a60bfa7b00d","https://git.kernel.org/stable/c/c6963a06ce5c61d3238751ada04ee1569663a828","https://git.kernel.org/stable/c/297f14fbb81895f4ccdb0ad25d196786d6461e00","https://git.kernel.org/stable/c/ce8f9fb651fac95dd41f69afe54d935420b945bd","https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:08:04.920Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/53xxx/CVE-2024-53148.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-53148","state":"PUBLISHED","datePublished":"2024-12-24T11:28:48.619Z","dateUpdated":"2026-08-05T11:44:10.150Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-11-19T17:17:24.998Z"},"containers":{"cna":{"title":"comedi: Flush partial mappings in error case","descriptions":[{"lang":"en","value":"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\")."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"57f048c2d205b85e34282a9b0b0ae177e84c2f44","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"b9322408d83accc8b96322bc7356593206288c56","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"8797b7712de704dc231f9e821d8eb3b9aeb3a032","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"16c507df509113c037cdc0ba642b9ab3389bd26c","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"9b07fb464eb69a752406e78e62ab3a60bfa7b00d","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"c6963a06ce5c61d3238751ada04ee1569663a828","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"297f14fbb81895f4ccdb0ad25d196786d6461e00","versionType":"git"},{"version":"ed9eccbe8970f6eedc1b978c157caf1251a896d4","status":"affected","lessThan":"ce8f9fb651fac95dd41f69afe54d935420b945bd","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/comedi/comedi_fops.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.29","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.29","versionType":"semver"},{"version":"5.4.287","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.231","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.174","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.120","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.64","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.11","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12.2","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/comedi/comedi_fops.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/57f048c2d205b85e34282a9b0b0ae177e84c2f44"},{"url":"https://git.kernel.org/stable/c/b9322408d83accc8b96322bc7356593206288c56"},{"url":"https://git.kernel.org/stable/c/8797b7712de704dc231f9e821d8eb3b9aeb3a032"},{"url":"https://git.kernel.org/stable/c/16c507df509113c037cdc0ba642b9ab3389bd26c"},{"url":"https://git.kernel.org/stable/c/9b07fb464eb69a752406e78e62ab3a60bfa7b00d"},{"url":"https://git.kernel.org/stable/c/c6963a06ce5c61d3238751ada04ee1569663a828"},{"url":"https://git.kernel.org/stable/c/297f14fbb81895f4ccdb0ad25d196786d6461e00"},{"url":"https://git.kernel.org/stable/c/ce8f9fb651fac95dd41f69afe54d935420b945bd"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"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 — inducing the partial remap_pfn_range failure via memory pressure and racing a concurrent buffer free (BUFCONFIG/detach) — 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 — 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."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:44:10.150Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"5.4.287"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"5.10.231"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"5.15.174"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.1.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.6.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.11.11"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.12.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T20:46:32.627Z"}}]}}}