Skip to contentSkip to conversation

CVE-2026-99753: drm/loongson: Fix double free on BO initialization failure

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 20

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

drm/loongson: Fix double free on BO initialization failure

If ttm_bo_init_validate() fails, it drops the buffer object's reference and cleans it up through the supplied destroy callback. lsdc_bo_destroy() releases the GEM object and frees the enclosing lsdc_bo, so freeing it again in lsdc_bo_create() 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 drm_gem_object_init() failure, which occurs before ownership is passed to TTM.

Tested on LS7A2000 by making drm_vma_offset_add() 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.

The Linux kernel CVE team has assigned CVE-2026-99753 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.6 with commit f39db26c54281da6a785259498ca74b5e470476f and fixed in 6.12.118 with commit 6ad25544f1dd24ac512e4d03b5613f4d6d40576d
	Issue introduced in 6.6 with commit f39db26c54281da6a785259498ca74b5e470476f and fixed in 6.18.64 with commit dd76e36520a9553a4416412aa114217541218f97
	Issue introduced in 6.6 with commit f39db26c54281da6a785259498ca74b5e470476f and fixed in 7.3.5 with commit c8da4789c0c916fed4d546a2b07423151e5f9d59
	Issue introduced in 6.6 with commit f39db26c54281da6a785259498ca74b5e470476f and fixed in 7.4-rc2 with commit f086dbdeb6e56510e158a853d752c6d8ed9e0674

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-99753

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/gpu/drm/loongson/lsdc_ttm.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/6ad25544f1dd24ac512e4d03b5613f4d6d40576d
	https://git.kernel.org/stable/c/dd76e36520a9553a4416412aa114217541218f97
	https://git.kernel.org/stable/c/c8da4789c0c916fed4d546a2b07423151e5f9d59
	https://git.kernel.org/stable/c/f086dbdeb6e56510e158a853d752c6d8ed9e0674