CVE-2024-39497: drm/shmem-helper: Fix BUG_ON() on mmap(PROT_WRITE, MAP_PRIVATE)
In the Linux kernel, the following vulnerability has been resolved:
drm/shmem-helper: Fix BUGON() on mmap(PROTWRITE, MAPPRIVATE)
Lack of check for copy-on-write (COW) mapping in drmgemshmemmmap allows users to call mmap with PROTWRITE and MAPPRIVATE flag causing a kernel panic due to BUGON in vmfinsertpfnprot: BUGON((vma->vmflags & VMPFNMAP) && iscowmapping(vma->vmflags));
Return -EINVAL early if COW mapping is detected.
This bug affects all drm drivers using default shmem helpers. It can be reproduced by this simple example: void ptr = mmap(0, size, PROTWRITE, MAPPRIVATE, fd, mmapoffset); ptr[0] = 0;
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.6.35 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.9.6 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 6.10 - Upgrade
Upgrade
debian/linuxto 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-1Fixed in 6.12.27-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.129-1~deb11u1 - Compensating control
In drm_gem_shmem_mmap, detect copy-on-write (COW) mappings and return -EINVAL early.
Event History
Frequently Asked Questions
What is the severity of CVE-2024-39497?
CVE-2024-39497 has been classified with a severity level that indicates potentially high impact on system integrity due to improper handling of memory mappings.
How do I fix CVE-2024-39497?
To mitigate CVE-2024-39497, upgrade to the kernel version 6.6.35, 6.9.6, or 6.10 for Red Hat systems, or apply the appropriate updates if you're using Debian systems.
What systems are affected by CVE-2024-39497?
CVE-2024-39497 affects certain versions of the Linux kernel used in both Red Hat and Debian distributions.
What are the potential consequences of CVE-2024-39497?
Exploitation of CVE-2024-39497 could lead to unauthorized modification of memory, potentially compromising system stability and security.
Is there a workaround for CVE-2024-39497?
Currently, there are no known workarounds for CVE-2024-39497, and it is recommended to apply the latest kernel updates to address the vulnerability.