[GH-ISSUE #3110] mupdf: profile does not work for mupdf-gl #1948

Closed
opened 2026-05-05 08:36:53 -06:00 by gitea-mirror · 11 comments
Owner

Originally created by @q3cpma on GitHub (Jan 3, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3110

Hello,

I've found that the mupdf profile was probably made for the mupdf-x11 only and didn't work with mupdf-gl one, which is becoming the standard. To "fix" it, you need to remove private-etc alternatives,fonts, otherwise I get:

libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib64/dri)
libGL error: failed to load driver: radeonsi
libGL error: failed to open /dev/dri/card0: Permission denied
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib64/dri)
libGL error: failed to load driver: swrast

which is strange.

And memory-deny-write-execute just makes it freeze during loading.

I guess the profile should handle the whole different binary thing, but I'm not sure why that private-etc would break things like this.

Originally created by @q3cpma on GitHub (Jan 3, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3110 Hello, I've found that the mupdf profile was probably made for the `mupdf-x11` only and didn't work with `mupdf-gl` one, which is becoming the standard. To "fix" it, you need to remove `private-etc alternatives,fonts`, otherwise I get: ``` libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib64/dri) libGL error: failed to load driver: radeonsi libGL error: failed to open /dev/dri/card0: Permission denied libGL error: failed to load driver: radeonsi libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib64/dri) libGL error: failed to load driver: swrast ``` which is strange. And `memory-deny-write-execute` just makes it freeze during loading. I guess the profile should handle the whole different binary thing, but I'm not sure why that private-etc would break things like this.
Author
Owner

@q3cpma commented on GitHub (Jan 3, 2020):

Oh yeah, I'm using firejail 0.9.62 on Gentoo.

<!-- gh-comment-id:570514048 --> @q3cpma commented on GitHub (Jan 3, 2020): Oh yeah, I'm using firejail 0.9.62 on Gentoo.
Author
Owner

@rusty-snake commented on GitHub (Jan 3, 2020):

Thx for the rerport

And memory-deny-write-execute just makes it freeze during loading.

We should commentd mdwe and leave a note.

To "fix" it, you need to remove private-etc alternatives,fonts

This is a very short private-etc line, we should extend it to fix it. Can you run firejail --build mupdf-gl and post the private-etc line from the output (it is at the end of this huge output).

<!-- gh-comment-id:570525541 --> @rusty-snake commented on GitHub (Jan 3, 2020): Thx for the rerport > And `memory-deny-write-execute` just makes it freeze during loading. We should commentd mdwe and leave a note. > To "fix" it, you need to remove `private-etc alternatives,fonts` This is a very short private-etc line, we should extend it to fix it. Can you run `firejail --build mupdf-gl` and post the private-etc line from the output (it is at the end of this huge output).
Author
Owner

@q3cpma commented on GitHub (Jan 3, 2020):

On Fri, Jan 03, 2020 at 02:03:07AM -0800, rusty-snake wrote:

Thx for the rerport

And memory-deny-write-execute just makes it freeze during loading.

We should commentd mdwe and leave a note.

To "fix" it, you need to remove private-etc alternatives,fonts

This is a very short private-etc line, we should extend it to fix it. Can you run firejail --build mupdf-gl and post the private-etc line from the output (it is at the end of this huge output).

It produces private-etc passwd,drirc,. Really don't know where it comes from, that problem existed with qtwebengine at some point because /usr/lib/llvm/* wasn't properly whitelisted.

<!-- gh-comment-id:570535908 --> @q3cpma commented on GitHub (Jan 3, 2020): On Fri, Jan 03, 2020 at 02:03:07AM -0800, rusty-snake wrote: > Thx for the rerport > > > > And `memory-deny-write-execute` just makes it freeze during loading. > > We should commentd mdwe and leave a note. > > > To "fix" it, you need to remove `private-etc alternatives,fonts` > > This is a very short private-etc line, we should extend it to fix it. Can you run `firejail --build mupdf-gl` and post the private-etc line from the output (it is at the end of this huge output). It produces `private-etc passwd,drirc,`. Really don't know where it comes from, that problem existed with qtwebengine at some point because `/usr/lib/llvm/*` wasn't properly whitelisted.
Author
Owner

@rusty-snake commented on GitHub (Jan 3, 2020):

Can you try with private-etc alternatives,fonts,drirc and if this does not work add passwd. /etc/drirc contains infos/configs about "drivers".

08d9927942/etc/templates/profile.template (L169)

<!-- gh-comment-id:570537304 --> @rusty-snake commented on GitHub (Jan 3, 2020): Can you try with `private-etc alternatives,fonts,drirc` and if this does not work add `passwd`. /etc/drirc contains infos/configs about "drivers". https://github.com/netblue30/firejail/blob/08d99279428041f20f922c7df2c9df574ec34bda/etc/templates/profile.template#L169
Author
Owner

@q3cpma commented on GitHub (Jan 3, 2020):

On Fri, Jan 03, 2020 at 02:45:40AM -0800, rusty-snake wrote:

Can you try with private-etc alternatives,fonts,drirc and if this does not work add passwd. /etc/drirc contains infos/configs about "drivers".

Doesn't work. By adding ld.so.cache to private-etc, it does. There's probably a mesa/opengl specific incl to use to get it, right?

<!-- gh-comment-id:570544203 --> @q3cpma commented on GitHub (Jan 3, 2020): On Fri, Jan 03, 2020 at 02:45:40AM -0800, rusty-snake wrote: > Can you try with `private-etc alternatives,fonts,drirc` and if this does not work add `passwd`. /etc/drirc contains infos/configs about "drivers". Doesn't work. By adding ld.so.cache to private-etc, it does. There's probably a mesa/opengl specific incl to use to get it, right?
Author
Owner

@rusty-snake commented on GitHub (Jan 3, 2020):

Does this work? private-etc alternatives,fonts,drirc,glvnd,bumblebee,nvidia,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload

<!-- gh-comment-id:570544716 --> @rusty-snake commented on GitHub (Jan 3, 2020): Does this work? `private-etc alternatives,fonts,drirc,glvnd,bumblebee,nvidia,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload`
Author
Owner

@q3cpma commented on GitHub (Jan 3, 2020):

Yes, but like I said, I only needed ld.so.cache (should probably add ld.*). But it looks like a hack to specify it that way.

<!-- gh-comment-id:570545524 --> @q3cpma commented on GitHub (Jan 3, 2020): Yes, but like I said, I only needed `ld.so.cache` (should probably add ld.*). But it looks like a hack to specify it that way.
Author
Owner

@q3cpma commented on GitHub (Jan 3, 2020):

Ah, looks like there's no common file for it, indeed.

<!-- gh-comment-id:570545857 --> @q3cpma commented on GitHub (Jan 3, 2020): Ah, looks like there's no common file for it, indeed.
Author
Owner

@q3cpma commented on GitHub (Jan 3, 2020):

Now, the real problem is that firejail should use $(basename -- "$(readlink -f -- "$1")") as binary name to find the appropriate profile, then use the symlink name.

<!-- gh-comment-id:570546625 --> @q3cpma commented on GitHub (Jan 3, 2020): Now, the real problem is that firejail should use `$(basename -- "$(readlink -f -- "$1")")` as binary name to find the appropriate profile, then use the symlink name.
Author
Owner

@rusty-snake commented on GitHub (Jan 3, 2020):

Yes, but like I said, I only needed ld.so.cache (should probably add ld.*). But it looks like a hack to specify it that way.

So for you it is private-etc alternatives,fonts,ld.so.cache, right?

<!-- gh-comment-id:570591144 --> @rusty-snake commented on GitHub (Jan 3, 2020): > Yes, but like I said, I only needed `ld.so.cache` (should probably add ld.*). But it looks like a hack to specify it that way. So for you it is `private-etc alternatives,fonts,ld.so.cache`, right?
Author
Owner

@q3cpma commented on GitHub (Jan 3, 2020):

On Fri, Jan 03, 2020 at 06:43:05AM -0800, rusty-snake wrote:

Yes, but like I said, I only needed ld.so.cache (should probably add ld.*). But it looks like a hack to specify it that way.

So for you it is private-etc alternatives,fonts,ld.so.cache, right?

Yes, but I added the rest of ld.*. The .cache might disappear anytime.

<!-- gh-comment-id:570604778 --> @q3cpma commented on GitHub (Jan 3, 2020): On Fri, Jan 03, 2020 at 06:43:05AM -0800, rusty-snake wrote: > > Yes, but like I said, I only needed `ld.so.cache` (should probably add ld.*). But it looks like a hack to specify it that way. > > So for you it is `private-etc alternatives,fonts,ld.so.cache`, right? Yes, but I added the rest of ld.*. The .cache might disappear anytime.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#1948
No description provided.