Race condition in ANGLE (CVE-2026-78906)
A logic error in ANGLE's Vulkan backend allows the high-water mark of allocated queue serial indices to regress, causing global sync fences to omit tracking for in-flight GPU work. An attacker could potentially trigger premature fence signalling, leading to race conditions, memory corruption, or information leaks in the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A logic error in ANGLE's Vulkan backend allows the high-water mark of allocated queue serial indices to regress. This can cause global sync fences to omit tracking for in-flight GPU work on higher indices, leading to premature signaling. This failure may result in race conditions, memory corruption, or information leaks in the GPU process.
Affected files:
third_party/angle/src/libANGLE/renderer/vulkan/vk_utils.hthird_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cppthird_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cppthird_party/angle/src/libANGLE/renderer/vulkan/SyncVk.cppui/gl/gl_fence_egl.cc
Estimated timestamp from git blame: 2022-12-05
Root Cause Analysis
The QueueSerialIndexAllocator class in ANGLE's Vulkan backend manages indices used to track queue serials across different contexts and one-off submissions. It maintains a high-water mark of the largest index ever allocated in mLargestIndexEverAllocated. This value is used by synchronization primitives to ensure all potentially in-flight work is accounted for.
In third_party/angle/src/libANGLE/renderer/vulkan/vk_utils.h, the release() method correctly avoids decrementing this value to ensure that synchronization tracking persists for in-flight resources associated with the released index. However, the allocate() method incorrectly recomputes the high-water mark as the maximum of currently allocated indices:
// third_party/angle/src/libANGLE/renderer/vulkan/vk_utils.h
SerialIndex allocate()
{
// ...
SerialIndex index = static_cast<SerialIndex>(mFreeIndexBitSetArray.first());
mFreeIndexBitSetArray.reset(index);
mLargestIndexEverAllocated = (~mFreeIndexBitSetArray).last(); // <--- Logic Error
return index;
}
If a high index (e.g., index 5) is allocated for a one-off submission (via Renderer::queueSubmitOneOff) and then immediately released, mLargestIndexEverAllocated remains 5. However, if a subsequent call to allocate() occurs while index 5 is free but its work is still in-flight on the GPU, and only lower indices (e.g., 0, 1, 2) are currently held, the last() call will return a lower value (e.g., 2), causing the high-water mark to regress.
Impact on Synchronization
This regression directly impacts EGL_SYNC_GLOBAL_FENCE_ANGLE initialization in ContextVk::onSyncObjectInit. The high-water mark is used to determine the range of queue serials the fence must track:
// third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
if (scope == SyncFenceScope::AllContextsToAllContexts)
{
const size_t maxIndex = mRenderer->getLargestQueueSerialIndexEverAllocated();
for (SerialIndex index = 0; index <= maxIndex; ++index)
{
syncHelper->setSerial(index, mRenderer->getLastSubmittedSerial(index));
}
}
If maxIndex has regressed below an index that has in-flight work, that work is omitted from the SyncHelper. Consequently, the global fence may report as signaled while the omitted batch is still executing on the GPU.
Furthermore, this regression affects CommandQueue::isBusy and garbage collection logic, potentially leading to Use-After-Free (UAF) scenarios if ANGLE incorrectly determines the GPU is idle and prematurely recycles resources.
Potential Exploitation Scenario
On Android, where the GPU process is unsandboxed, this vulnerability is particularly severe. An attacker could potentially:
- Trigger a high-index allocation via a one-off GPU operation.
- Submit work that writes to a specific buffer.
- Release the index and trigger an allocation that causes the high-water mark to regress.
- Create a global sync fence and wait for it to signal.
- Because the fence signals prematurely, the attacker could attempt to read from the buffer while the GPU is still writing, leading to cross-origin information leaks, or recycle the buffer while it is in use, leading to memory corruption in the GPU process.
Suggested Fix
The allocate() method should be updated to ensure mLargestIndexEverAllocated only ever increases. Using std::max between the current value and the newly calculated maximum allocated index would resolve the issue:
// In QueueSerialIndexAllocator::allocate()
size_t currentMax = (~mFreeIndexBitSetArray).last();
size_t previousMax = mLargestIndexEverAllocated.load(std::memory_order_relaxed);
while (currentMax > previousMax && !mLargestIndexEverAllocated.compare_exchange_weak(previousMax, currentMax))
{
// Retrying if another thread updated it concurrently
}
Or more simply, since it is protected by mMutex:
mLargestIndexEverAllocated = std::max<size_t>(mLargestIndexEverAllocated, (~mFreeIndexBitSetArray).last());
Evaluated with Chrome root at commit: 1a8d40fc44df2088d5945c0bf53584038aa1614a
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
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 allocate() method recomputes the high-water mark as the maximum of currently allocated indices, allowing it to decrease when a high index is freed while its work is still in flight.
Impact
On Android, where the GPU process is unsandboxed, this could lead to cross-origin information leaks or memory corruption in the GPU process.
What the attacker needed
Android platform; Ability to trigger GPU operations
The fix
The allocate() method should be updated to ensure mLargestIndexEverAllocated only ever increases, for example by using std::max with the current value.
How it was found
- Trigger a high-index allocation via a one-off GPU operation.
- Submit work that writes to a specific buffer.
- Release the index and trigger an allocation that causes the high-water mark to regress.
- Create a global sync fence and wait for it to signal.
- Because the fence signals prematurely, attempt to read from the buffer while the GPU is still writing, or recycle the buffer while it is in use.
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.
This report describes a bug in a graphics component called ANGLE, which helps browsers talk to the GPU. The bug is about a counter that tracks the highest number used for GPU tasks; sometimes the counter goes down when it should only go up. That can make the browser think the GPU has finished work when it hasn't, which could let an attacker read or change data while the GPU is still using it.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.