Skip to content

[ci skip] firefox: fix GMP plugin sandboxing on musl - #62823

Open
Gorggg wants to merge 1 commit into
void-linux:masterfrom
Gorggg:firefox-gmp-sandbox
Open

Gorggg wants to merge 1 commit into
void-linux:masterfrom
Gorggg:firefox-gmp-sandbox

Conversation

@Gorggg

@Gorggg Gorggg commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Prior to this change, Gecko Media Plugins would crash on musl platforms, as these plugins are often distributed at runtime as binaries compiled against glibc. For example, attempts to stream DRM content would result in the error "The WidevineCdm plugin has crashed" and a failure to stream.

Existing solutions I have encountered involve manually patching plugins to use gcompat and disabling the GMP sandbox, like so: https://gist.github.com/leso-kn/1f12d794df5bb1471aa7c2210f1e8669

Add a dependency on gcompat for musl platforms so that Gecko Media Plugins may work, and modify the GMP sandbox so that the requisite symbols and libraries from gcompat are preloaded. Preload within the GMP child process so that the resultant symbols only apply to it and the plugin, not interfering with the rest of the browser. This eliminates the need for manually patching the plugin and allows the GMP sandbox to continue to be used, preserving the prevention of fingerprinting as described here: https://hacks.mozilla.org/2014/05/reconciling-mozillas-mission-and-w3c-eme/

I apologize if this is not the optimal approach to address this issue, and please let me know if there is anything I can clarify. If this change is found to be desirable, I could try applying a similar change to the firefox-esr package.

Testing the changes

  • I tested the changes in this PR: YES

Local build testing

  • I built this PR locally for my native architecture, (x86_64-musl, x86_64)
  • I built this PR locally for these architectures (if supported. mark crossbuilds):
    • armv7l (cross-built)
    • armv7l-musl (cross-built)

@Gorggg
Gorggg force-pushed the firefox-gmp-sandbox branch from 2422bf5 to 3b2e8cd Compare October 2, 2026 02:13
Prior to this change, GMP plugins (such as WidevineCdm) would crash on
musl platforms due to missing symbols and libraries, as these plugins
are compiled with glibc and distributed as binaries.

Modify the sandbox launch process to load gcompat and gcompat's
simulated glibc dynamic linker to allow GMP plugins to work. This adds
a dependency on gcompat for musl platforms.
@Gorggg
Gorggg force-pushed the firefox-gmp-sandbox branch from 3b2e8cd to bd4c6fd Compare October 10, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant