CVE-2023-52659

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
17/05/2024
Last modified:
25/09/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type<br /> <br /> On 64-bit platforms, the pfn_to_kaddr() macro requires that the input<br /> value is 64 bits in order to ensure that valid address bits don&amp;#39;t get<br /> lost when shifting that input by PAGE_SHIFT to calculate the physical<br /> address to provide a virtual address for.<br /> <br /> One such example is in pvalidate_pages() (used by SEV-SNP guests), where<br /> the GFN in the struct used for page-state change requests is a 40-bit<br /> bit-field, so attempts to pass this GFN field directly into<br /> pfn_to_kaddr() ends up causing guest crashes when dealing with addresses<br /> above the 1TB range due to the above.<br /> <br /> Fix this issue with SEV-SNP guests, as well as any similar cases that<br /> might cause issues in current/future code, by using an inline function,<br /> instead of a macro, so that the input is implicitly cast to the<br /> expected 64-bit input type prior to performing the shift operation.<br /> <br /> While it might be argued that the issue is on the caller side, other<br /> archs/macros have taken similar approaches to deal with instances like<br /> this, such as ARM explicitly casting the input to phys_addr_t:<br /> <br /> e48866647b48 ("ARM: 8396/1: use phys_addr_t in pfn_to_kaddr()")<br /> <br /> A C inline function is even better though.<br /> <br /> [ mingo: Refined the changelog some more &amp; added __always_inline. ]

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.5 (including) 6.6.23 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.7.11 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.8 (including) 6.8.2 (excluding)