In the Linux kernel, the following vulnerability has been resolved:
drm/shmem-helper: Fix BUGON() on mmap(PROTWRITE, MAP_PRIVATE)
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->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, PROTWRITE, MAPPRIVATE, fd, mmap_offset); ptr[0] = 0;
[
{
"id": "CVE-2024-39497-a017445b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1b4a8b89bf6787090b56424d269bf84ba00c3263",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/drm_gem_shmem_helper.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"256981891397702542449644603109832997629",
"239783900347116232115334741218041114709",
"100355034692269131814304642060327042921"
]
},
"signature_type": "Line"
},
{
"id": "CVE-2024-39497-d4d70c21",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1b4a8b89bf6787090b56424d269bf84ba00c3263",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "drm_gem_shmem_mmap",
"file": "drivers/gpu/drm/drm_gem_shmem_helper.c"
},
"digest": {
"length": 625.0,
"function_hash": "147973357281029195972584045406323337715"
},
"signature_type": "Function"
}
]