CVE-2023-52659: x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type

Published May 17, 2024
·
Updated

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

x86/mm: Ensure input to pfntokaddr() is treated as a 64-bit type

On 64-bit platforms, the pfntokaddr() macro requires that the input value is 64 bits in order to ensure that valid address bits don't get lost when shifting that input by PAGESHIFT to calculate the physical address to provide a virtual address for.

One such example is in pvalidatepages() (used by SEV-SNP guests), where the GFN in the struct used for page-state change requests is a 40-bit bit-field, so attempts to pass this GFN field directly into pfntokaddr() ends up causing guest crashes when dealing with addresses above the 1TB range due to the above.

Fix this issue with SEV-SNP guests, as well as any similar cases that might cause issues in current/future code, by using an inline function, instead of a macro, so that the input is implicitly cast to the expected 64-bit input type prior to performing the shift operation.

While it might be argued that the issue is on the caller side, other archs/macros have taken similar approaches to deal with instances like this, such as ARM explicitly casting the input to physaddrt:

e48866647b48 ("ARM: 8396/1: use physaddrt in pfntokaddr()")

A C inline function is even better though.

[ mingo: Refined the changelog some more & added alwaysinline. ]

Other sources

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

x86/mm: Ensure input to pfntokaddr() is treated as a 64-bit type

The Linux kernel CVE team has assigned CVE-2023-52659 to this issue.

Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024051755-CVE-2023-52659-6f51@gregkh/T

Red Hat

Affected Software

8 affected componentsFixes available
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
redhat/kernel<6.6.23
6.6.23
redhat/kernel<6.7.11
6.7.11
redhat/kernel<6.8.2
6.8.2
redhat/kernel<6.9
6.9
Linux Linux kernel>=6.5<6.6.23
Linux Linux kernel>=6.7<6.7.11
Linux Linux kernel>=6.8<6.8.2

Event History

May 17, 2024
CVE Published
via MITRE·12:08 PM
Data Sourced
via MITRE·12:08 PM
Description
Data Sourced
via NVD·01:15 PM
Description
Data Sourced
via NVD·01:15 PM
RemedySeverityAffected Software
Data Sourced
via Red Hat·10:38 PM
DescriptionSeverityAffected Software
Jun 8, 2024
Data Sourced
via Launchpad·12:59 AM
Description
Dec 1, 2024
Data Sourced
via Ubuntu·02:58 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2023-52659?

CVE-2023-52659 is classified as a medium severity vulnerability in the Linux kernel.

2

How do I fix CVE-2023-52659?

To fix CVE-2023-52659, upgrade the kernel to version 6.6.23 or later for Red Hat or to specified versions for Debian as detailed in the advisory.

3

What systems are affected by CVE-2023-52659?

CVE-2023-52659 affects the Linux kernel on 64-bit platforms across various distributions including Red Hat and Debian.

4

What is the impact of CVE-2023-52659?

CVE-2023-52659 may allow an attacker to exploit loss of address bits leading to potential memory corruption or loss of intended behavior.

5

When was CVE-2023-52659 disclosed?

CVE-2023-52659 was disclosed as part of a set of kernel vulnerabilities affecting various versions of the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203