1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00
Commit Graph

74805 Commits

Author SHA1 Message Date
Yu Watanabe
8c31367d23 nspawn: mount /var/ after remount_idmap() when --volatile=state
Previously, remount_idmap() failed as /var/ was already mounted, thus
remounting (strictly speaking, unmounting old root directory) failed
with -EBUSY.

As tmpfs /var/ is mounted with picked UID shift, it should not be
remounted with idmap, but needs to be mounted after the root directory
being remounted.

This makes '-U --volatile=state' work as expected.

(cherry picked from commit 2c2511aa73)
2024-10-08 16:39:12 +01:00
Yu Watanabe
8aedc1fe29 nspawn: use strv_extend() and friends to build directories passed to remount_idmap()
No functional change, just refactoring and preparation for later change.

(cherry picked from commit 21cd84df69)
2024-10-08 16:39:12 +01:00
Lennart Poettering
c5169b4441 meson: tweak meson conditionalization for ssh{d,}_config drop-ins
Let's make sure "no" is an acceptable setting for these paths.

(cherry picked from commit a8ea7c1940)
2024-10-08 16:39:12 +01:00
Ronan Pigott
5dc97968d6 load-fragment: terminate the specifier table (#34421)
Otherwise an invalid specifier iterates over uninitialized data.

Fixes a bug introduced by 0b40688d18 (v254).

(cherry picked from commit 32b8065e87)
2024-10-08 16:39:12 +01:00
Mike Yuan
4296a567d4 various: correct laccess() error check
laccess is our own macro that uses RET_NERRNO.

(cherry picked from commit 7c1dd9e288)
2024-10-08 16:39:12 +01:00
Daan De Meyer
902877d55e Fix generator logging
log_setup() overrides the previously set log target again so we
can't use it in log_setup_generator().

Follow-up for aa976d8788

(cherry picked from commit b3ebd480d6)
2024-10-08 16:39:12 +01:00
Luca Boccassi
86a9eea94c mkosi: update debian commit reference
* cb00be93e5 Upstream profile: skip dh_strip_nondeterminism
* c948e192a8 autopkgtest: skip gdm3 on armel for smoke tests
* e12116becb initramfs-tools: ensure rules file exists before invoking chzdev
* c8904f67e9 Filter out zdev rules in the initramfs hook (LP: #2044104)
* 9967984fc8 salsa-ci: test the stage1 build profile
* 2c81f4a6cc d/e/checkout-upstream: undo quilt patches before switching debian branch
* e75197fa10 d/e/checkout-upstream: do not rebase on main when building stable branches
* 7989319bca Drop patch merged upstream
* b7127a0725 Depend on new linux-bpf-dev package where available
* 7966d2543f autopkgtest: use hint-testsuite-triggers to ensure other packages changes trigger our testsuite
* 777af76cae autopkgtest: run upstream test last
* f257c53fe3 Stop installing legaly pkla file in upstream CI too
* a4b54fd693 Use d/not-installed instead of manual removals
* e0fdbb4496 Stop shipping empty /etc/init.d directory
* 202c7fc8f9 Use debian/clean instead of override in d/rules
* ba81ea64a6 Drop redundant pot build
* 9152d0e064 autopkgtest: allow localectl in localed tests
* 319a078b8e Fix D-Bus policy for locale1 blocking
* 28daa8b37b Drop last patch, all merged upstream
* 7bf7bf6f4e Drop out-of-tree localed patch and use D-Bus policy instead
* 409028b7e6 Drop /etc/sysctl.d/99-sysctl.conf symlink
* 6f37d3cb3e d/e/checkout-upstream: switch packaging branch on upstream stable PRs
* b7e53c00b2 d/e/checkout-upstream: do not fail if rebase fails
* 1364bb81d4 d/e/checkout-upstream: fix shellcheck warnings
* 796d133b0c initramfs-tools: copy network drop-ins too
2024-10-08 16:39:12 +01:00
Luca Boccassi
906a3d37ce mkosi: mark test as skipped when QEMU crashes
On Ubuntu/Debian infrastructure QEMU crashes a lot, so mark the test
as skipped in that case as there's nothing we can do about it and
we shouldn't mark runs as failed

(cherry picked from commit 0d7f5a9ae6)
2024-10-08 16:39:12 +01:00
Luca Boccassi
966d8a90ca semaphore: do not build docs
There are other CI runs that build manpages, speed up build which is close to 1hr limit

(cherry picked from commit d58a904d35)
2024-10-08 16:39:12 +01:00
Luca Boccassi
52afaa8034 semaphore: stop building and running extra unit tests
This slows down the build, which is often near the 1hr limit. There are
other jobs running the extra unit tests.

(cherry picked from commit 3bc5480bac)
2024-10-08 16:39:12 +01:00
Luca Boccassi
bc0102b0ca Semaphore: switch from /tmp to /var/tmp to avoid disk space issues
Builds have been failing as we run out of space in /tmp/, move to
/var/tmp

(cherry picked from commit 0c7b5dad33)
2024-10-08 16:39:12 +01:00
Thomas Blume
7c399a4003 test: set TEST_NESTED_KVM as default
(cherry picked from commit 5540c37bb8)
2024-10-08 16:39:12 +01:00
Daan De Meyer
8bf57b2f83 mkosi: Switch to Fedora 41
It's due for release soon and will fix the flakyness of TEST-58-REPART
so let's bump the Fedora 40 job to Fedora 41.

(cherry picked from commit 12a1b02b52)
2024-10-08 16:39:12 +01:00
Lukas Nykryn
7ac58949a3 core: warn if a generator is world-writable
... because that is obviously a security risk.

(cherry picked from commit da32cac8a0)
2024-10-08 16:39:12 +01:00
Yu Watanabe
7b9e412d8a test: add test case for issue #34637
(cherry picked from commit 88d186e482)
2024-10-08 16:39:12 +01:00
Yu Watanabe
02a5e5a323 udev-node: skip stack directory creation for diskseq
The disk/by-diskseq symlink should not be shared with multiple block
devices. Hence, it is not necessary to create stack directory for the
symlink that manages which device owns the symlink.

This is not just a optimization.
If a service unit tries to mount a disk image but the service fails, then
the diskseq of the loop device for the image may be continuously increased
during restart, and inodes in /run may increase rapidly, as the stack
directories are cleaned up only when udev queue is empty.

Fixes #34637.

(cherry picked from commit 09373c1a50)
2024-10-08 16:39:12 +01:00
Daniel Martinez
d65b7426e9 Use case insensitive comparison for the machine's architechture
boot loader specification states:

architecture: refers to the architecture this entry is for. The argument
should be an architecture identifier, using the architecture vocabulary
defined by the EFI specification (i.e. IA32, x64, IA64, ARM, AA64, …).
If specified and it does not match the local system architecture this
entry should be hidden. The comparison should be done case-insensitively.

Example: architecture aa64

https://uapi-group.org/specifications/specs/boot_loader_specification/#type-1-boot-loader-entry-keys
(cherry picked from commit f819a516db)
2024-10-08 16:39:12 +01:00
Michal Koutný
84cd501ae4 test: Add test for per-device cgroup properties
Reported in #34126

(cherry picked from commit 3216377433)
2024-10-08 16:39:12 +01:00
Daan De Meyer
83f7bced66 chase: Fix shortcut
We can't shortcut chaseat() if CHASE_PARENT is set.

(cherry picked from commit 87333bd1dc)
2024-10-08 16:39:12 +01:00
Daan De Meyer
52fa3b52bd repart: Don't copy root directory mode from source file
If the source is a file, don't copy the mode and such from it to
the root directory, even if the target is /.

(cherry picked from commit 413d3ce1b7)
2024-10-08 16:39:12 +01:00
Jörg Behrmann
5b5f5666b2 man: Use proper conjunction and remove superfluous or
(cherry picked from commit 56f32d9e78)
2024-10-08 16:39:12 +01:00
Daan De Meyer
5a2e875837 repart: Handle empty arg_copy_source in file_is_denylisted()
(cherry picked from commit 7cd56ec951)
2024-10-08 16:39:12 +01:00
Luca Boccassi
1075727f7f man: consolidate list of active unit states into a shared table
Avoids the need to maintain the same list over and over again, and
link it to the defition table in the implementation as a reminder
too

(cherry picked from commit 3509fe124d)
2024-10-08 16:39:12 +01:00
Michael Ferrari
c3c4dfdfb1 repart: open target devices before UUID creation
This is to ensure that the UUIDs from the CopyBlocks= devices are copied
to the corresponding new partition instead of creating a new UUID for
it. With this verity partitions can be copied, keeping their UUIDs to
ensure that they still match up with what is specified in roothash=.

(cherry picked from commit f106fd2dbd)
2024-10-08 16:39:12 +01:00
Zbigniew Jędrzejewski-Szmek
0f716efc23 homectl: fix inverted table footer condition
Fixup for 2413a0fab4.

(cherry picked from commit 3be87dca03)
2024-10-08 16:39:12 +01:00
Daan De Meyer
7f6f146df6 nsresourced: Fix declaration of bpf_rdonly_cast()
Fixes compilation error

"""
[780/3171] /usr/bin/clang -std=gnu11 -Wno-compare-distinct-pointer-types -fno-stack-protector -O2 -target bpf -g -c -D__aarch64__ -I. -isystem /usr/include/ -idirafter /usr/include ../src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.c -o src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.unstripped.o -I/usr/src/kernels/6.11.1-0.hs1.hs+fb.el9.aarch64
FAILED: src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.unstripped.o
/usr/bin/clang -std=gnu11 -Wno-compare-distinct-pointer-types -fno-stack-protector -O2 -target bpf -g -c -D__aarch64__ -I. -isystem /usr/include/ -idirafter /usr/include ../src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.c -o src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.unstripped.o -I/usr/src/kernels/6.11.1-0.hs1.hs+fb.el9.aarch64
../src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.c:27:7: error: conflicting types for 'bpf_rdonly_cast'
   27 | void *bpf_rdonly_cast(void *, __u32) __ksym;
      |       ^
/usr/src/kernels/6.11.1-0.hs1.hs+fb.el9.aarch64/vmlinux.h:143063:14: note: previous declaration is here
 143063 | extern void *bpf_rdonly_cast(const void *obj__ign, u32 btf_id__k) __weak __ksym;
        |              ^
1 error generated.
"""

(cherry picked from commit 33f1c5287f)
2024-10-08 16:39:12 +01:00
Lukas Nykryn
adc57cd81c man: using WantedBy=default.target is not a good idea
We had several users, that wrote their unit files with
WantedBy=default.target because it should be started "every time".
But for example in Fedora/CentOS/RHEL, this often breaks for
example selinux relabels (where we just want to do a relabel and reboot).

(cherry picked from commit 67b6404b80)
2024-10-08 16:39:12 +01:00
Daan De Meyer
9f513b1397 mkosi: Stop installing bpftrace
bpftrace nudges the Fedora Rawhide images towards compiler-rt18 while the
sanitizer builds pull in clang19, leading to the sanitizer libraries
not being found at runtime. Let's drop bpftrace for now so that compiler-rt19
is pulled in in the main image.

(cherry picked from commit d98b6c66ff)
2024-10-08 16:39:12 +01:00
Daan De Meyer
fbdbe4334e mkosi: Pass ASAN_OPTIONS to subimages
systemd built with sanitizers is installed in subimages and tools
might get invoked in postinstall scripts so we have to disable ASAN
in the subimages as well during the image build.

(cherry picked from commit 345a4fcbb6)
2024-10-08 16:39:12 +01:00
Daan De Meyer
6c08649846 mkosi: Don't sync if the packaging specs repo is dirty
(cherry picked from commit 9c7762c943)
2024-10-08 16:39:12 +01:00
Daan De Meyer
e129e3a861 tree-wide: Fix Wformat warnings
The latest clang has started catching more integer promotions which
cause us to pass the wrong type to printf() format specifiers so let's
fix those.

(cherry picked from commit c73d14c43e)
2024-10-08 16:39:12 +01:00
Lennart Poettering
96c0549bda man: drop reference to /bin/ from docs regarding binary search path
We don't support "split /usr" systems anymore, hence no point in
mentioning /bin/ anymore as being part of the binary search path.

(cherry picked from commit f39e66b85a)
2024-10-08 16:39:12 +01:00
Lennart Poettering
aeda397aed man: soft deprecate use of ";" for separating multiple command lines in ExecStart=
So far we supported this syntax:

    ExecStart=foo ; bar

as equivalent to:

    ExecStart=foo
    ExecStart=bar

With this change we'll "soft" deprecate the first syntax. i.e. it's
still supported in code, but not documented anymore.

The concept was originally added to make things easier for 3rd party
.ini readers, as it allowed writing unit files with a .ini framework
that doesn't allow multiple assignments for the same key. But frankly,
this is kinda pointless, as so many other of our knobs require the
double assignment.

Hence, let's just stop advertising the concept, let's simplify the docs,
by removing one entirely redundant feature from it.

Replaces: #34570
(cherry picked from commit 225f18b9a9)
2024-10-08 16:39:12 +01:00
Lennart Poettering
e012eedd72 tree-wide: always do dlopen() with RTLD_NOW + RTLD_NODELETE
Let's systematically use RTL_NOW|RLTD_NODELETE as flags passed to
dlopen(), across our codebase.

Various distros build with "-z now" anyway, hence it's weird to specify
RTLD_LAZY trying to override that (which it doesn't). Hence, let's
follow suit, and just do what everybody else does.

Also set RTLD_NODELETE, which is apparently what distros will probably
end up implying sooner or later anyway. Given that for pretty much all
our dlopen() calls we never call dlclose() anyway, let's just set this
everywhere too, to make things systematic.

This way, the flags we use by default match what distros such as fedora
do, there are no surprises, and read-only relocations can be a thing.

Fixes: #34537
(cherry picked from commit bd4beaa2eb)
2024-10-08 16:39:12 +01:00
dependabot[bot]
915822604f build(deps): bump systemd/mkosi
Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from 2c9954fa51a3a995bbdc02db6ef51f5bd27bc1ba to 3454f7bd4ef0336ec80a117d593baaef0fe53398.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Commits](2c9954fa51...3454f7bd4e)

---
updated-dependencies:
- dependency-name: systemd/mkosi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 6aed4876e8)
2024-10-08 16:39:12 +01:00
Helmut Grohne
1bd02a6e04 bpf: fix cross build failure on Debian
For compiling bpf code, the system include directory needs to be
constructed. On Debian-like systems, this requires passing a multiarch
directory. Since clang's -dump-machine prints something other that the
multiarch triplet, gcc was interrogated earlier, but that also yields a
wrong result for cross compilation and was thus skipped resulting in
clang not finding asm/types.h.

Rather than, -dump-machine we should ask for -print-multiarch (which
rarely differs). Whenever gcc is in use, this is right (even for cross
building). Since clang does not support -print-multiarch and its
-dump-machine never matches Debian's multiarch, we resort to asking gcc
when building natively. For cross builds using clang, we are out of
luck.

(cherry picked from commit 608009dc62)
2024-10-08 16:39:12 +01:00
Marcel Hellwig
072ea04e26 Update sd_bus_message_append_array.xml
fix pointer constness in documentation

(cherry picked from commit fec09ff094)
2024-10-08 16:39:12 +01:00
Daan De Meyer
d1f11d909f Add %posttrans versions of the systemd %postun scriptlets
On upgrades, only the %postun scriptlets of the old package version
run. This means that any changes related to restarting daemons require
two releases before they're actually used.

%postun is used because it runs after the old package has been removed,
which is important as it means any lingering dropins from the old package
will have been removed as well.

To allow deploying fixes in just a single release while still running after
the old package has been removed, let's introduce %posttrans versions of these
scriptlets as %posttrans of the new package runs on upgrade and install after
the old package has been removed.

(cherry picked from commit 9fd8a9dffe)
2024-10-08 16:39:12 +01:00
Daniel Dawson
7323feef9b systemd-integritysetup: accept integrity-algorithm=xxhash64
Signed-off-by: Daniel Dawson <danielcdawson@gmail.com>
(cherry picked from commit 0c96911afb)
2024-10-08 16:39:12 +01:00
Lennart Poettering
4bdbfb3dd4 man: add a comment that inode type policy might be enforces via an LSM or similar
Just to tighten the language a bit, why people should care about where
they place their inodes.

(cherry picked from commit 5b53894123)
2024-10-08 16:39:12 +01:00
Lennart Poettering
c14890f588 man: clarify that the defined file hiearchy is just a skeleton
(And specifically mention /usr/include + /var/spool as not covered here,
but being OK to add downstream)

(cherry picked from commit fd6e079e7b)
2024-10-08 16:39:12 +01:00
Lennart Poettering
82783a3c5f man: drop /var/spool/ mention from file-hierarchy(7) man page
Today it seems this is mostly used by mail and printer servers, and it's
not clear to me at all what the property is that makes
/var/spool/<package> the better place for the relevant data than
/var/lib/<package>.

Hence, in the interest of shortening the spec, let's not mention the dir
anymore. In particular as the dir really isn't used by us much, for
example we do not have a counterpart for RuntimeDirectory=,
StateDirectory=, … that would cover the spool.

Since most systems these days we care about probably come *without* a
printer or mail server, let's maybe no mention this in the man page that
is supposed to discuss the rough skeleton how things are set up. After
all, people are supposed to exend the skeleton with their stuff, and
this sounds more like a case for an extension of the skeleton instead of
being considered part of the skeleton itself.

(cherry picked from commit b0201b36d2)
2024-10-08 16:39:12 +01:00
Lennart Poettering
e5ac408af7 man: drop mention of /usr/include/ from file-hierarchy(7) man page
The man page is supposed to provide a "generalized, though minimal and
modernized subset" (as per introductory pargapraghs), from a systemd
perspective. But the thing is that /usr/include/ really doesn't matter
to us. It's a development thing, and slightly weird (because it arguably
would be better places in /usr/share/include/ or so). It's not going to
be there on 95% of deployed systems, and we really don't want people to
bother with it on such systems.

We only define the skeleton of directories in this document, and it's
expected that people extend it, and I think this really should be one of
those dirs that is an extension of our skeleton, but not part of the
skeleton, if that makes any sense.

(cherry picked from commit 9e7b691073)
2024-10-08 16:39:12 +01:00
David Tardon
8a7f34d809 logind-dbus: really cancel scheduled shutdown
Fixes #34554

(cherry picked from commit cd9c3327cb)
2024-10-08 16:39:12 +01:00
Daan De Meyer
36ada59d2e repart: Apply denylist to individual files as well
(cherry picked from commit 0bbe63fc66)
2024-10-08 16:39:12 +01:00
Zbigniew Jędrzejewski-Szmek
28ced52894 systemctl: fix printing of RootImageOptions
The type is a(ss), so a custom printer is required.

Fixes https://github.com/systemd/systemd/issues/33967.

(cherry picked from commit 69c751c61c)
2024-10-08 16:39:12 +01:00
Mickaël Salaün
c53c1a0fac seccomp-util: include @sandbox in @default
Every services and containers should be able to protect their users and
limit the impact of security bugs thanks to the security syscalls
provided by seccomp and Landlock.  The goal of these syscalls is to
improve security with additional restrictions.  They are designed to be
safely used by unprivileged (and then potentially malicious) users.

Remove the now-redundant "seccomp" entry for nspawn.

(cherry picked from commit e996663475)
2024-10-08 16:39:12 +01:00
Zbigniew Jędrzejewski-Szmek
53b5032ffd man: fix formatting in file-hierarchy
Somebody wrapped the text, but whitespace is preserved in <programlisting>, so
the output was mangled. It also doesn't make sense to run systemd-path as root
(as indicated by '#'), so drop that. Also, this chunk should be a separate
paragraph.

(cherry picked from commit 1ca81b2e00)
2024-10-08 16:39:12 +01:00
Daan De Meyer
bb9b6a9067 mkosi: update arch commit reference
* d5a2dc54da Use vmlinux.h from linux-headers
* 59912d804f update checksums...
* 83edb5244e build: set ssh privsep dir to /usr/share/empty.sshd
* 65363cc5ba build: explicitly enable vmlinux-h=generated
* 14e6d27dd4 build: drop deprecated default-hierarchy option
* 81e7545ca3 systemd.install: stop applying ACL ourselves
* 147c214201 systemd-hook: use systemd-notify --booted to detect if systemd is running
* 010bc3c05c upgpkg: 256.6-1: new upstream release

(cherry picked from commit 5acca1b885)
2024-10-08 16:39:12 +01:00
Nils K
c1431b7eff Fix reference to FileDescriptorStoreMax= directive
(cherry picked from commit 543015a164)
2024-10-08 16:39:12 +01:00