Type Confusion in GFX (CVE-2026-9117)
A type mismatch in the NativePixmapPlane constructor narrows a size_t offset to an int and then sign-extends it to a huge uint64_t. A compromised video decoder process could craft a frame with a 2 GB offset that survives validation and reaches the Vulkan driver, potentially causing out-of-bounds memory access in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 49 days
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A type mismatch in the NativePixmapPlane constructor causes a size_t offset to be narrowed to an int and then sign-extended to a uint64_t. A compromised video decoder utility process can exploit this to inject a massive 64-bit offset into the Vulkan driver, potentially leading to out-of-bounds memory access in the highly-privileged GPU process.
Affected files:
ui/gfx/native_pixmap_handle.hui/gfx/native_pixmap_handle.ccmedia/gpu/chromeos/native_pixmap_frame_resource.cc
Estimated timestamp from git blame: 2024-03-14
Summary
There is a potential sandbox escape vulnerability originating from a type-casting discrepancy in ui/gfx/native_pixmap_handle.h. The NativePixmapPlane constructor accepts stride and offset as int, but stores them as uint64_t. When a size_t offset is passed into this constructor, values at or above 0x80000000 (2 GB) are narrowed to negative 32-bit integers, and then sign-extended to massive 64-bit integers (~18 Exabytes).
A compromised out-of-process video decoder (OOP-VD) can trigger this by crafting a valid video frame with a 2 GB offset. This sign-extended offset survives validation and is eventually consumed by the Vulkan driver, leading to a potential out-of-bounds memory access in the GPU process.
Root Cause
In ui/gfx/native_pixmap_handle.h:
struct COMPONENT_EXPORT(GFX) NativePixmapPlane {
NativePixmapPlane(int stride, int offset, uint64_t size, /*...*/);
// ...
uint32_t stride;
uint64_t offset;
uint64_t size;
};
In media/gpu/chromeos/native_pixmap_frame_resource.cc, the constructor is called using a size_t from ColorPlaneLayout:
handle.planes.emplace_back(plane.stride, plane.offset, plane.size, std::move(dmabuf_fds[i]));
This implicit narrowing from size_t to int, followed by the internal assignment from int to uint64_t, results in sign-extension.
Potential Exploitation Steps
Note: These are suggested steps based on static analysis; our tooling has not yet executed a live proof-of-concept.
- Compromise OOP-VD: An attacker achieves code execution in the out-of-process video decoder utility process.
- Allocate DMA-BUF: The attacker allocates a large DMA-BUF (e.g., ~2.2 GB) and crafts a
media::mojom::VideoFramewith a plane offset of0x80000000(2 GB). - Mojo Validation Passes: The frame is sent via Mojo to the GPU process. Validation in
video_frame_mojom_traits.ccpasses because0x80000000 + plane.size <= 2.2 GB. - Sign Extension:
NativePixmapFrameResource::Createconstructs aNativePixmapPlane. Thesize_tvalue0x80000000is cast to anint(-2147483648). The constructor assigns thisintto theuint64_tmember, producing0xFFFFFFFF80000000. - Bypass Minigbm Validation: When importing the buffer via
gbm_bo_import(ui/gfx/linux/gbm_wrapper.cc), the0xFFFFFFFF80000000offset is truncated back to a 32-bit integer array (int offsets[4]). This truncation means Minigbm sees0x80000000again, which is a valid offset within the DMA-BUF, so it does not reject the frame. - Vulkan OOB Access: During compositing (
OzoneImageBacking::ProduceVulkan), the clonedNativePixmapHandlewith the0xFFFFFFFF80000000offset is passed togpu/vulkan/vulkan_image_linux.cc. This massive 64-bit value is placed directly into aVkSubresourceLayoutstruct and handed to the Vulkan driver viavkCreateImage. - Impact: The driver uses this corrupted offset to compute memory addresses, leading to a driver-level out-of-bounds memory read/write in the GPU process.
Recommended Fix
Update the constructor of NativePixmapPlane in ui/gfx/native_pixmap_handle.h and ui/gfx/native_pixmap_handle.cc to use uint32_t stride and uint64_t offset parameters, matching the types of its member variables and avoiding arbitrary narrowing/sign-extension.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from 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.
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
The NativePixmapPlane constructor takes an int offset but stores it as uint64_t, so a size_t value of 2 GB or more is narrowed to a negative int and then sign-extended to a huge 64-bit value.
Impact
A compromised video decoder process could potentially cause out-of-bounds memory access in the GPU process, which may lead to a sandbox escape.
What the attacker needed
Compromise of the video decoder process; ability to allocate a large DMA-BUF
The fix
The constructor of NativePixmapPlane should be changed to take a uint64_t offset parameter to match the member variable and avoid narrowing and sign-extension.
How it was found
- Compromise the out-of-process video decoder process.
- Allocate a large DMA-BUF and craft a video frame with a plane offset of 2 GB.
- Send the frame via Mojo to the GPU process, where validation passes.
- The NativePixmapPlane constructor sign-extends the offset to a huge 64-bit value.
- Minigbm validation truncates the offset back to 32 bits and accepts it.
- The huge offset is passed to the Vulkan driver, causing out-of-bounds access.
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 video decoder process is supposed to be less trusted, but it can send frames to the more powerful GPU process. A mistake in how a memory offset is stored lets a malicious decoder send a huge offset that the GPU process does not catch, which could let it read or write memory it should not. This is a sandbox escape because it crosses from a low-privilege process to a high-privilege one.
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.