Use of released resource in GPU (CVE-2026-121256)
A flaw in minigbm's error handling allows a compromised renderer to cause a shared GEM handle to be closed while still in use, leading to handle confusion. An attacker could then alias a victim buffer and leak cross-origin visual information via hardware scanout.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 6 months
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A flaw in minigbm's error handling may allow a compromised renderer to trigger GEM handle confusion in the GPU process. By inducing a partial import failure using a multi-plane format and an invalid FD, an attacker can cause a shared GEM handle to be closed while still in use. This can potentially lead to cross-origin visual information leaks via hardware scanout.
Affected files:
third_party/minigbm/src/drv_helpers.cthird_party/minigbm/src/i915.c
Estimated timestamp from git blame: 2022-10-22
Description
A potential vulnerability in the error handling logic of minigbm allows a compromised renderer process to trigger a Graphics Execution Manager (GEM) handle confusion state in the GPU process.
This occurs because the error path in drv_prime_bo_import (and related backend wrappers like i915_bo_import) calls drv_gem_bo_destroy directly upon failure. This function issues a DRM_IOCTL_GEM_CLOSE ioctl for all successfully imported planes without checking the driver-wide buffer_table reference count. Because GEM handles are not reference-counted by the Linux kernel, the handle is immediately destroyed for that DRM file description.
An attacker can cause a legitimate, shared GEM handle to be closed while it is still actively used by another gbm_bo. When the kernel subsequently reassigns that GEM handle ID to a new buffer (e.g., from a different origin or the browser UI), the attacker's original gbm_bo will alias the victim's buffer.
Root Cause Analysis
In third_party/minigbm/src/drv_helpers.c, drv_prime_bo_import iterates through planes to import FDs into GEM handles:
int drv_prime_bo_import(struct bo *bo, struct drv_import_fd_data *data)
{
// ...
for (plane = 0; plane < bo->meta.num_planes; plane++) {
// ...
ret = drmIoctl(bo->drv->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &prime_handle);
if (ret) {
// ...
bo->meta.num_planes = plane;
drv_gem_bo_destroy(bo); // Bypasses minigbm buffer_table refcount
return -errno;
}
bo->handles[plane].u32 = prime_handle.handle;
}
// ...
}
The intended protection mechanism in minigbm is the buffer_table reference count managed by drv_bo_acquire and drv_bo_release in third_party/minigbm/src/drv.c. However, drv_prime_bo_import is called before drv_bo_acquire is invoked (which only happens on success). On failure, it calls drv_gem_bo_destroy, which unconditionally closes the handles via ioctl. Because the kernel does not refcount GEM handles, the handle is immediately removed from the file description's IDR table.
Potential Attack Vector
A compromised renderer could potentially exploit this by following these suggested steps (note: this is a theoretical sequence based on code analysis; a working PoC has not yet been developed):
- Obtain dma-buf: The attacker requests a valid dma-buf FD (
FD_A) from the GPU process. - Create Valid SharedImage: The attacker sends an IPC to create a valid SharedImage (
S1) usingFD_A.minigbmassigns it GEM handleHand sets itsbuffer_tablerefcount to 1. - Construct Malicious IPC: The attacker crafts a
CreateSharedImageWithBufferIPC specifying a multi-planar format (e.g.,NV12) and aNativePixmapHandlewith two planes:planes[0].fd = FD_Aandplanes[1].fd = FD_B(whereFD_Bis a valid, non-dmabuf file descriptor like aneventfd). - Bypass Validation: The GPU process validates the IPC via
dup(), which succeeds because both FDs are valid file descriptors.gbm_bo_importchecksnum_fds <= num_planes(2 <= 2), which also passes. - Partial Import Failure:
drv_prime_bo_importprocesses the malicious handle.plane = 0succeeds, and the kernel returns the existing handleH.plane = 1fails becauseFD_Bis not a dma-buf. - Handle Closure: The error path executes
drv_gem_bo_destroy, which issuesDRM_IOCTL_GEM_CLOSEon handleH. The kernel immediately destroys the handle. - Dangling State: The import returns
NULL, bypassingdrv_bo_acquire.S1still exists, andminigbm'sbuffer_tableincorrectly thinksHis still valid. - Aliasing & Leak: The GPU process allocates a new victim buffer. The kernel reuses handle ID
H.S1now aliases the victim buffer. The attacker submitsS1for hardware scanout (e.g., via a promoted iframe overlay), causing the display controller to scan out the victim's memory, leaking cross-origin visual information.
Suggested Fix
The cleanup path during a failed import must be aware of handles that are shared with existing, valid gbm_bo objects.
- One approach is to modify
drv_gem_bo_destroyto check the driver'sbuffer_tablebefore callingDRM_IOCTL_GEM_CLOSE. If the handle exists in the table (meaning it's used by another BO), the close should be skipped. - Alternatively,
drv_prime_bo_importshould track whether a handle was newly created or simply resolved from an existing import. Only newly created handles should be closed on failure.
Evaluated with Chrome root at commit: eca8648a4e1cdfdda68c495a6003059fed641955
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Raised in root component due to access or custom field issues on 964076
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 error path in drv_prime_bo_import calls drv_gem_bo_destroy without checking the buffer_table reference count, closing a GEM handle that is still in use.
Impact
A compromised renderer could potentially leak cross-origin visual information via hardware scanout, though a working proof of concept has not yet been developed.
What the attacker needed
Compromised renderer process; ability to send crafted IPC to GPU process
The fix
The cleanup path should check the buffer_table reference count before closing a handle, or track whether a handle was newly created and only close those on failure.
How it was found
- Obtain a valid dma-buf file descriptor from the GPU process.
- Create a valid SharedImage using that file descriptor, which gets a GEM handle.
- Craft an IPC with a multi-plane format and a second invalid file descriptor.
- The GPU process validates the file descriptors and plane count, which pass.
- The first plane import succeeds, but the second fails, triggering the error path.
- The error path closes the shared GEM handle, leaving a dangling reference.
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.
A renderer process (the part of the browser that draws web pages) is not supposed to access memory belonging to other pages. This report describes a bug where a malicious renderer can trick the GPU process into freeing a shared graphics memory handle too early. Later, that handle gets reused for a different buffer, so the attacker's buffer ends up pointing at someone else's screen content, potentially leaking it.
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.