Crash in [@ mozilla::FFmpegVideoDecoder<T>::FFmpegVulkanVideoDecoder::Cleanup]
Categories
(Core :: Audio/Video, defect)
Tracking
()
People
(Reporter: gsvelto, Unassigned)
References
Details
(4 keywords)
Crash Data
Crash report: https://crash-stats.mozilla.org/report/index/9fc2a46f-ed04-4d22-9000-189590260620
Reason:
SIGSEGV / SEGV_MAPERR
Top 10 frames:
0 ? @0x00007f706f5cd320
1 libxul.so mozilla::FFmpegVideoDecoder<62>::FFmpegVulkanVideoDecoder::Cleanup() /usr/src/debug/firefox/firefox-152.0/dom/media/platforms/ffmpeg/FFmpegVulkanVideoDecoder.cpp:72
2 libxul.so mozilla::FFmpegVideoDecoder<62>::ProcessShutdown() /usr/src/debug/firefox/firefox-152.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp:2593
3 libxul.so mozilla::FFmpegDataDecoder<53>::Shutdown()::$_0::operator()() const /usr/src/debug/firefox/firefox-152.0/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp:292
3 libxul.so mozilla::detail::ProxyFunctionRunnable<mozilla::FFmpegDataDecoder<53>::Shutdo... /usr/src/debug/firefox/firefox-152.0/obj/dist/include/mozilla/MozPromise.h:1836
4 libxul.so mozilla::TaskQueue::Runner::Run() /usr/src/debug/firefox/firefox-152.0/xpcom/threads/TaskQueue.cpp:309
5 libxul.so nsThreadPool::Run() /usr/src/debug/firefox/firefox-152.0/xpcom/threads/nsThreadPool.cpp:442
6 libxul.so nsThread::ProcessNextEvent(bool, bool*) /usr/src/debug/firefox/firefox-152.0/xpcom/threads/nsThread.cpp:1173
6 libxul.so NS_ProcessNextEvent(nsIThread*, bool) /usr/src/debug/firefox/firefox-152.0/xpcom/threads/nsThreadUtils.cpp:472
7 libxul.so mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /usr/src/debug/firefox/firefox-152.0/ipc/glue/MessagePump.cpp:297
Just found this during crash triage, somehow we're missing symbols for the libvulkan_radeon.so library that seems to be responsible for this. Many of these crashes have use-after-free patterns in the crash address so marking this as security-sensitive even though it might not be our fault.
| Reporter | ||
Comment 1•4 months ago
|
||
I'll try to see if I can find the symbols via debuginfod later
Comment 2•4 months ago
|
||
The bug is linked to a topcrash signature, which matches the following criterion:
- Top 10 desktop browser crashes on nightly
For more information, please visit BugBot documentation.
| Reporter | ||
Comment 3•4 months ago
|
||
I found more signatures which appear related: they're all rooted in FFmpegVideoDecoder<62>::FFmpegVulkanVideoDecoder::Cleanup(), they all happen within libvulkan_radeon.so and they're all UAFs.
Comment 4•4 months ago
|
||
There are some older Firefox that crash, and some older radeon Mesa drivers, but the onset makes it very hard to tell if it's a problem with 26.x radeon drivers or something introduced in 152 (maybe?) that was maybe nightly only in 151?
The libvulkan_radeon.so UAF signature seems to have affected mainly 152-nightly and 153-nightly, with a handful on 151-nightly. No beta or release versions for that range. Prior to 151.0a1 there are some release crashes on 150 and some earlier builds, but just a few. Maybe that shouldn't surprise me? Might be the same type of people willing to use the latest Mesa drivers and using Firefox Nightly. Is it a driver bug? Or an existing Firefox bug that was exposed by changes in the driver?
The most recent report of this signature was 3 days ago, and the most recent build reporting this signature was 20260610214350 almost ten days before that. Did we fix something? Signature changed? It does look like the crash spike is largely due to driver versions 26.1.0 and 26.1.1, but there were measurable numbers of crashes on older and newer versions so it seems odd they just stopped.
| Reporter | ||
Comment 5•4 months ago
|
||
I'll try to breakdown the crashes by exact Mesa version, maybe I've cast a net too wide with the signatures. Let's see if I can narrow it down.
Updated•4 months ago
|
Comment 6•4 months ago
|
||
If you restrict the search to UAF-looking crashes it started in build 20260512212623, making it more likely our bug. See bug 2050361 for a similar crash stack with nvidia drivers
Comment 7•4 months ago
|
||
The changes in that specific build are
https://hg-edge.mozilla.org/mozilla-central/pushloghtml?changeset=04f987534771f13e35e82074986a422e4b13b44a
with the GFX changes:
bug 2037368 WebRender Support tiled images with the quad shader code path
bug 2037007 WebRender Support non-premultiplied images in the quad_textured shader
bug 2022610 Canvas2D transferred OffscreenCanvas toDataURL() serializes uninitialized surface padding as pixel data (stride mismatch in ExtractDataInternal)
bug 2022252 ImageLib Heap-buffer-overflow WRITE in [@ mozilla::image::Downscaler::DownscaleInputLine]
Of course it could have been a slightly earlier change.
Comment 8•4 months ago
|
||
Sorry, haven't had my coffee yet -- this is media, not graphics. It's almost certainly
bug 2021722 Add Vulkan Video path to FFmpegVideoDecoder in Firefox
Many of the URLs associated with the crashes were on video sites like youtube and pluto.tv
Comment 9•4 months ago
|
||
The most recent report of this signature was 3 days ago, but the most recent build reporting it is 20260610214350 (2026-06-10).
We landed a fix on 2026-06-11 in Bug 2046660: av_buffer_unref(&mVulkanDeviceContext) was running before mVulkanDecoder.Cleanup(), so Cleanup() could call into an already-destroyed VkDevice. I wouldn't expect this signature on newer builds; the recent report is likely a pre-fix Nightly still in use.
Comment 10•4 months ago
|
||
Hi Tymur -- can this bug be closed or duped to Bug 2046660 ? Thanks.
Comment 12•4 months ago
|
||
(In reply to Tymur Boiko from comment #11)
Hi Tymur -- can this bug be closed or duped to Bug 2046660 ? Thanks.
Hi Maire, in my opinion - yes
Thank you! I'll dup this to Bug 2046660 then.
Comment 13•4 months ago
|
||
This is an automated comment. To help with triage and priority, we are experimenting with an automated exploitation analysis.
A proof-of-concept was attempted, and controlled exploitation is not feasible based on this analysis. The issue was considered a use after free, in FFmpegVideoDecoder::ProcessShutdown() in the RDD process, where av_buffer_unref drops the last AVHWDeviceContext reference and synchronously destroys the Vulkan VkDevice before mVulkanDecoder.Cleanup() dereferences the now-dangling handle. Control of the freed driver allocation's contents was attempted, however sufficient control could not be demonstrated. The free and the use are adjacent statements in the same function on the same media TaskQueue thread, with no JS callback, IPC roundtrip, or event-loop turn between them, so there is no interposition window to reclaim the slot with attacker-chosen bytes; any cross-thread reclaim would only land driver-populated structures the attacker does not influence.
Based on this analysis, the bug is being reclassified as sec-moderate. If this bug was submitted for a bounty, it is unlikely to be awarded one unless some control can be demonstrated. If this analysis is demonstrably incorrect, please needinfo :tjr.
Updated•4 months ago
|
Updated•1 month ago
|
Description
•