Vulnerability · Published Nov 25, 2024 · Assigned by Linux

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

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 27% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.3%top 72.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: mm: resolve faulty mmap_region() error path behaviour The mmap_region() 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 __mmap_region(). 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 CONFIG_DEBUG_VM_MAPLE_TREE 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 mmap_region() function handles the mapping_map_writable() logic early. Previously the logic had the mapping_map_writable() at the point of mapping a newly allocated file-backed VMA, and a matching mapping_unmap_writable() 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 VM_MAYWRITE, 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 arch_validate_flags() up into the mmap_region() 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.119-1DEBIAN-CVE-2024-53096
Debian:13linux6.12.3-1DEBIAN-CVE-2024-53096
Debian:14linux6.12.3-1DEBIAN-CVE-2024-53096
Ubuntu:22.04:LTSlinux5.15.0-135.146UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux5.15.0-135.146USN-7387-1
Ubuntu:24.04:LTSlinux6.8.0-58.60UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-aws5.15.0-1080.87UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-aws5.15.0-1080.87USN-7387-1
Ubuntu:24.04:LTSlinux-aws6.8.0-1027.29UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1027.29~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-azure5.15.0-1084.93USN-7387-1
Ubuntu:22.04:LTSlinux-azure5.15.0-1084.93UBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-azure6.8.0-1027.32UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-azure-6.11no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1027.32~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1084.93.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-azure-nvidia6.8.0-1014.15UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-gcp5.15.0-1079.88USN-7387-1
Ubuntu:22.04:LTSlinux-gcp5.15.0-1079.88UBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-gcp6.8.0-1028.30UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-gcp-6.11no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1028.30~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-gke5.15.0-1077.83UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-gke5.15.0-1077.83USN-7387-1
Ubuntu:24.04:LTSlinux-gke6.8.0-1023.27UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1062.70USN-7387-1
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1062.70UBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1010.12UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-hwe-6.11no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-58.60~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-ibm5.15.0-1072.75UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-ibm5.15.0-1072.75USN-7387-1
Ubuntu:24.04:LTSlinux-ibm6.8.0-1024.24UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1024.24~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-intel-iot-realtime5.15.0-1073.75UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1075.81UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1075.81USN-7387-1
Ubuntu:22.04:LTSlinux-kvm5.15.0-1076.81UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-135.146UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-135.146USN-7387-1
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-58.60.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-lowlatency-hwe-6.11no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-58.60.1~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1074.75UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1074.75USN-7387-1
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1026.29UBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-nvidia-6.11no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1026.29~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1026.29.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1033.33UBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-nvidia-tegra6.8.0-1008.8UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1021.21UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-oem-6.11no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1026.26UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-oracle5.15.0-1077.83UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-oracle5.15.0-1077.83USN-7387-1
Ubuntu:24.04:LTSlinux-oracle6.8.0-1024.25UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1024.25~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-raspi5.15.0-1074.77UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-raspi5.15.0-1074.77USN-7387-1
Ubuntu:24.04:LTSlinux-raspi6.8.0-1028.32UBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-riscv6.8.0-58.60.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-58.60.1~22.04.1UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-53096
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1017.18UBUNTU-CVE-2024-53096
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1044.48UBUNTU-CVE-2024-53096

Affected products (as reported)

VendorProductVersions
Linux Linux a3c08c021778dad30f69895e378843e9f423d734 – before 43323a4e5b3f8ccc08e2f835abfdc7ee9da8f6ed43bed0a13a5cdbb314d14f28c2bf2c60eb4e6e1e – before 44f48eb9a6051826227bbd375446064fb2a43c6cdeb0f6562884b5b4beb883d73e66a7d3a1b96d99 – before 52c81fd0f5a8bf8032687b94ccf00d13b44cc5c8deb0f6562884b5b4beb883d73e66a7d3a1b96d99 – before bdc136e2b05fabcd780fe5f165d154eb779dfcb0deb0f6562884b5b4beb883d73e66a7d3a1b96d99 – before 5de195060b2e251a835f622759550e62021676416757330b1be5b0606125b65ed50caac69bccf9a566f2ed0172af04a89677ae1898600e1264e258005.10.150 – before 5.10.231
Linux Linux 6.1

References