CVE-2024-53111: mm/mremap: fix address wraparound in move_page_tables()

Published Dec 2, 2024
·
Updated

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

mm/mremap: fix address wraparound in movepagetables()

On 32-bit platforms, it is possible for the expression len + oldaddr < oldend to be false-positive if len + oldaddr wraps around. oldaddr is the cursor in the old range up to which page table entries have been moved; so if the operation succeeded, oldaddr is the end of the old region, and adding len to it can wrap.

The overflow causes mremap() to mistakenly believe that PTEs have been copied; the consequence is that mremap() bails out, but doesn't move the PTEs back before the new VMA is unmapped, causing anonymous pages in the region to be lost. So basically if userspace tries to mremap() a private-anon region and hits this bug, mremap() will return an error and the private-anon region's contents appear to have been zeroed.

The idea of this check is that oldend - len is the original start address, and writing the check that way also makes it easier to read; so fix the check by rearranging the comparison accordingly.

(An alternate fix would be to refactor this function by introducing an "origoldstart" variable or such.)

Tested in a VM with a 32-bit X86 kernel; without the patch:

user@horn:~/bigmremap$ cat test.c #define GNUSOURCE #include <stdlib.h> #include <stdio.h> #include <err.h> #include <sys/mman.h>

#define ADDR1 ((void)0x60000000) #define ADDR2 ((void)0x10000000) #define SIZE 0x50000000uL

int main(void) { unsigned char p1 = mmap(ADDR1, SIZE, PROTREAD|PROTWRITE, MAPANONYMOUS|MAPPRIVATE|MAPFIXEDNOREPLACE, -1, 0); if (p1 == MAPFAILED) err(1, "mmap 1"); unsigned char p2 = mmap(ADDR2, SIZE, PROTNONE, MAPANONYMOUS|MAPPRIVATE|MAPFIXEDNOREPLACE, -1, 0); if (p2 == MAPFAILED) err(1, "mmap 2"); p1 = 0x41; printf("first char is 0x%02hhx\n", p1); unsigned char p3 = mremap(p1, SIZE, SIZE, MREMAPMAYMOVE|MREMAPFIXED, p2); if (p3 == MAPFAILED) { printf("mremap() failed; first char is 0x%02hhx\n", p1); } else { printf("mremap() succeeded; first char is 0x%02hhx\n", p3); } } user@horn:~/bigmremap$ gcc -static -o test test.c user@horn:~/bigmremap$ setarch -R ./test first char is 0x41 mremap() failed; first char is 0x00

With the patch:

user@horn:~/bigmremap$ setarch -R ./test first char is 0x41 mremap() succeeded; first char is 0x41

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

9 affected componentsFixes available
Linux Linux kernel>=6.7<6.11.10
Linux Linux kernel=6.12-rc1
Linux Linux kernel=6.12-rc2
Linux Linux kernel=6.12-rc3
Linux Linux kernel=6.12-rc4
Linux Linux kernel=6.12-rc5
Linux Linux kernel=6.12-rc6
Linux Linux kernel=6.12-rc7
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1

Event History

Dec 2, 2024
CVE Published
via MITRE·01:44 PM
Data Sourced
via MITRE·01:44 PM
DescriptionSeverity
Data Sourced
via NVD·02:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 20, 2025
Data Sourced
via Launchpad·12:51 AM
Description
May 3, 2025
Data Sourced
via Ubuntu·01:10 AM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-53111?

CVE-2024-53111 is classified as a moderate severity vulnerability in the Linux kernel.

2

How do I fix CVE-2024-53111?

To fix CVE-2024-53111, update to the latest version of the Linux kernel beyond 6.11.10 or any impacted 6.12 release candidate.

3

What platforms are affected by CVE-2024-53111?

CVE-2024-53111 affects 32-bit platforms running the specified versions of the Linux kernel.

4

What impact does CVE-2024-53111 have?

The vulnerability could lead to incorrect memory handling due to address wraparound, potentially causing instability.

5

Is CVE-2024-53111 a remote vulnerability?

CVE-2024-53111 is not classified as a remote vulnerability; it requires local access to exploit.

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