CVE-2024-47674CWE-459

CVE-2024-47674

High · published October 15, 2024

CVSS v3.1
7.8
EPSS
0%
Percentile
14.9
In the wild
Unconfirmed
What it is

In the Linux kernel, the following vulnerability has been resolved:

mm: avoid leaving partial pfn mappings around in error case

As Jann points out, PFN mappings are special, because unlike normal

memory mappings, there is no lifetime information associated with the

mapping - it is just a raw mapping of PFNs with no reference counting of

a 'struct page'.

That's all very much intentional, but it does mean that it's easy to

mess up the cleanup in case of errors. Yes, a failed mmap() will always

eventually clean up any partial mappings, but without any explicit

lifetime in the page table mapping itself, it's very easy to do the

error handling in the wrong order.

In particular, it's easy to mistakenly free the physical backing store

before the page tables are actually cleaned up and (temporarily) have

stale dangling PTE entries.

To make this situation less error-prone, just make sure that any partial

pfn mapping is torn down early, before any other error handling.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00246 · 14.9th percentile
Weakness
CWE-459 · Incomplete Cleanup
Published
2024-10-15T15:15Z
Affected products (11)
ProductVersionsFixed in
linux/linux_kernel< 5.15.1685.15.168
linux/linux_kernel≥ 5.16, < 6.1.1116.1.111
linux/linux_kernel≥ 6.2, < 6.6.526.6.52
linux/linux_kernel≥ 6.7, < 6.10.116.10.11
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
References (10)
EPSS history
Timeline
  • 15 OCT 10:48Z
    mm: avoid leaving partial pfn mappings around in error case
    cvelistv5