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 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;
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.229, 5.15.169, 6.1.114, 6.6.35, 6.9.6
- CVEs
- CVE-2024-39497
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 08:05 UTC · Revision 1
Source evidence
drm/shmem-helper: Fix BUG_ON() on mmap(PROT_WRITE, MAP_PRIVATE)
core-osv · Original sourcePublished 12 Jul 2024, 12:20 UTC
In the Linux kernel, the following vulnerability has been resolved: 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;
osv:CVE-2024-39497
Kernel
Fixed versions: 5.10.229, 5.15.169, 6.1.114, 6.6.35, 6.9.6
Complete source record
{
"id": "d9ecbfa72a6d20ced03514f767584d9ef308aba33cb1bc4108b6d594452df24a",
"url": "https://osv.dev/vulnerability/CVE-2024-39497",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "drm/shmem-helper: Fix BUG_ON() on mmap(PROT_WRITE, MAP_PRIVATE)",
"summary": "In the Linux kernel, the following vulnerability has been resolved: 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;",
"evidence": "osv:CVE-2024-39497",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.10.229",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.169",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.114",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.35",
"evidence": "/affected/1/ranges"
},
{
"value": "6.9.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2024-39497",
"aliases": [
"CVE-2024-39497"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "2194a63a818db71065ebe09c8104f5f021ca4e7b"
},
{
"fixed": "a508a102edf8735adc9bb73d37dd13c38d1a1b10"
},
{
"fixed": "3ae63a8c1685e16958560ec08d30defdc5b9cca0"
},
{
"fixed": "2219e5f97244b79c276751a1167615b9714db1b0"
},
{
"fixed": "1b4a8b89bf6787090b56424d269bf84ba00c3263"
},
{
"fixed": "03c71c42809ef4b17f5d874cdb2d3bf40e847b86"
},
{
"fixed": "39bc27bd688066a63e56f7f64ad34fae03fbe3b8"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-39497.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.2.0"
},
{
"fixed": "5.10.229"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.169"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.114"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.35"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.9.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-39497.json"
}
}
],
"modified": "2026-10-28T02:30:27.181774066Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/03c71c42809ef4b17f5d874cdb2d3bf40e847b86",
"https://git.kernel.org/stable/c/1b4a8b89bf6787090b56424d269bf84ba00c3263",
"https://git.kernel.org/stable/c/2219e5f97244b79c276751a1167615b9714db1b0",
"https://git.kernel.org/stable/c/39bc27bd688066a63e56f7f64ad34fae03fbe3b8",
"https://git.kernel.org/stable/c/3ae63a8c1685e16958560ec08d30defdc5b9cca0",
"https://git.kernel.org/stable/c/a508a102edf8735adc9bb73d37dd13c38d1a1b10",
"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html",
"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/39xxx/CVE-2024-39497.json",
"https://nvd.nist.gov/vuln/detail/CVE-2024-39497",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/39xxx/CVE-2024-39497.json"
}
},
"related_cves": [
{
"value": "CVE-2024-39497",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 493616,
"published_at": "2024-07-12T12:20:32.33+00:00"
}