Bug 2318750 (CVE-2024-47674) - CVE-2024-47674 kernel: mm: avoid leaving partial pfn mappings around in error case
Summary: CVE-2024-47674 kernel: mm: avoid leaving partial pfn mappings around in error...
Keywords:
Status: NEW
Alias: CVE-2024-47674
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2318766
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-10-15 11:01 UTC by OSIDB Bzimport
Modified: 2024-10-15 12:55 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2024-10-15 11:01:14 UTC
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.

Comment 1 Avinash Hanwate 2024-10-15 11:50:08 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024101538-CVE-2024-47674-ba1f@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.