selinux-refpolicy/policy/modules
Krzysztof Nowicki 364621e6ec Allow use of systemd UNIX sockets created at initrd execution
Systemd uses a number of UNIX sockets for communication (notify
socket [1], journald socket). These sockets are normally created at
start-up after the SELinux policy is loaded, which means that the
kernel socket objects have proper security contexts of the creating
processes.

Unfortunately things look different when the system is started with an
initrd that is also running systemd (e.g. dracut). In such case the
sockets are created in the initrd systemd environment before the
SELinux policy is loaded and therefore the socket object is assigned
the default kernel context (system_u:system_r:kernel_t). When the
initrd systemd transfers control to the main systemd the notify socket
descriptors are passed to the main systemd process [2]. This means
that when the main system is running the sockets will use the default
kernel securint context until they are recreated, which for some
sockets (notify socket) never happens.

Until there is a way to change the context of an already open socket
object all processes, that wish to use systemd sockets need to be
able to send datagrams to system_u:system_r:kernel_t sockets.

Parts of this workaround were earlier hidden behind RedHat-specific
rules, since this distribution is the prime user of systemd+dracut
combo. Since other distros may want to use similar configuration it
makes sense to enable this globally.

[1] sd_notify(3)
[2] https://github.com/systemd/systemd/issues/16714

Signed-off-by: Krzysztof Nowicki <krissn@op.pl>

tmp
2021-02-09 13:24:51 +01:00
..
admin Bump module versions for release. 2021-02-03 08:38:26 -05:00
apps Bump module versions for release. 2021-02-03 08:38:26 -05:00
kernel Allow use of systemd UNIX sockets created at initrd execution 2021-02-09 13:24:51 +01:00
roles Bump module versions for release. 2021-02-03 08:38:26 -05:00
services dovecot, postfix: Module version bump. 2021-02-03 13:05:46 -05:00
system Allow use of systemd UNIX sockets created at initrd execution 2021-02-09 13:24:51 +01:00