From 277f05872f8d5c0dfc0da29d5a67cc01961c8bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 5 Apr 2022 10:24:27 +0200 Subject: [PATCH 1/3] README: say kernel 4.15 is the minimum recommended After various long discussions (https://lists.freedesktop.org/archives/systemd-devel/2022-March/047587.html, https://lwn.net/Articles/889610/), there is no clear answer what the minimum version should be. Bumping the version above 3.15 doesn't allow us to make any significant simplifications (unless we went *much* higher). In particular, even renameat2() is not fully supported with latest kernel versions, e.g. nfs still doesn't have it. And the bpf stuff is optional anyway. So let's just say that 4.15 is what we recommend, because it provides fairly complete cgroups-v2, but without any removals of compat in the code. --- README | 23 +++++++++++++++-------- src/basic/def.h | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README b/README index 420276eda8..06c54e04d7 100644 --- a/README +++ b/README @@ -30,14 +30,21 @@ LICENSE: LGPL-2.1-or-later for all code, exceptions noted in LICENSES/README.md REQUIREMENTS: - Linux kernel >= 3.15 - Linux kernel >= 4.2 for unified cgroup hierarchy support - Linux kernel >= 4.10 for cgroup-bpf egress and ingress hooks - Linux kernel >= 4.15 for cgroup-bpf device hook - Linux kernel >= 4.17 for cgroup-bpf socket address hooks - Linux kernel >= 5.3 for bounded-loops in BPF program - Linux kernel >= 5.4 for signed Verity images support - Linux kernel >= 5.7 for BPF links and the BPF LSM hook + Linux kernel ≥ 3.15 + ≥ 4.5 for pids controller in cgroup v2 + ≥ 4.6 for cgroup namespaces + ≥ 4.9 for RENAME_NOREPLACE support in vfat + ≥ 4.10 for cgroup-bpf egress and ingress hooks + ≥ 4.15 for cgroup-bpf device hook and cpu controller in cgroup v2 + ≥ 4.17 for cgroup-bpf socket address hooks + ≥ 5.3 for bounded loops in BPF program + ≥ 5.4 for signed Verity images + ≥ 5.7 for BPF links and the BPF LSM hook + + Kernel versions below 4.15 have significant gaps in functionality and + are not recommended for use with this version of systemd. Taint flag + 'old-kernel' will be set. Systemd will most likely still function, but + upstream support and testing are limited. Kernel Config Options: CONFIG_DEVTMPFS diff --git a/src/basic/def.h b/src/basic/def.h index 54a82c7c49..0a1ae023a3 100644 --- a/src/basic/def.h +++ b/src/basic/def.h @@ -74,4 +74,4 @@ /* Path where systemd-oomd listens for varlink connections from user managers to report changes in ManagedOOM settings. */ #define VARLINK_ADDR_PATH_MANAGED_OOM_USER "/run/systemd/oom/io.system.ManagedOOM" -#define KERNEL_BASELINE_VERSION "3.15" +#define KERNEL_BASELINE_VERSION "4.15" From 88a3af9421dd8d6bf0caabee2486c9ab1b1d6d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 5 Apr 2022 20:31:03 +0200 Subject: [PATCH 2/3] README: describe taint flags and how to check them We should have this somewhere. We talk about versions of things in the README, so it seems as good a place as any. --- README | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/README b/README index 06c54e04d7..4c9d9ae1bd 100644 --- a/README +++ b/README @@ -337,24 +337,41 @@ SYSV INIT.D SCRIPTS: Please see src/systemctl/systemd-sysv-install.SKELETON for how this needs to look like, and provide an implementation at the marked places. -WARNINGS: +WARNINGS and TAINT FLAGS: systemd will warn during early boot if /usr is not already mounted at this point (that means: either located on the same file system as / or already mounted in the initrd). While in systemd itself very little - will break if /usr is on a separate, late-mounted partition, many of - its dependencies very likely will break sooner or later in one form or + will break if /usr is on a separate late-mounted partition, many of its + dependencies very likely will break sooner or later in one form or another. For example, udev rules tend to refer to binaries in /usr, binaries that link to libraries in /usr or binaries that refer to data files in /usr. Since these breakages are not always directly visible, - systemd will warn about this, since this kind of file system setup is - not really supported anymore by the basic set of Linux OS components. - - systemd requires that the /run mount point exists. systemd also - requires that /var/run is a symlink to /run. + systemd will warn about this. Such setups are not really supported by + the basic set of Linux OS components. Taint flag 'split-usr' will be + set when this condition is detected. For more information on this issue consult https://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken + systemd requires that the /run mount point exists. systemd also + requires that /var/run is a symlink to /run. Taint flag 'var-run-bad' + will be set when this condition is detected. + + Systemd will also warn when the cgroup support is unavailable in the + kernel (taint flag 'cgroups-missing'), the system is using the old + cgroup hierarchy (taint flag 'cgroupsv1'), the hardware clock is + running in non-UTC mode (taint flag 'local-hwclock'), the kernel + overflow UID or GID are not 65534 (taint flags 'overflowuid-not-65534' + and 'overflowgid-not-65534'), the UID or GID range assigned to the + running systemd instance covers less than 0…65534 (taint flags + 'short-uid-range' and 'short-gid-range'). + + Taint conditions are logged during boot, but may also be checked at any + time with: + + busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Tainted + +VALGRIND: To run systemd under valgrind, compile with meson option -Dvalgrind=true and have valgrind development headers installed (i.e. valgrind-devel or equivalent). Otherwise, false positives will be From 2c75ef181d3c0e11ee0d5b4f49a8df4dfc3f3ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 5 Apr 2022 20:31:59 +0200 Subject: [PATCH 3/3] manager: fix typo I guess that we could make an overflow if all the taint flags were set. --- src/core/manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/manager.c b/src/core/manager.c index e92004edf3..9d82537407 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -4384,7 +4384,7 @@ char *manager_taint_string(Manager *m) { buf = new(char, sizeof("split-usr:" "cgroups-missing:" - "cgrousv1:" + "cgroupsv1:" "local-hwclock:" "var-run-bad:" "overflowuid-not-65534:"