SEGV in Vulkan Radeon Mesa driver on unknown address with very high WGSL color attachment location index
A WebGPU fragment shader with a colour attachment location index far above the device limit caused the Mesa RADV Vulkan driver to compute an out-of-bounds stack index and crash the browser process. An attacker could use a crafted WebGPU shader to trigger a denial of service on affected Linux systems.
Originally disclosed on Mozilla
- Fixed in 38 days
- Paid in 58 days
- Disclosed after 38 days
Created attachment 9513162 BUS-vkicdGetPhysicalDeviceProcAddr-vkicdGetPhysicalDeviceProcAddr-vkicdGetPhysicalDeviceProcAddr.html
Tested on: OS: Ubuntu 24.04 Graphics: AMD Ryzen 5 9600X iGPU Firefox: fuzzfetch fetched mozilla-central ASAN-build.
Latest available build is older than 1 day: 20250913092312
Identified task: https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.latest.firefox.linux64-asan-opt
> Task ID: JDefI6fnSt-pO_jbG4owiA
> Rank: 1757755392
> Changeset: 1172f45a3c14a6c5caf3fcccb03db4f9c9c69a61
> Build ID: 20250913092312
> Downloading: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/JDefI6fnSt-pO_jbG4owiA/artifacts/public/build/target.tar.xz (361.81MiB total)
To reproduce, open the attached BUS-vkicdGetPhysicalDeviceProcAddr-vkicdGetPhysicalDeviceProcAddr-vkicdGetPhysicalDeviceProcAddr.html with firefox.
Reason for the crash in the test case is very high value in fragment shader color attachment location binding:
fn main() -> @location(1178206785) vec4f {
Value is far over the maxColorAttachments of 8 from WebGPU info.
Similarly to https://bugzilla.mozilla.org/show_bug.cgi?id=1986431, It looks like the @location value is used in index calculation in the libvulkan_radeon.so:
leaq (%rcx,%rdi,4), %rcx
movq %rax, -0xc40(%rbp,%rcx,8)
%rax is some libvulkan_radeon.so memory structure
%rbp is stack base pointer
%rdi is our location value + 4
%rcx value directly derived from the location value (<value> + 4) * 4
ASAN-trace:
:$ ~/firefox/firefox ./BUS-vkicdGetPhysicalDeviceProcAddr-vkicdGetPhysicalDeviceProcAddr-vkicdGetPhysicalDeviceProcAddr.html
ATTENTION: default value of option mesa_glthread overridden by environment.
JavaScript error: resource://gre/modules/PromiseWorker.sys.mjs, line 75: Error: Could not get children of `/home/attekett/.mozilla/firefox/07snp8ku.default-default-2/thumbnails': directory does not exist (NS_ERROR_FILE_NOT_FOUND)
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1621393==ERROR: AddressSanitizer: BUS on unknown address (pc 0x7fff35139047 bp 0x7fff6e79c880 sp 0x7fff6e79bbb0 T81)
==1621393==The signal is caused by a READ memory access.
==1621393==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#0 0x7fff35139047 (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x339047) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
#1 0x7fff3513a0a5 (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x33a0a5) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
#2 0x7fff3513aa2f (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x33aa2f) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
#3 0x7fff34f4ed34 (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x14ed34) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
#4 0x7fff34f35c1b (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x135c1b) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
#5 0x7fff34f38857 (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x138857) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
#6 0x7fff34f3a387 (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x13a387) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
#7 0x7fff34f3ae69 (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x13ae69) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
#8 0x7fffee3d73f4 in ash::device::Device::create_graphics_pipelines::hb9828e7304fef1a9 /builds/worker/checkouts/gecko/third_party/rust/ash/src/device.rs:2157:24
#9 0x7fffee3d73f4 in wgpu_hal::vulkan::device::_$LT$impl$u20$wgpu_hal..Device$u20$for$u20$wgpu_hal..vulkan..Device$GT$::create_render_pipeline::he371c50dacc47014 /builds/worker/checkouts/gecko/third_party/rust/wgpu-hal/src/vulkan/device.rs:2210:17
...
==1621393==Register values:
rax = 0x0000511000011870 rbx = 0x00005160003fbdb0 rcx = 0x00000000ee6b2810 rdx = 0x00005160003fbdc8
rdi = 0x000000003b9aca04 rsi = 0x0000000000000008 rbp = 0x00007fff6e79c880 rsp = 0x00007fff6e79bbb0
r8 = 0x00007fff6e79c910 r9 = 0x0000524000e2a000 r10 = 0x00007fffffffff01 r11 = 0x1194c28ddfc5fb01
r12 = 0x00007fff6e79ca40 r13 = 0x00007fff6e79ca40 r14 = 0x00005100001f6970 r15 = 0x00007fff6e79d6a0
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: BUS (/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so+0x339047) (BuildId: ff6fbdda6e85133c121da86481056ba0c34fa865)
Thread T81 created by T0 here:
#0 0x5555556951a1 in pthread_create /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:250:3
#1 0x7ffff7a80419 in _PR_CreateThread /builds/worker/checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:429:10
#2 0x7ffff7a6e65e in PR_CreateThread /builds/worker/checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:496:10
#3 0x7fffdbdd8c71 in nsThread::Init(nsTSubstring<char> const&) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:615:20
#4 0x7fffdbde6649 in nsThreadManager::NewNamedThread(nsTSubstring<char> const&, nsIThreadManager::ThreadCreationOptions, nsIThread**) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadManager.cpp:619:22
#5 0x7fffdbdf0e99 in NS_NewNamedThread(nsTSubstring<char> const&, nsIThread**, already_AddRefed<nsIRunnable>, nsIThreadManager::ThreadCreationOptions) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:176:57
...
==1621393==ABORTING
WebGPU info:
WebGPU Default Adapter {
"navigator.gpu.requestAdapter({})": {
"info": {
"architecture": "",
"description": "",
"device": "",
"isFallbackAdapter": false,
"subgroupMaxSize": 128,
"subgroupMinSize": 4,
"vendor": "",
"wgpuBackend": "Vulkan",
"wgpuDevice": 5056,
"wgpuDeviceType": "IntegratedGpu",
"wgpuDriver": "radv",
"wgpuDriverInfo": "Mesa 25.0.7-0ubuntu0.24.04.1",
"wgpuName": "AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO)",
"wgpuVendor": 4098
},
"features": [
"bgra8unorm-storage",
"core-features-and-limits",
"depth-clip-control",
"depth32float-stencil8",
"float32-filterable",
"indirect-first-instance",
"rg11b10ufloat-renderable",
"shader-f16",
"texture-compression-bc",
"texture-compression-bc-sliced-3d",
"timestamp-query"
],
"limits": {
"maxBindGroups": 8,
"maxBindGroupsPlusVertexBuffers": 24,
"maxBindingsPerBindGroup": 1000,
"maxBufferSize": 1073741824,
"maxColorAttachmentBytesPerSample": 32,
"maxColorAttachments": 8,
"maxComputeInvocationsPerWorkgroup": 1024,
"maxComputeWorkgroupSizeX": 1024,
"maxComputeWorkgroupSizeY": 1024,
"maxComputeWorkgroupSizeZ": 1024,
"maxComputeWorkgroupStorageSize": 65536,
"maxComputeWorkgroupsPerDimension": 65535,
"maxDynamicStorageBuffersPerPipelineLayout": 8,
"maxDynamicUniformBuffersPerPipelineLayout": 16,
"maxInterStageShaderVariables": 16,
"maxSampledTexturesPerShaderStage": 64,
"maxSamplersPerShaderStage": 64,
"maxStorageBufferBindingSize": 1073741824,
"maxStorageBuffersPerShaderStage": 64,
"maxStorageTexturesPerShaderStage": 64,
"maxTextureArrayLayers": 2048,
"maxTextureDimension1D": 16384,
"maxTextureDimension2D": 16384,
"maxTextureDimension3D": 2048,
"maxUniformBufferBindingSize": 1073741824,
"maxUniformBuffersPerShaderStage": 64,
"maxVertexAttributes": 32,
"maxVertexBufferArrayStride": 2048,
"maxVertexBuffers": 16,
"minStorageBufferOffsetAlignment": 32,
"minUniformBufferOffsetAlignment": 32
}
}
}
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 the WebGPU implementation passed the shader's colour attachment location value to the Vulkan driver without validating it against maxColorAttachments, and the driver used it directly in an index calculation.
Impact
A crafted WebGPU shader could crash the browser process on systems using the affected Mesa RADV driver, causing a denial of service; the report does not claim code execution.
What the attacker needed
WebGPU enabled in Firefox; Mesa RADV driver on Linux; victim opens a crafted page
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 small programs on the graphics card. This report shows that a program asking to write to a colour output slot numbered far higher than the card supports made the graphics driver read memory outside its own stack, which crashed the browser. The page only needs to be opened; no special permissions are described.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.