mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3644] nvidia: opengl errors with nvidia proprietary driver due to "nogroups" #2294
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2294
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hlein on GitHub (Sep 24, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3644
With recent nvidia+opengl+firejail, opengl apps getting
nogroupsin their profile fail at startup, due to thevideogroup being required to access/dev/nvidia*. This might be similar to #841I discovered this with Chromium 85+, on Gentoo, but a very simple reproducer is:
With chromium and the default profiles, you will get errors like:
Chromium will start, but is super slow and pegs the CPU, so I guess without any acceleration.
I eventually figured out this is caused by not being able to access
/dev/nvidia*. On my system (elogind, no systemd) these are root:video mode 660, and console logins get 'video' group membership, but chromium-common.profile's 'nogroups' drops that.This setup worked w/o error a week ago, but I've updated multiple things since then that might be relevant - chromium, nvidia drivers, mesa probably, etc. Firejail has had 'nogroups' in chromium-common.profile forever, so it's one of the other things whose behavior has changed. Maybe chromium's startup process of its setuid & dropped-priv processes has changed in such a way that
nogroupsused to not apply to the GPU process and now it does (purely conjecture).Environment
0.9.62455.23.0420.2.0_rc4Additional context
firejail --ignore=nogroups chromiumbehaves fine@netblue30 commented on GitHub (Oct 2, 2020):
Question: is it /dev/nvidia or /dev/nvidia0? Can you do a "ls /dev | grep nvidia"? Thanks.
@hlein commented on GitHub (Oct 2, 2020):
There are several, all but
/dev/nvidia-caps/get group 'video':I have two cards, so that's likely the nvidiaN's, and I guess a single nvidiactl and nvidia-modeset created by the driver.
I have not tried giving access to only a subset of those (like, maybe write access to nvidiaN but not to nvidiactl would be sufficient?).
@netblue30 commented on GitHub (Oct 2, 2020):
Cool! I've just put a fix in - I disable nogroups automatically if a /dev/nvidiactl file is detected in the filesystem. Give it a try (after bringing back nogroups in your profile). We'll go with it in the next release, maybe we'll find later a better way to do it.
@hlein commented on GitHub (Oct 3, 2020):
@netblue30 that did it!
Applied that to 0.9.62.4 and rebuilt; now without passing --ignore=nogroups, at startup I see:
Warning: Warning: NVIDIA card detected, nogroups command disabledAnd there's no GL errors.
This does make me wonder a couple things, though:
systemd systems might get write access to /dev/nvidia* some other way, I don't know. It's possible this workaround isn't required when using systemd.
Is there any way, or an existing wishlist item, for keeping just a specific group but going ahead and dropping others? My UID has many supplemental groups; I would be glad to have firejail drop all of them except for the minimum required (video... maybe audio for /dev/snd/* ?) If that needs its own issue/discussion, since it's an enhancement not a bugfix, wfm.
@rusty-snake commented on GitHub (Oct 3, 2020):
@hlein #2042 #3169 #3303
@netblue30 What about
access("/dev/nvidiactl", R_OK) == 0 && arg_no3d == 0, so we only skipnogroupsif OpenGL/Vulkan/3D is allowed.@netblue30 commented on GitHub (Oct 3, 2020):
Good point! Thanks for the bug and testing @hlein, I'll close it for now. I'll have a test release out this weekend (0.9.64.rc1).
@s3rgeym commented on GitHub (Dec 1, 2021):
same shit
➜ firejail --version
firejail version 0.9.66
@kmk3 commented on GitHub (Dec 4, 2021):
@tz4678 commented on Dec 1:
What distro and version?
What's the output of
ls -l /dev/nvidia*?Could you build from #4732 and test to see if it makes any difference?
@hlein Do you still have this issue? If so, could you test as well?
@s3rgeym commented on GitHub (Dec 8, 2021):
@kmk3 commented on GitHub (Dec 8, 2021):
@tz4678 commented on Dec 8:
Weird, AFAIK they are usually owned by either the "render" or the "video" group
(example from this thread), unless you're not using (e)udev.
These might be normal.
What is the output of these commands:
For reference, this is the output on my system (using the path for AMD):
Is this normal Arch Linux or a derivative?
@s3rgeym commented on GitHub (Dec 8, 2021):
normal
i does not have logind