]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
selinux: relax error handling in permissive mode (#36929)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 31 Jul 2026 03:49:14 +0000 (12:49 +0900)
committerGitHub <noreply@github.com>
Fri, 31 Jul 2026 03:49:14 +0000 (12:49 +0900)
Error returned from security_compute_create_raw() means that kernel
couldn't compute target context. Very likely because file context is not
known to the policy, i.e. security.selinux xattr contains some garbage
value and we are running in permissive mode, otherwise returned context
would be "unlabeled_t" instead of getting an error.

mac_selinux_get_create_label_from_exe() is used to figure out create
label for socket units and we fail to start the socket if we can't
figure out that label.

However, it may be necessary to start some sockets in order to get to
the point when we launch the service that relabels (in permissive mode)
the entire filesystem and reboots.


Trivial merge