CVE-2026-99753: drm/loongson: Fix double free on BO initialization failure
In the Linux kernel, the following vulnerability has been resolved:
drm/loongson: Fix double free on BO initialization failure
If ttmboinitvalidate() fails, it drops the buffer object's reference and cleans it up through the supplied destroy callback. lsdcbodestroy() releases the GEM object and frees the enclosing lsdcbo, so freeing it again in lsdcbocreate() causes a double free on a synchronous failure path.
Let TTM own the cleanup after initialization has started and return the error directly. Keep the explicit free on drmgemobjectinit() failure, which occurs before ownership is passed to TTM.
Tested on LS7A2000 by making drmvmaoffsetadd() return -ENOSPC for one selected dumb-buffer creation. The error reached userspace, the destroy callback ran once, and no handle was published or tracked BO retained. Normal buffer creation, zeroing, mapping, readback and release passed.
AI assistance was used for the ownership analysis, fix, fault-injection tools, build and test execution.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 7.3.5-1 - Compensating control
In drm/loongson lsdc_bo_create(), keep the explicit free when drm_gem_object_init() fails before ownership is passed to TTM. Once initialization has started, let TTM clean up through the supplied destroy callback and return the error directly; do not free the buffer object again.
Event History
Frequently Asked Questions
When can the double free occur?
It occurs only when ttm_bo_init_validate() fails after TTM has taken ownership of the buffer object. The affected path is synchronous buffer-object initialization, such as the tested dumb-buffer creation failure induced by drm_vma_offset_add() returning -ENOSPC.
Is a buffer handle or retained buffer object left behind when this failure occurs?
In the tested failure case, the error was returned to userspace, no handle was published, and no tracked buffer object was retained. The destroy callback ran once after the fix.
What behavior distinguishes the fixed cleanup path?
After initialization has started, the caller returns the error directly and lets TTM perform cleanup through the supplied destroy callback. Explicit freeing remains only for drm_gem_object_init() failures, before ownership has passed to TTM.