Skip to content
DoS Disclosed report Advanced

SEGV in Vulkan Radeon Mesa driver on unknown address with very high WGSL inter-stage communication variable index

A WebGPU shader declared an inter-stage variable at a location index far beyond the device's maximum, and the Mesa RADV driver did not validate it, causing a segmentation fault during pipeline linking. An attacker could crash the browser's GPU process by supplying such a shader.

Atte Kettunen Follow

Originally disclosed on Mozilla

  • Fixed in 2 months
  • Paid in 2 months
  • Disclosed after 2 months
Text
Created attachment 9524072
Crash reproducing file: SEGV-nown-radvlinkshaders-radvlinkvs-radvgraphicsshaderslink.html

Tested on:
OS: Ubuntu 24.04
Firefox: fuzzfetch fetched --asan --fuzzing
Identified task: https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.latest.firefox.linux64-fuzzing-asan-opt
> Task ID: MH9px1ovQJm_Enjfdip8rw
> Rank: 1762118969
> Changeset: d0c1a4b1cb725aaff109054e060729eb71099baf
> Build ID: 20251102212929
> Downloading: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/MH9px1ovQJm_Enjfdip8rw/artifacts/public/build/target.tar.xz (423.67MiB total)

This issue looks very similar to 1986431 and 1988488, shader defined value is not checked against given device limits.

Test case defines: '@location(688597336) uv: vec2<f32> in the shader code. Location index is far outside of the "maxInterStageShaderVariables": 16 for the device. Decreasing the index will prevent the crash.

ASAN-trace:
'''
$ ffpuppet ./firefox/firefox -u ~/git/firefox-debugging/SEGV-nown-radvlinkshaders-radvlinkvs-radvgraphicsshaderslink.html -d
[2025-11-03 11:38:06] Launching Firefox...
[2025-11-03 11:38:08] Running Firefox (pid: 2929870)...
[2025-11-03 11:38:20] Shutting down...
warning: address range table at offset 0xd130 has a premature terminator entry at offset 0xd140
warning: address range table at offset 0xd1c0 has a premature terminator entry at offset 0xd1d0
[2025-11-03 11:38:21] Firefox process is closed. (Reason: ALERT)
[2025-11-03 11:38:21] Displaying logs...
===
=== Dumping 'log_ffp_asan_2929869.log.2929870.txt' (15.66KB)
===
=================================================================
==2929870==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7fff25cc0168 bp 0x7fff84d3ee30 sp 0x7fff84d3ece0 T65)
==2929870==The signal is caused by a READ memory access.
==2929870==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 0x7fff25cc0168 in ?? /usr/src/mesa-24.0.5-1ubuntu1/build/../src/compiler/nir/nir_lower_io_arrays_to_elements.c:303:17
    #1 0x7fff25cc0d73 in ?? /usr/src/mesa-24.0.5-1ubuntu1/build/../src/compiler/nir/nir_lower_io_arrays_to_elements.c:403:4
    #2 0x7fff25b5481c in radv_link_shaders /usr/src/mesa-24.0.5-1ubuntu1/build/../src/amd/vulkan/radv_pipeline_graphics.c:1328:4
    #3 0x7fff25b566f0 in radv_link_vs /usr/src/mesa-24.0.5-1ubuntu1/build/../src/amd/vulkan/radv_pipeline_graphics.c:1433:7
    #4 0x7fff25b566f0 in radv_graphics_shaders_link /usr/src/mesa-24.0.5-1ubuntu1/build/../src/amd/vulkan/radv_pipeline_graphics.c:1651:10
    #5 0x7fff25b566f0 in radv_graphics_shaders_compile /usr/src/mesa-24.0.5-1ubuntu1/build/../src/amd/vulkan/radv_pipeline_graphics.c:2516:4
    #6 0x7fff25b566f0 in radv_graphics_pipeline_compile /usr/src/mesa-24.0.5-1ubuntu1/build/../src/amd/vulkan/radv_pipeline_graphics.c:2692:4
    #7 0x7fff25b59b46 in radv_graphics_pipeline_init /usr/src/mesa-24.0.5-1ubuntu1/build/../src/amd/vulkan/radv_pipeline_graphics.c:3912:16
    #8 0x7fff25b5d01d in radv_graphics_pipeline_create /usr/src/mesa-24.0.5-1ubuntu1/build/../src/amd/vulkan/radv_pipeline_graphics.c:4011:13
    #9 0x7fff25b5d348 in radv_CreateGraphicsPipelines /usr/src/mesa-24.0.5-1ubuntu1/build/../src/amd/vulkan/radv_pipeline_graphics.c:4152:14
    #10 0x7fffe3f3a304 in ash::device::Device::create_graphics_pipelines::hb9828e7304fef1a9 /builds/worker/checkouts/gecko/third_party/rust/ash/src/device.rs:2157:24
    #11 0x7fffe3f3a304 in wgpu_hal::vulkan::device::_$LT$impl$u20$wgpu_hal..Device$u20$for$u20$wgpu_hal..vulkan..Device$GT$::create_render_pipeline::h380120c1411f153c /builds/worker/checkouts/gecko/third_party/rust/wgpu-hal/src/vulkan/device.rs:2115:17
    #12 0x7fffe35effac in _$LT$D$u20$as$u20$wgpu_hal..dynamic..device..DynDevice$GT$::create_render_pipeline::h0c006aec64d5e3d0 /builds/worker/checkouts/gecko/third_party/rust/wgpu-hal/src/dynamic/device.rs:414:18
    #13 0x7fffe3d2695a in wgpu_core::device::resource::Device::create_render_pipeline::hf106411059132855 /builds/worker/checkouts/gecko/third_party/rust/wgpu-core/src/device/resource.rs:4343:22
    #14 0x7fffe3cc03c9 in wgpu_core::device::global::_$LT$impl$u20$wgpu_core..global..Global$GT$::device_create_general_render_pipeline::h997d748395679d8e /builds/worker/checkouts/gecko/third_party/rust/wgpu-core/src/device/global.rs:1531:34
    #15 0x7fffe3cbe926 in wgpu_core::device::global::_$LT$impl$u20$wgpu_core..global..Global$GT$::device_create_render_pipeline::h3711470dae6f8940 /builds/worker/checkouts/gecko/third_party/rust/wgpu-core/src/device/global.rs:1349:9
...
'''

WebGPU device:
'''
{
  "navigator.gpu.requestAdapter({})": {
    "info": {
      "architecture": "",
      "description": "",
      "device": "",
      "isFallbackAdapter": false,
      "subgroupMaxSize": 128,
      "subgroupMinSize": 4,
      "vendor": "",
      "wgpuBackend": "Vulkan",
      "wgpuDevice": 5056,
      "wgpuDeviceType": "IntegratedGpu",
      "wgpuDriver": "radv",
      "wgpuDriverInfo": "Mesa 24.0.5-1ubuntu1",
      "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
    }
  }
}
'''

The original report as published on Mozilla's Bugzilla, by Atte Kettunen. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 Mesa RADV driver failed to validate the inter-stage shader variable location against the device's maxInterStageShaderVariables limit before using it as an array index.

Impact

A malicious web page could crash the browser's GPU process on systems using the affected Mesa RADV driver.

What the attacker needed

Firefox with WebGPU enabled; Mesa RADV driver version 24.0.5; victim visits a crafted page

How it was found

  1. Open the provided HTML file in an ASAN-instrumented Firefox build.
  2. The page creates a WebGPU device and compiles a shader with an out-of-range inter-stage location.
  3. The browser crashes with a SEGV in the RADV shader linking code.

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. A shader can label its inputs and outputs with numbers called locations, and the browser is supposed to reject numbers above a limit. Here the graphics driver did not check the number, so it read memory at a bad address and the browser crashed.

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.

More by Atte Kettunen

View all

62 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.