nixpkgs/nixos/modules/security/wrappers
Robert Obryk c64bbd4466 nixos/security/wrappers: remove all the assertions about readlink(/proc/self/exe)
Given that we are no longer inspecting the target of the /proc/self/exe
symlink, stop asserting that it has any properties. Remove the plumbing
for wrappersDir, which is no longer used.

Asserting that the binary is located in the specific place is no longer
necessary, because we don't rely on that location being writable only by
privileged entities (we used to rely on that when assuming that
readlink(/proc/self/exe) will continue to point at us and when assuming
that the `.real` file can be trusted).

Assertions about lack of write bits on the file were
IMO meaningless since inception: ignoring the Linux's refusal to honor
S[UG]ID bits on files-writeable-by-others, if someone could have
modified the wrapper in a way that preserved the capability or S?ID
bits, they could just remove this check.

Assertions about effective UID were IMO just harmful: if we were
executed without elevation, the caller would expect the result that
would cause in a wrapperless distro: the targets gets executed without
elevation. Due to lack of elevation, that cannot be used to abuse
privileges that the elevation would give.

This change partially fixes #98863 for S[UG]ID wrappers. The issue for
capability wrappers remains.
2023-08-27 14:10:38 +02:00
..
default.nix nixos/security/wrappers: remove all the assertions about readlink(/proc/self/exe) 2023-08-27 14:10:38 +02:00
wrapper.c nixos/security/wrappers: remove all the assertions about readlink(/proc/self/exe) 2023-08-27 14:10:38 +02:00
wrapper.nix nixos/security/wrappers: remove all the assertions about readlink(/proc/self/exe) 2023-08-27 14:10:38 +02:00