GHSL-2020-374: Kernel code execution in Qualcomm kgsl driver - CVE-2020-11261
The Qualcomm kgsl driver lacked proper bounds checking when mapping user memory, allowing overlapping memory regions to be mapped. An attacker could exploit this to gain kernel code execution from a userspace application.
When using the IOCTLKGSLMAPUSERMEM ioctl of the kgsl driver with suitable parameters, it will eventually reach kgsliommusetsvmregion [5] (via mapusermemaddr [1] -> kgslsetupuseradd [2] -> kgslsetupanonuseraddr [3] -> kgslmmusetsvmregion [4]).
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the driver only checked if the start and end addresses of the requested range fell inside the global region, but did not check if the entire range overlapped with it, and also lacked a general range check.
Impact
This issue can be exploited to gain kernel code execution from a userspace application.
What the attacker needed
Access to the kgsl driver; ability to call IOCTL_KGSL_MAP_USER_MEM
The fix
The issue was fixed in the January 2021 Android security bulletin.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The kgsl driver manages GPU memory. It failed to check that a requested memory range did not overlap with a special global region. This could let a malicious app take control of the kernel, the core of the operating system.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.