Use after free in Dawn (CVE-2024-9120)
A WebGPU shader written in WGSL is translated by Chromium's Dawn layer into HLSL and then compiled by the bundled DXC compiler, where a use-after-free occurs in the DxilConditionalMem2Reg pass. Opening a crafted HTML page on Windows with the D3D12 backend crashes the GPU process.
- Fix shipped in 17 days
VULNERABILITY DETAILS
Chromium translates wgsl shaders via tint to an OS-specific shader format. On Windows, the OS-specific file format is hlsl, processed in dxcompiler.dll. When compiling chrome-generated hlsl files, this triggers an UAF inside the hlsl compiler.
VERSION
Chrome Version: Pre-compiled ASAN Chromium 130.0.6706.0 (Developer Build) (64-bit)
Operating System: Win11 Build 22631
REPRODUCTION CASE
Attached is a .html file containing a WebGPU shader. Opening the html file (on windows with the D3D12 backend) crashes the GPU process. The corresponding ASAN crash is generated:
[10524:6416:0908/153414.580:WARNING:chrome_main_delegate.cc(743)] This is Chrome version 130.0.6706.0 (not a warning)
[10524:14008:0908/153414.764:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
=================================================================
==2848==ERROR: AddressSanitizer: heap-use-after-free on address 0x1219260ecfe8 at pc 0x7ffbe7f647d7 bp 0x0065eb7fbb80 sp 0x0065eb7fbbc8
READ of size 8 at 0x1219260ecfe8 thread T0
==2848==WARNING: Failed to use and restart external symbolizer!
==2848==*** WARNING: Failed to initialize DbgHelp! ***
==2848==*** Most likely this means that the app is already ***
==2848==*** using DbgHelp, possibly with incompatible flags. ***
==2848==*** Due to technical reasons, symbolization might crash ***
==2848==*** or produce wrong results. ***
#0 0x7ffbe7f647d6 in DxilConditionalMem2Reg::ScalarizePreciseVectorAlloca C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\DxilConditionalMem2Reg.cpp:275
#1 0x7ffbe7f5f696 in DxilConditionalMem2Reg::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\DxilConditionalMem2Reg.cpp:503
#2 0x7ffbe6c50229 in llvm::FPPassManager::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1587
#3 0x7ffbe6c50dbe in llvm::FPPassManager::runOnModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1609
#4 0x7ffbe6c51ded in llvm::legacy::PassManagerImpl::run C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1771
#5 0x7ffbe6c5b8ec in clang::EmitBackendOutput C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\BackendUtil.cpp:783
#6 0x7ffbe65c55fb in clang::BackendConsumer::HandleTranslationUnit C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:192
#7 0x7ffbe6d9b9d1 in clang::ParseAST C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Parse\ParseAST.cpp:164
#8 0x7ffbe65bff31 in clang::CodeGenAction::ExecuteAction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:808
#9 0x7ffbe65ce64c in clang::FrontendAction::Execute C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Frontend\FrontendAction.cpp:455
#10 0x7ffbe64a8030 in DxcCompiler::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\tools\dxcompiler\dxcompilerobj.cpp:974
#11 0x7ffbef15e3b7 in dawn::native::d3d::CompileShader C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d\ShaderUtils.cpp:370
#12 0x7ffbef1c9669 in dawn::native::LoadOrRun<dawn::Result<dawn::native::d3d::CompiledShader,dawn::native::ErrorData> (*)(dawn::native::Blob),dawn::Result<dawn::native::d3d::CompiledShader,dawn::native::ErrorData> (*)(dawn::native::d3d::D3DCompilationRequest)> C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\CacheRequest.h:154
#13 0x7ffbef275291 in dawn::native::d3d12::ShaderModule::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ShaderModuleD3D12.cpp:385
#14 0x7ffbef25f723 in dawn::native::d3d12::RenderPipeline::InitializeImpl C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\RenderPipelineD3D12.cpp:365
#15 0x7ffbef06aaa0 in dawn::native::PipelineBase::Initialize C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Pipeline.cpp:371
#16 0x7ffbeefb9c9b in dawn::native::DeviceBase::CreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:2244
#17 0x7ffbeefb9687 in dawn::native::DeviceBase::APICreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1556
#18 0x7ffc1352037d in dawn::wire::server::Server::DoDeviceCreateRenderPipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerDoers_autogen.cpp:469
#19 0x7ffc12f0ee64 in dawn::wire::server::Server::HandleDeviceCreateRenderPipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerHandlers_autogen.cpp:716
#20 0x7ffc12f1574c in dawn::wire::server::Server::HandleCommandsImpl C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerHandlers_autogen.cpp:2056
#21 0x7ffc0f0cd552 in gpu::webgpu::`anonymous namespace'::DawnWireServer::HandleCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1043
#22 0x7ffc0f0cd9b2 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::HandleDawnCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1950
#23 0x7ffc0f0c1901 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::DoCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1895
#24 0x7ffc02e07ac3 in gpu::CommandBufferService::Flush C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\command_buffer_service.cc:263
#25 0x7ffbfed3401a in gpu::CommandBufferStub::OnAsyncFlush C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\command_buffer_stub.cc:497
#26 0x7ffbfed32f0f in gpu::CommandBufferStub::ExecuteDeferredRequest C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\command_buffer_stub.cc:153
#27 0x7ffc02e25d7e in gpu::GpuChannel::ExecuteDeferredRequest C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\gpu_channel.cc:942
#28 0x7ffc02e36fa0 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::GpuChannel::*&&)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate *),base::WeakPtr<gpu::GpuChannel> &&,mojo::StructPtr<gpu::mojom::DeferredRequestParams> &&>,base::internal::BindState<1,1,0,void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>, gpu::FenceSyncReleaseDelegate *),base::WeakPtr<gpu::GpuChannel>,mojo::StructPtr<gpu::mojom::DeferredRequestParams> >,void (gpu::FenceSyncReleaseDelegate *)>::RunOnce C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h:980
#29 0x7ffc02408811 in base::internal::Invoker<base::internal::FunctorTraits<base::OnceCallback<void (gpu::FenceSyncReleaseDelegate *)> &&,gpu::FenceSyncReleaseDelegate *>,base::internal::BindState<0,1,1,base::OnceCallback<void (gpu::FenceSyncReleaseDelegate *)>,base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate,base::unretained_traits::MayNotDangle,0> >,void ()>::RunImpl<base::OnceCallback<void (gpu::FenceSyncReleaseDelegate *)>,std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::FenceSyncReleaseDelegate,base::unretained_traits::MayNotDangle,0> >,0> C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h:1067
#30 0x7ffbfe034a03 in gpu::Scheduler::ExecuteSequence C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler.cc:667
#31 0x7ffbfe032735 in gpu::Scheduler::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler.cc:591
#32 0x7ffbfe035378 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::Scheduler::Sequence::*const &)(),gpu::Scheduler::Sequence *>,base::internal::BindState<1,1,0,void (gpu::Scheduler::Sequence::*)(),base::internal::UnretainedWrapper<gpu::Scheduler::Sequence,base::unretained_traits::MayNotDangle,0> >,void ()>::Run C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h:987
#33 0x7ffbfc9b6ec0 in base::TaskAnnotator::RunTaskImpl C:\b\s\w\ir\cache\builder\src\base\task\common\task_annotator.cc:203
#34 0x7ffc010d445d in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:470
#35 0x7ffc010d3209 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:332
#36 0x7ffc01117c5e in base::MessagePumpDefault::Run C:\b\s\w\ir\cache\builder\src\base\message_loop\message_pump_default.cc:40
#37 0x7ffc010d612f in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run C:\b\s\w\ir\cache\builder\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:640
#38 0x7ffbfca1106e in base::RunLoop::Run C:\b\s\w\ir\cache\builder\src\base\run_loop.cc:134
#39 0x7ffc0004412b in content::GpuMain C:\b\s\w\ir\cache\builder\src\content\gpu\gpu_main.cc:434
#40 0x7ffbfade7271 in content::RunOtherNamedProcessTypeMain C:\b\s\w\ir\cache\builder\src\content\app\content_main_runner_impl.cc:795
#41 0x7ffbfade94cf in content::ContentMainRunnerImpl::Run C:\b\s\w\ir\cache\builder\src\content\app\content_main_runner_impl.cc:1160
#42 0x7ffbfadddad5 in content::RunContentProcess C:\b\s\w\ir\cache\builder\src\content\app\content_main.cc:356
#43 0x7ffbfadde67d in content::ContentMain C:\b\s\w\ir\cache\builder\src\content\app\content_main.cc:369
#44 0x7ffbec7216b0 in ChromeMain C:\b\s\w\ir\cache\builder\src\chrome\app\chrome_main.cc:231
#45 0x7ff7d48743ed in MainDllLoader::Launch C:\b\s\w\ir\cache\builder\src\chrome\app\main_dll_loader_win.cc:201
#46 0x7ff7d487200c in main C:\b\s\w\ir\cache\builder\src\chrome\app\chrome_exe_main_win.cc:351
#47 0x7ff7d4c968cb in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
#48 0x7ffc8fef257c in BaseThreadInitThunk+0x1c (C:\Windows\System32\KERNEL32.DLL+0x18001257c)
#49 0x7ffc90f4af27 in RtlUserThreadStart+0x27 (C:\Windows\SYSTEM32\ntdll.dll+0x18005af27)
0x1219260ecfe8 is located 72 bytes inside of 96-byte region [0x1219260ecfa0,0x1219260ed000)
freed by thread T0 here:
#0 0x7ff7d495181d in free C:\b\s\w\ir\cache\builder\src\third_party\llvm\compiler-rt\lib\asan\asan_malloc_win.cpp:82
#1 0x7ffbe688c71b in llvm::ICmpInst::~ICmpInst C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\include\llvm\IR\Instructions.h:1093
#2 0x7ffbe7b70df2 in llvm::Instruction::eraseFromParent C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\Instruction.cpp:71
#3 0x7ffbe7f63ebe in DxilConditionalMem2Reg::ScalarizePreciseVectorAlloca C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\DxilConditionalMem2Reg.cpp:325
#4 0x7ffbe7f5f696 in DxilConditionalMem2Reg::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\DxilConditionalMem2Reg.cpp:503
#5 0x7ffbe6c50229 in llvm::FPPassManager::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1587
#6 0x7ffbe6c50dbe in llvm::FPPassManager::runOnModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1609
#7 0x7ffbe6c51ded in llvm::legacy::PassManagerImpl::run C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1771
#8 0x7ffbe6c5b8ec in clang::EmitBackendOutput C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\BackendUtil.cpp:783
#9 0x7ffbe65c55fb in clang::BackendConsumer::HandleTranslationUnit C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:192
#10 0x7ffbe6d9b9d1 in clang::ParseAST C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Parse\ParseAST.cpp:164
#11 0x7ffbe65bff31 in clang::CodeGenAction::ExecuteAction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:808
#12 0x7ffbe65ce64c in clang::FrontendAction::Execute C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Frontend\FrontendAction.cpp:455
#13 0x7ffbe64a8030 in DxcCompiler::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\tools\dxcompiler\dxcompilerobj.cpp:974
#14 0x7ffbef15e3b7 in dawn::native::d3d::CompileShader C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d\ShaderUtils.cpp:370
#15 0x7ffbef1c9669 in dawn::native::LoadOrRun<dawn::Result<dawn::native::d3d::CompiledShader,dawn::native::ErrorData> (*)(dawn::native::Blob),dawn::Result<dawn::native::d3d::CompiledShader,dawn::native::ErrorData> (*)(dawn::native::d3d::D3DCompilationRequest)> C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\CacheRequest.h:154
#16 0x7ffbef275291 in dawn::native::d3d12::ShaderModule::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ShaderModuleD3D12.cpp:385
#17 0x7ffbef25f723 in dawn::native::d3d12::RenderPipeline::InitializeImpl C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\RenderPipelineD3D12.cpp:365
#18 0x7ffbef06aaa0 in dawn::native::PipelineBase::Initialize C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Pipeline.cpp:371
#19 0x7ffbeefb9c9b in dawn::native::DeviceBase::CreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:2244
#20 0x7ffbeefb9687 in dawn::native::DeviceBase::APICreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1556
#21 0x7ffc1352037d in dawn::wire::server::Server::DoDeviceCreateRenderPipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerDoers_autogen.cpp:469
#22 0x7ffc12f0ee64 in dawn::wire::server::Server::HandleDeviceCreateRenderPipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerHandlers_autogen.cpp:716
#23 0x7ffc12f1574c in dawn::wire::server::Server::HandleCommandsImpl C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerHandlers_autogen.cpp:2056
#24 0x7ffc0f0cd552 in gpu::webgpu::`anonymous namespace'::DawnWireServer::HandleCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1043
#25 0x7ffc0f0cd9b2 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::HandleDawnCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1950
#26 0x7ffc0f0c1901 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::DoCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1895
#27 0x7ffc02e07ac3 in gpu::CommandBufferService::Flush C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\command_buffer_service.cc:263
previously allocated by thread T0 here:
#0 0x7ff7d495191d in malloc C:\b\s\w\ir\cache\builder\src\third_party\llvm\compiler-rt\lib\asan\asan_malloc_win.cpp:98
#1 0x7ffbe943d62e in operator new D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp:36
#2 0x7ffbe7da3506 in llvm::User::operator new C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\User.cpp:96
#3 0x7ffbe7b601cb in llvm::CastInst::Create C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\Instructions.cpp:2271
#4 0x7ffbe688c942 in llvm::IRBuilder<1,llvm::ConstantFolder,llvm::IRBuilderDefaultInserter<1> >::CreateCast C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\include\llvm\IR\IRBuilder.h:1336
#5 0x7ffbe7e75dfc in `anonymous namespace'::SROA_Helper::RewriteForScalarRepl C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\ScalarReplAggregatesHLSL.cpp:2899
#6 0x7ffbe7e658d7 in `anonymous namespace'::SROA_Helper::DoScalarReplacement C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\ScalarReplAggregatesHLSL.cpp:3060
#7 0x7ffbe7e48bca in `anonymous namespace'::SROAGlobalAndAllocas C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\ScalarReplAggregatesHLSL.cpp:1879
#8 0x7ffbe7e34ba1 in `anonymous namespace'::SROA_Parameter_HLSL::runOnModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\ScalarReplAggregatesHLSL.cpp:4372
#9 0x7ffbe6c51ded in llvm::legacy::PassManagerImpl::run C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1771
#10 0x7ffbe6c5b8ec in clang::EmitBackendOutput C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\BackendUtil.cpp:783
#11 0x7ffbe65c55fb in clang::BackendConsumer::HandleTranslationUnit C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:192
#12 0x7ffbe6d9b9d1 in clang::ParseAST C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Parse\ParseAST.cpp:164
#13 0x7ffbe65bff31 in clang::CodeGenAction::ExecuteAction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:808
#14 0x7ffbe65ce64c in clang::FrontendAction::Execute C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Frontend\FrontendAction.cpp:455
#15 0x7ffbe64a8030 in DxcCompiler::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\tools\dxcompiler\dxcompilerobj.cpp:974
#16 0x7ffbef15e3b7 in dawn::native::d3d::CompileShader C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d\ShaderUtils.cpp:370
#17 0x7ffbef1c9669 in dawn::native::LoadOrRun<dawn::Result<dawn::native::d3d::CompiledShader,dawn::native::ErrorData> (*)(dawn::native::Blob),dawn::Result<dawn::native::d3d::CompiledShader,dawn::native::ErrorData> (*)(dawn::native::d3d::D3DCompilationRequest)> C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\CacheRequest.h:154
#18 0x7ffbef275291 in dawn::native::d3d12::ShaderModule::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ShaderModuleD3D12.cpp:385
#19 0x7ffbef25f723 in dawn::native::d3d12::RenderPipeline::InitializeImpl C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\RenderPipelineD3D12.cpp:365
#20 0x7ffbef06aaa0 in dawn::native::PipelineBase::Initialize C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Pipeline.cpp:371
#21 0x7ffbeefb9c9b in dawn::native::DeviceBase::CreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:2244
#22 0x7ffbeefb9687 in dawn::native::DeviceBase::APICreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1556
#23 0x7ffc1352037d in dawn::wire::server::Server::DoDeviceCreateRenderPipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerDoers_autogen.cpp:469
#24 0x7ffc12f0ee64 in dawn::wire::server::Server::HandleDeviceCreateRenderPipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerHandlers_autogen.cpp:716
#25 0x7ffc12f1574c in dawn::wire::server::Server::HandleCommandsImpl C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerHandlers_autogen.cpp:2056
#26 0x7ffc0f0cd552 in gpu::webgpu::`anonymous namespace'::DawnWireServer::HandleCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1043
#27 0x7ffc0f0cd9b2 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::HandleDawnCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1950
SUMMARY: AddressSanitizer: heap-use-after-free C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\DxilConditionalMem2Reg.cpp:275 in DxilConditionalMem2Reg::ScalarizePreciseVectorAlloca
Shadow bytes around the buggy address:
0x1219260ecd00: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fd
0x1219260ecd80: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fd
0x1219260ece00: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fd
0x1219260ece80: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fd
0x1219260ecf00: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fd
=>0x1219260ecf80: fa fa f7 fa fd fd fd fd fd fd fd fd fd[fd]fd fd
0x1219260ed000: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fd
0x1219260ed080: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fd
0x1219260ed100: fa fa f7 fa 00 00 00 00 00 00 00 00 00 00 00 00
0x1219260ed180: fa fa f7 fa 00 00 00 00 00 00 00 00 00 00 00 00
0x1219260ed200: fa fa f7 fa 00 00 00 00 00 00 00 00 00 00 00 00
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
==2848==ADDITIONAL INFO
==2848==Note: Please include this section with the ASan report.
Task trace:
#0 0x7ffbfe032c9c in gpu::Scheduler::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler.cc:607
#1 0x7ffbfe02e295 in gpu::Scheduler::TryScheduleSequence C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler.cc:409
Command line: `"C:\Users\user\Desktop\chrome\chrome.exe" --type=gpu-process --string-annotations=is-enterprise-managed=no --no-pre-read-main-dll --start-stack-profiler --gpu-preferences=UAAAAAAAAADgAAAEAAAAAAAAAAAAAAAAAABgAAMAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAA --metrics-shmem-handle=1960,i,9350606658359399770,7748648325109262653,262144 --field-trial-handle=2072,i,9048101244650392040,14828032373139287594,262144 --variations-seed-version --enable-logging=handle --log-file=2076 --mojo-platform-channel-handle=1904 /prefetch:2`
MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.
Refer to https://chromium.googlesource.com/chromium/src/+/main/base/memory/raw_ptr.md for details.
==2848==END OF ADDITIONAL INFO
==2848==ABORTING
[10524:6416:0908/153811.998:ERROR:gpu_process_host.cc(982)] GPU process exited unexpectedly: exit_code=1
[10524:6416:0908/153811.998:WARNING:gpu_process_host.cc(1416)] The GPU process has crashed 1 time(s)
Reproducing the issue stand-alone on Linux also possible:
- Compile the standalone.wgsl with tint (commit 40cf7fd7bc06f871fc5e482338dffa3a8ba3acfb) to hlsl via
./tint standalone.wgsl -o standalone.hlsl. I also attached standalone.hlsl, but you should get the very same file when compiling standalone.wgsl yourself - Compile the hlsl with dxc (commit 937c8c88112398b0628c53c1ca4148954a11f7fd):
./dxc-3.7 standalone.hlsl -T vs_6_2 -opt-disable structurize-loop-exits-for-unroll -HV 2018.
Attached:
- html that triggers an ASAN violation in chromium
- standalone.wgsl for producing the hlsl shader
- standalone.hlsl for reproducing the crash in dxc
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 a use-after-free in the DXC scalarisation pass, where an instruction is erased and then still referenced during the same transformation.
Impact
A crafted web page could crash the browser's GPU process on Windows; the report does not claim memory corruption outside the GPU process or code execution.
What the attacker needed
Windows with D3D12 backend; Victim opens a crafted HTML page
How it was found
- Open the attached HTML file containing a WebGPU shader in Chromium on Windows with the D3D12 backend.
- Observe the GPU process crash and the ASAN heap-use-after-free report.
- Alternatively, compile the standalone WGSL shader to HLSL with tint.
- Compile the resulting HLSL with dxc using the vertex shader target and the given options to reproduce the crash standalone.
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 web page can ask the browser to run small programs on the graphics card, called shaders. The browser translates these into another language before handing them to a compiler, and a bug in that compiler makes it read memory it has already released, which crashes the graphics process. The page itself does not gain code execution in this report; the visible effect is a crash.
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.