Use after free in Dawn (CVE-2024-5494)
A heap use-after-free occurs in the DirectX shader compiler (dxcompiler.dll) when compiling HLSL shaders generated from WebGPU WGSL shaders. An attacker could crash the GPU process by supplying a crafted shader.
- Fix shipped in 30 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 might trigger a heap UAF insider the hlsl compiler.
VERSION
Chrome Version: Pre-compiled ASAN Chromium 126.0.6451.0 (Developer Build) (64-bit)
Operating System: Win11 Build 22631.2861
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. Note that the shader compiler only crashes if the DirectX back-end supports shader model 6.6. Inspecting the shader model is possible with a Microsoft tool called dxcapsviewer. The UI on my machine shows:
NVIDIA GeForce RTX 3090
Direct3D 12
Shader Model 6.6
Reproducing the issue stand-alone on Linux also possible.
- Compile the standalone.wgsl with tint (commit 1488c9c94dea5d9bb158870717ebaf2f7d161f57) 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 e7b78ff9c99c19a6a0c98256db9794e0af4eb59d):
./dxc-3.7 standalone.hlsl -T ps_6_6. This should trigger an ASAN violation.
Attached:
- html that should trigger an ASAN violation in chromium (if the native back-end support shader-model 6.6)
- wgsl for producing the hlsl shader
- the hlsl shader
- asan log file
[12752:12836:0501/004239.044:WARNING:chrome_main_delegate.cc(742)] This is Chrome version 126.0.6451.0 (not a warning)
[12752:1904:0501/004239.185:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[12752:12836:0501/004239.216:INFO:chrome_browser_cloud_management_controller.cc(161)] Cloud management controller initialization aborted as CBCM is not enabled. Please use the `--enable-chrome-browser-cloud-management` command line flag to enable it if you are not using the official Google Chrome build.
[12752:4804:0501/004239.216:ERROR:sandbox_win.cc(911)] Sandbox cannot access executable. Check filesystem permissions are valid. See https://bit.ly/31yqMJR.: Access is denied. (0x5)
[12752:12836:0501/004239.342:WARNING:account_consistency_mode_manager.cc(77)] Desktop Identity Consistency cannot be enabled as no OAuth client ID and client secret have been configured.
[12752:12836:0501/004239.514:WARNING:browser_management_service.cc(128)] EnterpriseLogoUrl fetch failed with error code -1 and MIME type
[12752:12836:0501/004240.346:ERROR:network_service_instance_impl.cc(600)] Network service crashed, restarting service.
[12752:12836:0501/004240.393:WARNING:external_registry_loader_win.cc(232)] Error observing HKLM: 5
[13516:13424:0501/004240.455:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[12752:1904:0501/004244.189:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[13516:2924:0501/004245.468:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[12752:12836:0501/004247.307:INFO:CONSOLE(20)] "[object GPUDevice]", source: file:///E:/indexDIXLUaf.html (20)
[12752:12836:0501/004247.308:INFO:CONSOLE(100)] "[object GPURenderPipeline]", source: file:///E:/indexDIXLUaf.html (100)
=================================================================
==13136==ERROR: AddressSanitizer: heap-use-after-free on address 0x11b2604971e8 at pc 0x7ffe0390e43e bp 0x002f8d7fbdd0 sp 0x002f8d7fbe18
READ of size 8 at 0x11b2604971e8 thread T0
==13136==WARNING: Failed to use and restart external symbolizer!
==13136==*** WARNING: Failed to initialize DbgHelp! ***
==13136==*** Most likely this means that the app is already ***
==13136==*** using DbgHelp, possibly with incompatible flags. ***
==13136==*** Due to technical reasons, symbolization might crash ***
==13136==*** or produce wrong results. ***
#0 0x7ffe0390e43d in llvm::BasicBlock::getTerminator C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\BasicBlock.cpp:131
#1 0x7ffe03c1c353 in llvm::DxilValueCache::ProcessValue C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Analysis\DxilValueCache.cpp:555
#2 0x7ffe03c1d50e in llvm::DxilValueCache::GetConstValue C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Analysis\DxilValueCache.cpp:488
#3 0x7ffe03c09c51 in `anonymous namespace'::DxilRemoveDeadBlocks::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\DxilRemoveDeadBlocks.cpp:371
#4 0x7ffe02a77cb4 in llvm::FPPassManager::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1587
#5 0x7ffe02a7874e in llvm::FPPassManager::runOnModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1609
#6 0x7ffe02a79405 in llvm::legacy::PassManagerImpl::run C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1771
#7 0x7ffe02a8272c in clang::EmitBackendOutput C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\BackendUtil.cpp:779
#8 0x7ffe02490811 in clang::BackendConsumer::HandleTranslationUnit C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:191
#9 0x7ffe02bae191 in clang::ParseAST C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Parse\ParseAST.cpp:164
#10 0x7ffe0248b502 in clang::CodeGenAction::ExecuteAction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:807
#11 0x7ffe02498cd3 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
#12 0x7ffe02376b05 in DxcCompiler::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\tools\dxcompiler\dxcompilerobj.cpp:982
#13 0x7ffe096c9405 in dawn::native::d3d::CompileShader C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d\ShaderUtils.cpp:355
#14 0x7ffe0972930e 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
#15 0x7ffe097d0b54 in dawn::native::d3d12::ShaderModule::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ShaderModuleD3D12.cpp:378
#16 0x7ffe097ba563 in dawn::native::d3d12::RenderPipeline::InitializeImpl C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\RenderPipelineD3D12.cpp:385
#17 0x7ffe095dfc30 in dawn::native::PipelineBase::Initialize C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Pipeline.cpp:371
#18 0x7ffe095346b1 in dawn::native::DeviceBase::CreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:2125
#19 0x7ffe09534097 in dawn::native::DeviceBase::APICreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1456
#20 0x7ffe2b8cd30d 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:314
#21 0x7ffe2b2d54c4 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:606
#22 0x7ffe2b2da371 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:1682
#23 0x7ffe26f5f7b2 in gpu::webgpu::`anonymous namespace'::DawnWireServer::HandleCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:982
#24 0x7ffe26f5fc05 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::HandleDawnCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1880
#25 0x7ffe26f54021 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::DoCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1825
#26 0x7ffe1ac76013 in gpu::CommandBufferService::Flush C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\command_buffer_service.cc:232
#27 0x7ffe177dcbcc in gpu::CommandBufferStub::OnAsyncFlush C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\command_buffer_stub.cc:506
#28 0x7ffe177db673 in gpu::CommandBufferStub::ExecuteDeferredRequest C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\command_buffer_stub.cc:154
#29 0x7ffe1ac93e4a in gpu::GpuChannel::ExecuteDeferredRequest C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\gpu_channel.cc:895
#30 0x7ffe1aca414a in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::GpuChannel::*&&)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>),base::WeakPtr<gpu::GpuChannel> &&,mojo::StructPtr<gpu::mojom::DeferredRequestParams> &&>,base::internal::BindState<1,1,0,void (gpu::GpuChannel::*)(mojo::StructPtr<gpu::mojom::DeferredRequestParams>),base::WeakPtr<gpu::GpuChannel>,mojo::StructPtr<gpu::mojom::DeferredRequestParams> >,void ()>::RunOnce C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h:980
#31 0x7ffe1a2965dd in gpu::SchedulerDfs::ExecuteSequence C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:743
#32 0x7ffe1a294938 in gpu::SchedulerDfs::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:668
#33 0x7ffe1a297c68 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::SchedulerDfs::*&&)(),gpu::SchedulerDfs *>,base::internal::BindState<1,1,0,void (gpu::SchedulerDfs::*)(),base::internal::UnretainedWrapper<gpu::SchedulerDfs,base::unretained_traits::MayNotDangle,0> >,void ()>::RunOnce C:\b\s\w\ir\cache\builder\src\base\functional\bind_internal.h:980
#34 0x7ffe156cca20 in base::TaskAnnotator::RunTaskImpl C:\b\s\w\ir\cache\builder\src\base\task\common\task_annotator.cc:203
#35 0x7ffe190b6c66 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:473
#36 0x7ffe190b5b89 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:338
#37 0x7ffe190ea37e in base::MessagePumpDefault::Run C:\b\s\w\ir\cache\builder\src\base\message_loop\message_pump_default.cc:40
#38 0x7ffe190b88ac 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:645
#39 0x7ffe15716f30 in base::RunLoop::Run C:\b\s\w\ir\cache\builder\src\base\run_loop.cc:134
#40 0x7ffe1857c71b in content::GpuMain C:\b\s\w\ir\cache\builder\src\content\gpu\gpu_main.cc:437
#41 0x7ffe13fbf5d2 in content::RunOtherNamedProcessTypeMain C:\b\s\w\ir\cache\builder\src\content\app\content_main_runner_impl.cc:773
#42 0x7ffe13fc1b53 in content::ContentMainRunnerImpl::Run C:\b\s\w\ir\cache\builder\src\content\app\content_main_runner_impl.cc:1155
#43 0x7ffe13fbd56d in content::RunContentProcess C:\b\s\w\ir\cache\builder\src\content\app\content_main.cc:332
#44 0x7ffe13fbe05d in content::ContentMain C:\b\s\w\ir\cache\builder\src\content\app\content_main.cc:345
#45 0x7ffe070016b1 in ChromeMain C:\b\s\w\ir\cache\builder\src\chrome\app\chrome_main.cc:192
#46 0x7ff6f58843a5 in MainDllLoader::Launch C:\b\s\w\ir\cache\builder\src\chrome\app\main_dll_loader_win.cc:181
#47 0x7ff6f5881db2 in main C:\b\s\w\ir\cache\builder\src\chrome\app\chrome_exe_main_win.cc:350
#48 0x7ff6f5c5d943 in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
#49 0x7ffe9237257c in BaseThreadInitThunk+0x1c (C:\Windows\System32\KERNEL32.DLL+0x18001257c)
#50 0x7ffe92e0aa57 in RtlUserThreadStart+0x27 (C:\Windows\SYSTEM32\ntdll.dll+0x18005aa57)
0x11b2604971e8 is located 72 bytes inside of 88-byte region [0x11b2604971a0,0x11b2604971f8)
freed by thread T0 here:
#0 0x7ff6f595ca0d in free C:\b\s\w\ir\cache\builder\src\third_party\llvm\compiler-rt\lib\asan\asan_malloc_win.cpp:82
#1 0x7ffe039114cb in llvm::BasicBlock::~BasicBlock C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\BasicBlock.cpp:70
#2 0x7ffe0390dfb8 in llvm::BasicBlock::eraseFromParent C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\BasicBlock.cpp:104
#3 0x7ffe03c082fb in DeadBlockDeleter::Run C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\DxilRemoveDeadBlocks.cpp:188
#4 0x7ffe03c096e8 in `anonymous namespace'::DxilRemoveDeadBlocks::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\DxilRemoveDeadBlocks.cpp:370
#5 0x7ffe02a77cb4 in llvm::FPPassManager::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1587
#6 0x7ffe02a7874e in llvm::FPPassManager::runOnModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1609
#7 0x7ffe02a79405 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 0x7ffe02a8272c in clang::EmitBackendOutput C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\BackendUtil.cpp:779
#9 0x7ffe02490811 in clang::BackendConsumer::HandleTranslationUnit C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:191
#10 0x7ffe02bae191 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 0x7ffe0248b502 in clang::CodeGenAction::ExecuteAction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:807
#12 0x7ffe02498cd3 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 0x7ffe02376b05 in DxcCompiler::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\tools\dxcompiler\dxcompilerobj.cpp:982
#14 0x7ffe096c9405 in dawn::native::d3d::CompileShader C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d\ShaderUtils.cpp:355
#15 0x7ffe0972930e 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 0x7ffe097d0b54 in dawn::native::d3d12::ShaderModule::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ShaderModuleD3D12.cpp:378
#17 0x7ffe097ba563 in dawn::native::d3d12::RenderPipeline::InitializeImpl C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\RenderPipelineD3D12.cpp:385
#18 0x7ffe095dfc30 in dawn::native::PipelineBase::Initialize C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Pipeline.cpp:371
#19 0x7ffe095346b1 in dawn::native::DeviceBase::CreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:2125
#20 0x7ffe09534097 in dawn::native::DeviceBase::APICreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1456
#21 0x7ffe2b8cd30d 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:314
#22 0x7ffe2b2d54c4 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:606
#23 0x7ffe2b2da371 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:1682
#24 0x7ffe26f5f7b2 in gpu::webgpu::`anonymous namespace'::DawnWireServer::HandleCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:982
#25 0x7ffe26f5fc05 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::HandleDawnCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1880
#26 0x7ffe26f54021 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::DoCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1825
#27 0x7ffe1ac76013 in gpu::CommandBufferService::Flush C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\command_buffer_service.cc:232
previously allocated by thread T0 here:
#0 0x7ff6f595cb0d in malloc C:\b\s\w\ir\cache\builder\src\third_party\llvm\compiler-rt\lib\asan\asan_malloc_win.cpp:98
#1 0x7ffe04e8396e in operator new D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp:36
#2 0x7ffe03b5ab71 in llvm::CloneBasicBlock C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Utils\CloneFunction.cpp:43
#3 0x7ffe048956d9 in llvm::UnrollLoop C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Utils\LoopUnroll.cpp:317
#4 0x7ffe03d6c23a in `anonymous namespace'::LoopUnroll::runOnLoop C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Transforms\Scalar\LoopUnrollPass.cpp:958
#5 0x7ffe048a63cb in llvm::LPPassManager::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Analysis\LoopPass.cpp:251
#6 0x7ffe02a77cb4 in llvm::FPPassManager::runOnFunction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1587
#7 0x7ffe02a7874e in llvm::FPPassManager::runOnModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1609
#8 0x7ffe02a79405 in llvm::legacy::PassManagerImpl::run C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1771
#9 0x7ffe02a8272c in clang::EmitBackendOutput C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\BackendUtil.cpp:779
#10 0x7ffe02490811 in clang::BackendConsumer::HandleTranslationUnit C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:191
#11 0x7ffe02bae191 in clang::ParseAST C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Parse\ParseAST.cpp:164
#12 0x7ffe0248b502 in clang::CodeGenAction::ExecuteAction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\CodeGenAction.cpp:807
#13 0x7ffe02498cd3 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
#14 0x7ffe02376b05 in DxcCompiler::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\tools\dxcompiler\dxcompilerobj.cpp:982
#15 0x7ffe096c9405 in dawn::native::d3d::CompileShader C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d\ShaderUtils.cpp:355
#16 0x7ffe0972930e 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
#17 0x7ffe097d0b54 in dawn::native::d3d12::ShaderModule::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ShaderModuleD3D12.cpp:378
#18 0x7ffe097ba563 in dawn::native::d3d12::RenderPipeline::InitializeImpl C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\RenderPipelineD3D12.cpp:385
#19 0x7ffe095dfc30 in dawn::native::PipelineBase::Initialize C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Pipeline.cpp:371
#20 0x7ffe095346b1 in dawn::native::DeviceBase::CreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:2125
#21 0x7ffe09534097 in dawn::native::DeviceBase::APICreateRenderPipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1456
#22 0x7ffe2b8cd30d 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:314
#23 0x7ffe2b2d54c4 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:606
#24 0x7ffe2b2da371 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:1682
#25 0x7ffe26f5f7b2 in gpu::webgpu::`anonymous namespace'::DawnWireServer::HandleCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:982
#26 0x7ffe26f5fc05 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::HandleDawnCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1880
#27 0x7ffe26f54021 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::DoCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1825
SUMMARY: AddressSanitizer: heap-use-after-free C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\BasicBlock.cpp:131 in llvm::BasicBlock::getTerminator
Shadow bytes around the buggy address:
0x11b260496f00: fa fa f7 fa 00 00 00 00 00 00 00 00 00 00 00 fa
0x11b260496f80: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fa
0x11b260497000: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fa
0x11b260497080: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fa
0x11b260497100: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fa
=>0x11b260497180: fa fa f7 fa fd fd fd fd fd fd fd fd fd[fd]fd fa
0x11b260497200: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fa
0x11b260497280: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fa
0x11b260497300: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fd
0x11b260497380: fa fa f7 fa 00 00 00 00 00 00 00 00 00 00 00 fa
0x11b260497400: fa fa f7 fa fd fd fd fd fd fd fd fd fd fd fd fa
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
==13136==ADDITIONAL INFO
==13136==Note: Please include this section with the ASan report.
Task trace:
#0 0x7ffe1a294ade in gpu::SchedulerDfs::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:684
#1 0x7ffe1a28db35 in gpu::SchedulerDfs::TryScheduleSequence C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:483
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.
==13136==END OF ADDITIONAL INFO
==13136==ABORTING
[12752:12836:0501/004248.874:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=1
[12752:12836:0501/004248.874:WARNING:gpu_process_host.cc(1436)] The GPU process has crashed 1 time(s)
[2244:14212:0501/004248.874:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[12752:12836:0501/004248.890:INFO:CONSOLE(0)] "A valid external Instance reference no longer exists.", source: file:///E:/indexDIXLUaf.html (0)
[12752:12836:0501/004249.204:WARNING:gpu_process_host.cc(1024)] Reinitialized the GPU process after a crash. The reported initialization time was 230 ms
[12752:12836:0501/004253.682:WARNING:pref_notifier_impl.cc(41)] Pref observer for media_router.cast_allow_all_ips found at shutdown.
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
Impact
The GPU process crashes, potentially leading to a denial of service.
What the attacker needed
Windows with D3D12 backend; GPU supports shader model 6.6
How it was found
- Compile the standalone.wgsl with tint to hlsl.
- Compile the hlsl with dxc using the pixel shader model 6.6 target.
- This should trigger an ASAN violation.
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 use-after-free is a memory bug where a program keeps using memory after it has been freed. Here, a shader compiler inside Chrome mishandles certain shader code, causing the GPU process to crash. An attacker can trigger this by providing a specially crafted shader.
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.