drm/shmem-helper: Fix BUG_ON() on mmap(PROT_WRITE, MAP_PRIVATE)
Lack of check for copy-on-write (COW) mapping in drm_gem_shmem_mmap
allows users to call mmap with PROT_WRITE and MAP_PRIVATE flag
causing a kernel panic due to BUG_ON in vmf_insert_pfn_prot:
BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags));
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, PROT_WRITE, MAP_PRIVATE, fd, mmap_offset);
ptr[0] = 0;
Metrics
Affected Vendors & Products
| Source | ID | Title |
|---|---|---|
Debian DLA |
DLA-4008-1 | linux-6.1 security update |
Debian DLA |
DLA-4075-1 | linux security update |
Ubuntu USN |
USN-6999-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6999-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7004-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7005-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7005-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7008-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7029-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7288-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7288-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7289-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7289-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7289-3 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7289-4 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7291-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7305-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7308-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7331-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7388-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7389-1 | Linux kernel (NVIDIA Tegra) vulnerabilities |
Ubuntu USN |
USN-7390-1 | Linux kernel (Xilinx ZynqMP) vulnerabilities |
Ubuntu USN |
USN-7458-1 | Linux kernel (IBM) vulnerabilities |
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
Mon, 03 Nov 2025 22:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
Mon, 03 Nov 2025 21:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
Wed, 17 Sep 2025 16:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Linux
Linux linux Kernel |
|
| Weaknesses | CWE-617 | |
| CPEs | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.10:rc1:*:*:*:*:*:* |
|
| Vendors & Products |
Linux
Linux linux Kernel |
|
| Metrics |
cvssV3_1
|
cvssV3_1
|
Wed, 13 Nov 2024 02:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Redhat
Redhat enterprise Linux |
|
| CPEs | cpe:/a:redhat:enterprise_linux:9 cpe:/o:redhat:enterprise_linux:9 |
|
| Vendors & Products |
Redhat
Redhat enterprise Linux |
Fri, 08 Nov 2024 16:00:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
Wed, 06 Nov 2024 02:15:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Weaknesses | CWE-825 | |
| Metrics |
cvssV3_1
|
cvssV3_1
|
Tue, 22 Oct 2024 15:15:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
Tue, 22 Oct 2024 14:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| References |
|
Thu, 12 Sep 2024 08:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
Wed, 11 Sep 2024 13:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
Status: PUBLISHED
Assigner: Linux
Published:
Updated: 2025-11-03T21:56:15.676Z
Reserved: 2024-06-25T14:23:23.751Z
Link: CVE-2024-39497
Updated: 2025-11-03T20:38:18.392Z
Status : Modified
Published: 2024-07-12T13:15:12.320
Modified: 2025-11-03T22:17:05.260
Link: CVE-2024-39497
OpenCVE Enrichment
No data.
Debian DLA
Ubuntu USN