-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add missing SELinux directives #1031
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to recompile the policy file and make sure I get the same output. done. I have a ping out to a buddy, hoping to get a bit of secondary feedback on this. If I don't hear back soon let's go ahead with it.
} No newline at end of file | ||
type default_t; | ||
type init_t; | ||
class lnk_file read; | ||
} | ||
|
||
allow init_t default_t:lnk_file read; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surely no expert with SELinux, so this might be an obvious question but ... did this policy do anything before? Why did we have it? Yes. The relevant pieces are in the associated .fc file.
putting a public note here so I remember -- giving init_t full access to read default_t:lnk_file is probably not the "most correct" solution, as it is overly broad, despite being the solution recommended by |
Yeah there is almost certainly a more targeted policy that could be used, in fact I see a few places where the $ ls -lZ /nix/var/nix/profiles/default
lrwxrwxrwx - root system_u:object_r:bin_t:s0 31 Dec 1969 bin -> /nix/store/00dc6iygj63mjcmixki1vwg7m1jbdi9p-nix-2.21.2/bin
dr-xr-xr-x - root system_u:object_r:etc_t:s0 31 Dec 1969 etc
lrwxrwxrwx - root system_u:object_r:lib_t:s0 31 Dec 1969 lib -> /nix/store/00dc6iygj63mjcmixki1vwg7m1jbdi9p-nix-2.21.2/lib
lrwxrwxrwx - root system_u:object_r:default_t:s0 31 Dec 1969 libexec -> /nix/store/00dc6iygj63mjcmixki1vwg7m1jbdi9p-nix-2.21.2/libexec
lrwxrwxrwx - root system_u:object_r:default_t:s0 31 Dec 1969 manifest.nix -> /nix/store/3681kssclgak8rcvk9a0jhbpfcmm3sjq-env-manifest.nix
lrwxrwxrwx - root system_u:object_r:usr_t:s0 31 Dec 1969 share -> /nix/store/00dc6iygj63mjcmixki1vwg7m1jbdi9p-nix-2.21.2/share Back to the original issue, I'm not sure exactly why that symlink was labeled
|
The Determinate Systems installer turns automatic store optimization on. SELinux labels files, not paths. So when two identical files get hard‐linked together, labels can get messed up. |
That's very helpful to know, thanks @emilazy ! |
It sounds like the optimize process either just needs to learn to |
I believe that |
Ah ok, that makes sense thanks! Yeah I don't know of a way out that conundrum since from what I understand; SELinux just labels based off "last matched" when it comes to multiple links point to the same inode. There is an option to hard error (i.e. |
I think the installer should just turn off |
Description
Fixes #1030
On a Fedora 40 system where
/nix
is a ZFS dataset there were several missing SELinux directives.Checklist
cargo fmt
nix build
nix flake check