Skip to content
Memory corruption Advisory Advanced CVE-2024-5160

Heap buffer overflow in Dawn (CVE-2024-5160)

A WebGPU shader written in WGSL is translated to HLSL and then compiled by the DirectX shader compiler (dxcompiler), which triggers a heap buffer overflow in the bitcode writer. An attacker could crash the GPU process by opening a crafted HTML page on Windows with a Direct3D 12 backend supporting shader model 6.6.

wgslfuzz Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 21 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 OOB inside 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.

  1. 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
  2. Compile the hlsl with dxc (commit e7b78ff9c99c19a6a0c98256db9794e0af4eb59d): ./dxc-3.7 standalone.hlsl -T cs_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
[10824:10828:0501/023933.139:WARNING:chrome_main_delegate.cc(742)] This is Chrome version 126.0.6451.0 (not a warning)
[10824:7736:0501/023933.358:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[10824:10828:0501/023933.405: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.
[10824:10752:0501/023933.421:ERROR:sandbox_win.cc(911)] Sandbox cannot access executable. Check filesystem permissions are valid. See https://bit.ly/31yqMJR.: Access is denied. (0x5)
[10824:10828:0501/023933.561:WARNING:account_consistency_mode_manager.cc(77)] Desktop Identity Consistency cannot be enabled as no OAuth client ID and client secret have been configured.
[10824:10828:0501/023933.749:WARNING:browser_management_service.cc(128)] EnterpriseLogoUrl fetch failed with error code -1 and MIME type 
[10824:10828:0501/023935.125:ERROR:network_service_instance_impl.cc(600)] Network service crashed, restarting service.
[10824:10828:0501/023935.171:WARNING:external_registry_loader_win.cc(232)] Error observing HKLM: 5
[8424:5960:0501/023935.421:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[10824:7724:0501/023938.375:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[8424:6128:0501/023940.427:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[10824:7736:0501/023948.382:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[8424:892:0501/023950.430:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[10824:10828:0501/023957.315:INFO:CONSOLE(20)] "[object GPUDevice]", source: file:///E:/indexValueEnumeratorOOB.html (20)
[10328:3004:0501/023957.459:ERROR:gpu_device.cc(302)] GPUDevice: Entry point "computeSomething" doesn't exist in the shader module [ShaderModule "doubling compute module"].
 - While validating compute stage ([ShaderModule "doubling compute module"], entryPoint: computeSomething).
 - While calling [Device].CreateComputePipeline([ComputePipelineDescriptor "doubling compute pipeline"]).

[10328:3004:0501/023957.459:ERROR:gpu_device.cc(302)] GPUDevice: [Invalid ComputePipeline "doubling compute pipeline"] is invalid.
 - While encoding [ComputePassEncoder "doubling compute pass"].SetPipeline([Invalid ComputePipeline "doubling compute pipeline"]).

[10824:10828:0501/023957.459:INFO:CONSOLE(0)] "Entry point "computeSomething" doesn't exist in the shader module [ShaderModule "doubling compute module"].
 - While validating compute stage ([ShaderModule "doubling compute module"], entryPoint: computeSomething).
 - While calling [Device].CreateComputePipeline([ComputePipelineDescriptor "doubling compute pipeline"]).
", source: file:///E:/indexValueEnumeratorOOB.html (0) 
[10328:3004:0501/023957.459:ERROR:gpu_device.cc(302)] GPUDevice: [Invalid CommandBuffer from CommandEncoder "doubling encoder"] is invalid.
 - While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "doubling encoder"]])

[10824:10828:0501/023957.459:INFO:CONSOLE(0)] "[Invalid ComputePipeline "doubling compute pipeline"] is invalid.
 - While encoding [ComputePassEncoder "doubling compute pass"].SetPipeline([Invalid ComputePipeline "doubling compute pipeline"]).
", source: file:///E:/indexValueEnumeratorOOB.html (0) 
[10824:10828:0501/023957.459:INFO:CONSOLE(0)] "[Invalid CommandBuffer from CommandEncoder "doubling encoder"] is invalid.
 - While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "doubling encoder"]])
", source: file:///E:/indexValueEnumeratorOOB.html (0) 
[10824:7708:0501/024008.389:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[8424:6128:0501/024010.446:WARNING:dns_config_service_win.cc(605)] Failed to read DnsConfig.
[10824:10828:0501/024037.828:INFO:CONSOLE(20)] "[object GPUDevice]", source: file:///E:/indexValueEnumeratorOOB.html (20)
=================================================================
==7644==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x11a6989f2a88 at pc 0x7ffb3b7e9278 bp 0x00130e9fbe60 sp 0x00130e9fbea8
READ of size 4 at 0x11a6989f2a88 thread T0
==7644==WARNING: Failed to use and restart external symbolizer!
==7644==*** WARNING: Failed to initialize DbgHelp!              ***
==7644==*** Most likely this means that the app is already      *** 
==7644==*** using DbgHelp, possibly with incompatible flags.    *** 
==7644==*** Due to technical reasons, symbolization might crash *** 
==7644==*** or produce wrong results.                           ***
    #0 0x7ffb3b7e9277 in WriteInstruction C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\BitcodeWriter.cpp:1720
    #1 0x7ffb3b7a935b in WriteModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\BitcodeWriter.cpp:2419
    #2 0x7ffb3b7996dc in llvm::WriteBitcodeToFile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\BitcodeWriter.cpp:2520
    #3 0x7ffb3d0a0934 in `anonymous namespace'::WriteBitcodePass::runOnModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\BitcodeWriterPass.cpp:40
    #4 0x7ffb3bbc9405 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 0x7ffb3bbd272c in clang::EmitBackendOutput C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\BackendUtil.cpp:779
    #6 0x7ffb3b5e0811 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
    #7 0x7ffb3bcfe191 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 0x7ffb3b5db502 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
    #9 0x7ffb3b5e8cd3 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 0x7ffb3b4c6b05 in DxcCompiler::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\tools\dxcompiler\dxcompilerobj.cpp:982
    #11 0x7ffb47aa9405 in dawn::native::d3d::CompileShader C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d\ShaderUtils.cpp:355
    #12 0x7ffb47b0930e 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 0x7ffb47bb0b54 in dawn::native::d3d12::ShaderModule::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ShaderModuleD3D12.cpp:378
    #14 0x7ffb47b7431c in dawn::native::d3d12::ComputePipeline::InitializeImpl C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ComputePipelineD3D12.cpp:87
    #15 0x7ffb479bfc30 in dawn::native::PipelineBase::Initialize C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Pipeline.cpp:371
    #16 0x7ffb4790ee71 in dawn::native::DeviceBase::CreateComputePipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1996
    #17 0x7ffb4790e857 in dawn::native::DeviceBase::APICreateComputePipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1299
    #18 0x7ffb69cacfad in dawn::wire::server::Server::DoDeviceCreateComputePipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerDoers_autogen.cpp:250
    #19 0x7ffb696b2e04 in dawn::wire::server::Server::HandleDeviceCreateComputePipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerHandlers_autogen.cpp:477
    #20 0x7ffb696bb8dd 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:1652
    #21 0x7ffb6533f7b2 in gpu::webgpu::`anonymous namespace'::DawnWireServer::HandleCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:982
    #22 0x7ffb6533fc05 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::HandleDawnCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1880
    #23 0x7ffb65334021 in gpu::webgpu::`anonymous namespace'::WebGPUDecoderImpl::DoCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:1825
    #24 0x7ffb59056013 in gpu::CommandBufferService::Flush C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\command_buffer_service.cc:232
    #25 0x7ffb55bbcbcc in gpu::CommandBufferStub::OnAsyncFlush C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\command_buffer_stub.cc:506
    #26 0x7ffb55bbb673 in gpu::CommandBufferStub::ExecuteDeferredRequest C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\command_buffer_stub.cc:154
    #27 0x7ffb59073e4a in gpu::GpuChannel::ExecuteDeferredRequest C:\b\s\w\ir\cache\builder\src\gpu\ipc\service\gpu_channel.cc:895
    #28 0x7ffb5908414a 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
    #29 0x7ffb586765dd in gpu::SchedulerDfs::ExecuteSequence C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:743
    #30 0x7ffb58674938 in gpu::SchedulerDfs::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:668
    #31 0x7ffb58677c68 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
    #32 0x7ffb53aaca20 in base::TaskAnnotator::RunTaskImpl C:\b\s\w\ir\cache\builder\src\base\task\common\task_annotator.cc:203
    #33 0x7ffb57496c66 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
    #34 0x7ffb57495b89 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
    #35 0x7ffb574ca37e in base::MessagePumpDefault::Run C:\b\s\w\ir\cache\builder\src\base\message_loop\message_pump_default.cc:40
    #36 0x7ffb574988ac 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
    #37 0x7ffb53af6f30 in base::RunLoop::Run C:\b\s\w\ir\cache\builder\src\base\run_loop.cc:134
    #38 0x7ffb5695c71b in content::GpuMain C:\b\s\w\ir\cache\builder\src\content\gpu\gpu_main.cc:437
    #39 0x7ffb5239f5d2 in content::RunOtherNamedProcessTypeMain C:\b\s\w\ir\cache\builder\src\content\app\content_main_runner_impl.cc:773
    #40 0x7ffb523a1b53 in content::ContentMainRunnerImpl::Run C:\b\s\w\ir\cache\builder\src\content\app\content_main_runner_impl.cc:1155
    #41 0x7ffb5239d56d in content::RunContentProcess C:\b\s\w\ir\cache\builder\src\content\app\content_main.cc:332
    #42 0x7ffb5239e05d in content::ContentMain C:\b\s\w\ir\cache\builder\src\content\app\content_main.cc:345
    #43 0x7ffb453e16b1 in ChromeMain C:\b\s\w\ir\cache\builder\src\chrome\app\chrome_main.cc:192
    #44 0x7ff640f243a5 in MainDllLoader::Launch C:\b\s\w\ir\cache\builder\src\chrome\app\main_dll_loader_win.cc:181
    #45 0x7ff640f21db2 in main C:\b\s\w\ir\cache\builder\src\chrome\app\chrome_exe_main_win.cc:350
    #46 0x7ff6412fd943 in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    #47 0x7ffbc73c257c in BaseThreadInitThunk+0x1c (C:\Windows\System32\KERNEL32.DLL+0x18001257c)
    #48 0x7ffbc83eaa47 in RtlUserThreadStart+0x27 (C:\Windows\SYSTEM32\ntdll.dll+0x18005aa47)

0x11a6989f2a88 is located 8 bytes after 1024-byte region [0x11a6989f2680,0x11a6989f2a80)
allocated by thread T0 here:
    #0 0x7ff640ffcb0d in malloc C:\b\s\w\ir\cache\builder\src\third_party\llvm\compiler-rt\lib\asan\asan_malloc_win.cpp:98
    #1 0x7ffb3dfd396e in operator new D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp:36
    #2 0x7ffb3b6c09db in llvm::DenseMapBase<llvm::DenseMap<const clang::TypeDecl *,unsigned int,llvm::DenseMapInfo<const clang::TypeDecl *>,llvm::detail::DenseMapPair<const clang::TypeDecl *,unsigned int> >,const clang::TypeDecl *,unsigned int,llvm::DenseMapInfo<const clang::TypeDecl *>,llvm::detail::DenseMapPair<const clang::TypeDecl *,unsigned int> >::grow C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\include\llvm\ADT\DenseMap.h:427
    #3 0x7ffb3b6c0716 in llvm::DenseMapBase<llvm::DenseMap<clang::RecordDecl *,unsigned int,llvm::DenseMapInfo<clang::RecordDecl *>,llvm::detail::DenseMapPair<clang::RecordDecl *,unsigned int> >,clang::RecordDecl *,unsigned int,llvm::DenseMapInfo<clang::RecordDecl *>,llvm::detail::DenseMapPair<clang::RecordDecl *,unsigned int> >::FindAndConstruct C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\include\llvm\ADT\DenseMap.h:265
    #4 0x7ffb3c91bb1d in llvm::ValueEnumerator::EnumerateType C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\ValueEnumerator.cpp:635
    #5 0x7ffb3c91b092 in llvm::ValueEnumerator::EnumerateValue C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\ValueEnumerator.cpp:601
    #6 0x7ffb3c918b48 in llvm::ValueEnumerator::ValueEnumerator C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\ValueEnumerator.cpp:300
    #7 0x7ffb3b79c2ea in WriteModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\BitcodeWriter.cpp:2380
    #8 0x7ffb3b7996dc in llvm::WriteBitcodeToFile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\BitcodeWriter.cpp:2520
    #9 0x7ffb3d0a0934 in `anonymous namespace'::WriteBitcodePass::runOnModule C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\BitcodeWriterPass.cpp:40
    #10 0x7ffb3bbc9405 in llvm::legacy::PassManagerImpl::run C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\IR\LegacyPassManager.cpp:1771
    #11 0x7ffb3bbd272c in clang::EmitBackendOutput C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\CodeGen\BackendUtil.cpp:779
    #12 0x7ffb3b5e0811 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
    #13 0x7ffb3bcfe191 in clang::ParseAST C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\lib\Parse\ParseAST.cpp:164
    #14 0x7ffb3b5db502 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
    #15 0x7ffb3b5e8cd3 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
    #16 0x7ffb3b4c6b05 in DxcCompiler::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\tools\clang\tools\dxcompiler\dxcompilerobj.cpp:982
    #17 0x7ffb47aa9405 in dawn::native::d3d::CompileShader C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d\ShaderUtils.cpp:355
    #18 0x7ffb47b0930e 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
    #19 0x7ffb47bb0b54 in dawn::native::d3d12::ShaderModule::Compile C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ShaderModuleD3D12.cpp:378
    #20 0x7ffb47b7431c in dawn::native::d3d12::ComputePipeline::InitializeImpl C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\d3d12\ComputePipelineD3D12.cpp:87
    #21 0x7ffb479bfc30 in dawn::native::PipelineBase::Initialize C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Pipeline.cpp:371
    #22 0x7ffb4790ee71 in dawn::native::DeviceBase::CreateComputePipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1996
    #23 0x7ffb4790e857 in dawn::native::DeviceBase::APICreateComputePipeline C:\b\s\w\ir\cache\builder\src\third_party\dawn\src\dawn\native\Device.cpp:1299
    #24 0x7ffb69cacfad in dawn::wire::server::Server::DoDeviceCreateComputePipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerDoers_autogen.cpp:250
    #25 0x7ffb696b2e04 in dawn::wire::server::Server::HandleDeviceCreateComputePipeline C:\b\s\w\ir\cache\builder\src\out\Release_x64\gen\third_party\dawn\src\dawn\wire\server\ServerHandlers_autogen.cpp:477
    #26 0x7ffb696bb8dd 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:1652
    #27 0x7ffb6533f7b2 in gpu::webgpu::`anonymous namespace'::DawnWireServer::HandleCommands C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\webgpu_decoder_impl.cc:982


SUMMARY: AddressSanitizer: heap-buffer-overflow C:\b\s\w\ir\cache\builder\src\third_party\dawn\third_party\dxc\lib\Bitcode\Writer\BitcodeWriter.cpp:1720 in WriteInstruction
Shadow bytes around the buggy address:
  0x11a6989f2800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x11a6989f2880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x11a6989f2900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x11a6989f2980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x11a6989f2a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x11a6989f2a80: fa[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x11a6989f2b00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa f7 fa
  0x11a6989f2b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x11a6989f2c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x11a6989f2c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x11a6989f2d00: 00 00 00 00 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

==7644==ADDITIONAL INFO

==7644==Note: Please include this section with the ASan report.
Task trace:
    #0 0x7ffb58674ade in gpu::SchedulerDfs::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:684
    #1 0x7ffb58674ade in gpu::SchedulerDfs::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:684
    #2 0x7ffb58674ade in gpu::SchedulerDfs::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:684
    #3 0x7ffb58674ade in gpu::SchedulerDfs::RunNextTask C:\b\s\w\ir\cache\builder\src\gpu\command_buffer\service\scheduler_dfs.cc:684


==7644==END OF ADDITIONAL INFO
==7644==ABORTING
[10824:10828:0501/024125.457:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=1
[10824:10828:0501/024125.457:WARNING:gpu_process_host.cc(1436)] The GPU process has crashed 1 time(s)
[10824:10828:0501/024125.814:WARNING:gpu_process_host.cc(1024)] Reinitialized the GPU process after a crash. The reported initialization time was 256 ms

The original report as published on the Chromium issue tracker, by wgslfuzz. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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

An attacker could crash the GPU process by getting a victim to open a crafted web page, but only on Windows systems whose Direct3D 12 backend supports shader model 6.6.

What the attacker needed

Windows with D3D12 backend; GPU supports shader model 6.6; victim opens a crafted HTML page

How it was found

  1. Open the attached HTML file in Chromium on Windows with a D3D12 backend that supports shader model 6.6.
  2. The GPU process crashes with an AddressSanitizer heap-buffer-overflow.
  3. Alternatively, compile the provided WGSL shader to HLSL using tint.
  4. Compile the resulting HLSL with dxc targeting compute shader model 6.6 to trigger the same 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.

WebGPU lets web pages run programs on the graphics card. Chrome converts these programs into a format the graphics driver understands. A bug in that conversion step, inside a Microsoft compiler component, causes Chrome's graphics process to read past the end of a memory buffer and 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.

More by wgslfuzz

View all

16 more disclosed reports, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.