mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4951] nogroups still drops audio group and all other supplementary groups. #2830
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#2830
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 @crocket on GitHub (Feb 16, 2022).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4951
Description
I thought nogroups wasn't going to drop audio group on firejail 0.9.68.
But, I was wrong.
Steps to Reproduce
Expected behavior
Relevant supplementary groups should be preserved.
Actual behavior
Only user's primary group is preserved.
Behavior without a profile
The same
Environment
@reinerh commented on GitHub (Feb 16, 2022):
I don't know why you expect that. That's not what I would expect, and it's also documented differently:
I don't think
--nogroupsshould be changed to mean "no groups except of some groups that some users might want to keep".@rusty-snake commented on GitHub (Feb 16, 2022):
#4725, #4732, #4603
271edbbcf5/RELNOTES (L32-L35)👍
:+2:
https://github.com/netblue30/firejail/pull/4725#issuecomment-982898312
@reinerh commented on GitHub (Feb 16, 2022):
Thanks. Somehow I missed that change. We should at least fix the manpage to document this new behaviour then.
@kmk3 commented on GitHub (Feb 17, 2022):
@rusty-snake commented on Feb 16:
I should have made it clearer in there that this only applies to systems not
running (e)logind.
Again, on a system where (e)logind is running, there should be no extra group
keeping at all with
nogroupscompared to 0.9.66. In fact, there should beless group keeping on such systems, as now the audio/video groups are not
always kept anymore when there is
noroot+ nonogroups; they are droppedwhen
noaudio/novideoare used in such case (see #4632).When
nogroupsis enabled, the changes in 0.9.68 should only affect systemsnot running (e)logind.
To reiterate, udev only applies seat-based ACLs if it detects that (e)logind is
running (and thus having supplementary groups is not necessary). If it does
not set up the ACLs, then keeping the supplementary groups is required for
basic group-related functionality (such as audio). Just like on systems with
nvidia, where disabling
nogroupsis required in order to have hardwareacceleration (this workaround was already being done in the code on 0.9.66).
Before 0.9.68, every user of e.g.: seatd would have to put
ignore nogroups(and maybe
ignore noroot) on e.g.: globals.local in order to have functioningaudio in the sandbox. With 0.9.68, it should work seamlessly. If that's not
the case, then it's a bug.
I think it would be easier to explain if everyone just read the code. The
relevant changes are minimal. Here they are, using the audio group as the
example:
Handling
noroot/nogroupson main.c (note that both code blocks are insideif (arg_noroot)):https://github.com/netblue30/firejail/blob/0.9.66/src/firejail/main.c#L3091-L3111
https://github.com/netblue30/firejail/blob/0.9.68/src/firejail/main.c#L3165-L3173
Dropping supplementary groups:
https://github.com/netblue30/firejail/blob/0.9.66/src/firejail/util.c#L119-L146
https://github.com/netblue30/firejail/blob/0.9.68/src/firejail/util.c#L182-L202
This is what disables
nogroupson 0.9.66 (nvidia + nono3d):https://github.com/netblue30/firejail/blob/0.9.66/src/firejail/profile.c#L413-L422
This is what disables
nogroupson 0.9.68 ((nvidia + nono3d) or no (e)logind):https://github.com/netblue30/firejail/blob/0.9.68/src/firejail/util.c#L106-L139
What do you want to do then? Drop both workarounds, including the nvidia one?
That might make the code and the documentation simpler, but personally I don't
think that such changes would be that significant to warrant having audio
and/or hardware acceleration broken by default on every program on a
non-trivial amount of systems.
@crocket commented on GitHub (Feb 17, 2022):
Suddenly,
nogroupsdoesn't drop audio and video groups without profile.This issue occurs with librewolf.profile.
@crocket commented on GitHub (Feb 17, 2022):
Suddenly, librewolf stopped requiring
ignore nogroupsfor audio group.When I execute anki, I see this.
@rusty-snake commented on GitHub (Feb 17, 2022):
#4930 and #4933
@crocket commented on GitHub (Mar 10, 2022):
https://git.sr.ht/~kennylevinsen/pam_uaccess replaces logind's uaccess functionality.
@amano-kenji commented on GitHub (Mar 29, 2023):
This is still a problem. I use seatd and have to have
ignore nogroupsandignore norootinglobals.local.It seems to me that
nogroupsis still broken with regard to supplementary groups. Appimage also drops supplementary groups.@amano-kenji commented on GitHub (Mar 29, 2023):
I think
f95bbb6f6e/src/firejail/util.c (L107-L127)is the problem.
Despite my efforts to disable elogind on my system, it is still installed and running alongside seatd.
However, seat-based ACL doesn't seem to be working because sway is using seatd on gentoo linux for seat management.
@amano-kenji commented on GitHub (Mar 29, 2023):
elogind is not launched automatically during boot and sway login. But, it was launched at some point by some program?
@amano-kenji commented on GitHub (Mar 29, 2023):
I finally figured out what launched elogind.
dino.profile has the following lines that cause system d-bus to launch elogind.
After elogind appears, appimage loses access to ALSA devices and input devices with or without
in
globals.local. However, after elogind appears,ignore norootandignore nogroupsare required inglobals.localfor various ALSA clients to access audio.After killing elogind and deleting
/run/systemd, appimage has access to devices again, andignore norootandignore nogroupsare not required inglobals.local.@amano-kenji commented on GitHub (Mar 29, 2023):
Adding
to
globals.localprevents elogind from being launched unwittingly. Having to figure out this little detail accidentally is infuriating. I'm furious.@amano-kenji commented on GitHub (Mar 29, 2023):
What should we do about this?
@kmk3 commented on GitHub (Mar 29, 2023):
@amano-kenji on Mar 29:
Glad that at least a workaround was found.
@amano-kenji on Mar 29:
Checking for a path related to (e)logind is kind of a hack; it considers only
the most trivial case (whether elogind is/was running or not).
The more fool-proof way to do it would be to detect whether dynamic user ACLs /
uaccess is in effect.
Though no idea what would be the proper way to check for it.
The following excerpts explain how the permissions are supposed to work with
udev/logind:
From https://wiki.archlinux.org/title/udev#Allowing_regular_users_to_use_devices:
From https://wiki.archlinux.org/title/Users_and_groups#Pre-systemd_groups:
Related:
Also, keep in mind that this may be used instead:
@crocket on Mar 10, 2022:
@amano-kenji commented on GitHub (Mar 30, 2023):
Today, I discovered that
ignore norootandignore nogroupsare still required for ALSA even though elogind is not running.I saw
with qutebrowser.profile. mpv.profile doesn't require
ignore norootandignore nogroupsfor ALSA.@amano-kenji commented on GitHub (Mar 30, 2023):
It turns out that qutebrowser.profile was dropping supplementary groups with
norootbecause it didn't have /etc/group in the sandbox.Adding
private-etc grouptoqutebrowser.localprevents qutebrowser.profile from dropping all supplementary groups.Why are supplementary groups so fragile?