CVE-2024-53096: mm: resolve faulty mmap_region() error path behaviour

Published Nov 25, 2024
·
Updated

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

mm: resolve faulty mmapregion() error path behaviour

The mmapregion() function is somewhat terrifying, with spaghetti-like control flow and numerous means by which issues can arise and incomplete state, memory leaks and other unpleasantness can occur.

A large amount of the complexity arises from trying to handle errors late in the process of mapping a VMA, which forms the basis of recently observed issues with resource leaks and observable inconsistent state.

Taking advantage of previous patches in this series we move a number of checks earlier in the code, simplifying things by moving the core of the logic into a static internal function mmapregion().

Doing this allows us to perform a number of checks up front before we do any real work, and allows us to unwind the writable unmap check unconditionally as required and to perform a CONFIGDEBUGVMMAPLETREE validation unconditionally also.

We move a number of things here:

1. We preallocate memory for the iterator before we call the file-backed memory hook, allowing us to exit early and avoid having to perform complicated and error-prone close/free logic. We carefully free iterator state on both success and error paths.

2. The enclosing mmapregion() function handles the mappingmapwritable() logic early. Previously the logic had the mappingmapwritable() at the point of mapping a newly allocated file-backed VMA, and a matching mappingunmapwritable() on success and error paths.

We now do this unconditionally if this is a file-backed, shared writable mapping. If a driver changes the flags to eliminate VMMAYWRITE, however doing so does not invalidate the seal check we just performed, and we in any case always decrement the counter in the wrapper.

We perform a debug assert to ensure a driver does not attempt to do the opposite.

3. We also move archvalidateflags() up into the mmapregion() function. This is only relevant on arm64 and sparc64, and the check is only meaningful for SPARC with ADI enabled. We explicitly add a warning for this arch if a driver invalidates this check, though the code ought eventually to be fixed to eliminate the need for this.

With all of these measures in place, we no longer need to explicitly close the VMA on error paths, as we place all checks which might fail prior to a call to any driver mmap hook.

This eliminates an entire class of errors, makes the code easier to reason about and more robust.

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

14 affected componentsFixes available
Linux Linux kernel>=5.10.150<5.10.231
Linux Linux kernel>=5.15.75<5.15.174
Linux Linux kernel>=6.0.3<6.1.119
Linux Linux kernel>=6.2<6.6.63
Linux Linux kernel>=6.7<6.12
Linux Linux kernel=5.19.17
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
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.25-1
debian/linux-6.1
6.1.129-1~deb11u1

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.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1
  2. Upgrade

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

    Fixed in 6.1.129-1~deb11u1

Event History

Nov 25, 2024
CVE Published
via MITRE·09:17 PM
Data Sourced
via MITRE·09:17 PM
DescriptionSeverity
Data Sourced
via Red Hat·10:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·10:15 PM
RemedyDescriptionSeverityAffected Software
Jan 29, 2025
Data Sourced
via Microsoft·08:00 AM
DescriptionSeverityWeakness
Mar 31, 2025
Data Sourced
via Launchpad·11:45 PM
Description
May 6, 2025
Data Sourced
via Ubuntu·11:49 PM
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-53096?

CVE-2024-53096 is classified as a medium-severity vulnerability in the Linux kernel.

2

How do I fix CVE-2024-53096?

To fix CVE-2024-53096, users should upgrade the Linux kernel to a version that includes the patch addressing this vulnerability.

3

Which versions of the Linux kernel are impacted by CVE-2024-53096?

CVE-2024-53096 affects various versions including those between 5.10.150 and 5.10.231, 5.15.75 and 5.15.174, and multiple other ranges up to 6.12.

4

What component of the Linux kernel is affected by CVE-2024-53096?

CVE-2024-53096 affects the mmap_region() function within the memory management subsystem of the Linux kernel.

5

Is there a known exploit for CVE-2024-53096?

As of now, there are no public exploits specifically targeting CVE-2024-53096, but the vulnerability requires prompt remediation.

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