1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-20 18:04:03 +03:00

74681 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
0f716efc23 homectl: fix inverted table footer condition
Fixup for 2413a0fab4fdad7eef3ce1d4b57664be5795b002.

(cherry picked from commit 3be87dca031956bc0f7744d0bb9e1fea04acd945)
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 33f1c5287f6c5b1b02324bbbb5aafb27d34b00cb)
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 67b6404b80cf8078f3d9ec6d4c2f34ac25b15077)
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 d98b6c66ffaccbef1c86fc729f2f9601bfb02fd5)
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 345a4fcbb6ed16ab19d0d5b0c7344e5cdfe29efd)
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 9c7762c943bd5612f02a93b2ec986141fcb5226d)
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 c73d14c43e7998ca54011875ad25afc634d57498)
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 f39e66b85a4a97818a618758e34019d052aeb772)
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 225f18b9a9d39331ea862478ab2ff893678e249d)
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 bd4beaa2ebfbbec0a1263a7091a91e528ce8cf13)
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 6aed4876e8bd74c6814a6d588b556d9f0ab1f021)
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 608009dc6218f7c41420f665586f2449b64a08f7)
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 fec09ff094670a6903b12b1c599b00b39a2b0c88)
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 9fd8a9dffe9b8f29da52e4e1481926bceed5ce6c)
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 0c96911afb67fc1632866548efe151f6f10191b0)
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 5b53894123b9d01f5738b02befd4189625c5451f)
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 fd6e079e7b296696028c161224d2a86fce70726f)
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 b0201b36d2e0181d08530aaad496322812c4e77e)
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 9e7b691073922433a71cf49dcaaf7f9f61f58e6d)
2024-10-08 16:39:12 +01:00
David Tardon
8a7f34d809 logind-dbus: really cancel scheduled shutdown
Fixes #34554

(cherry picked from commit cd9c3327cbc936fc7e3a07d12b94328586ccfbaa)
2024-10-08 16:39:12 +01:00
Daan De Meyer
36ada59d2e repart: Apply denylist to individual files as well
(cherry picked from commit 0bbe63fc66a7cf47fa0f4b9a0f4579e3d7cf2e1e)
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 69c751c61cb2b386afe51f03b58f8f7ceeeb643e)
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 e9966634754b8c9ee3f3c579f25d938e185c282e)
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 1ca81b2e005ccef6e9ddf06c3e3441bae0a6e1d5)
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 5acca1b88551633c91ae602351f9a23af178ce6b)
2024-10-08 16:39:12 +01:00
Nils K
c1431b7eff Fix reference to FileDescriptorStoreMax= directive
(cherry picked from commit 543015a164c1fbf22c13c357efb180cf1adc5f03)
2024-10-08 16:39:12 +01:00
Ivan Kruglov
0cd10d410b machine: resolve race condition in TEST-13-NSPAWN.machinectl.sh
I encountered this race condition while working on TEST-13-NSPAWN.varlinkctl.sh.
The long-running machine's init script sometimes does not have time to start and
register signals. As result, occasiounally failed tests.

(cherry picked from commit e826a8bed447f3b3f9ad487f96ab7f8c7620c75b)
2024-10-08 16:39:12 +01:00
Simon Pilkington
bc0ba0030b creds: fix cat with encrypted credentials
Fixes: https://github.com/systemd/systemd/issues/34547
(cherry picked from commit 32951fe4de683f5d42cec2fb2e036f766b051e2b)
2024-10-08 16:39:12 +01:00
Daan De Meyer
4143bc70ed repart: Determine verity sig size based on partition designator
Verity= is an image build concept, not a first boot concept, whereas
a partition designator is always available, so let's do the size stuff
based on that.

(cherry picked from commit e11745d000d7e9b3112bb336735c1bdfa77e9add)
2024-10-08 16:39:12 +01:00
Michal Koutný
00dfa7964b core/cgroup: Apply IODevice*= directives in configured order
Different device paths may resolve to same device node
(lookup_block_device()), e.g.
        IOReadBandwidthMax=/dev/sda1 18879
        IOReadBandwidthMax=/dev/sda2 18878
where both partitions resolve to /dev/sda and when these values are
applied (they are associated with original paths, i.e. as if applied for
different device) in the order from io_device_limits.

The parsing code prepends, so they end up in reverse order wrt config
file. Switch the direction so that the order of application matches the
order of configuration -- i.e. semantics in all other unit file
directives.

Apply same change to all directives that use per-device lists. (The
question whether partitions should be resolved to base device is
independent.)

And apply the changes equally to DBus properties write handlers.

Fixes #34126

(cherry picked from commit 0fa0dfa04465651a18107d503f9967f84bd761d1)
2024-10-08 16:39:12 +01:00
Ivan Shapovalov
1a08b86723 core/cgroup: cache IO accounting data when pruning a cgroup
When removing a cgroup in unit_prune_cgroup(), read IO metrics to cache
them similar to the existing treatment of the CPU and memory usage data.

Note that we do not do this for the IP metrics as the firewall objects
are only destroyed in unit_free() and thus stay alive long enough to
be read out directly by all interested parties.

Fixes #26988.

(cherry picked from commit 17bbdefd8c49617d7596bbf708c818a9773a9b44)
2024-10-08 16:39:12 +01:00
Ivan Shapovalov
a0d60f5621 core/cgroup: drop allow_cache parameter in unit_get_io_accounting()
The name of the parameter is misleading and it does not save us much
work because it is not used during regular unit property queries.
It is only used during unit_log_resources(), and the cgroup is already
dead by that point so it won't be read anyway.

(cherry picked from commit a0020ad84bb092fc72cde7dca5784a0a4e613fd7)
2024-10-08 16:39:12 +01:00
Zbigniew Jędrzejewski-Szmek
2cd8079efa man: say that SYSEXT_SCOPE=initrd also applies to exitrds
We generally do _not_ want the same sysexts to be loaded in both initrd and
exitrd phases. The environment is completely different and it's unlikely that
the same code can be useful in both places. Nevertheless, it can be useful in
_some_ cases, for example when the sysexts contains debugging tools.

I think we don't need to differentiate between initrds and exitrds through
SYSEXT_SCOPE, because the two types are made available in completely different
locations and loaded through a different mechanism, with very little chance of
an initrd being loaded as an exitrd without an explicit admin action (or the
other way around). So let's not complicate our code or definitions by an
explicit "exitrd" sysext designator, but just clarify that "initrd" also
encompasses exitrds in this context.

(cherry picked from commit 7352a0093f4ef96c361be22337cde3296d79da01)
2024-10-08 16:39:12 +01:00
Zbigniew Jędrzejewski-Szmek
b78f99e71b man: slightly enhance docs about "exitrd" and remove TODO entry for it
The concept is fairly well established and present in our docs in various
places.

Say that the exitrd is also marked by the presence of /etc/initrd-release.

(cherry picked from commit ace26a511ff63dbc15f1b2b0b941cbd3294a288c)
2024-10-08 16:39:12 +01:00
Daan De Meyer
08cf1c5ce5 repart: Add a log message when we're about to fsync().
(cherry picked from commit f3b8e81f5443fefb1dd2bb62d6b41c2559dca475)
2024-10-08 16:39:12 +01:00
Daan De Meyer
abd6cd1b69 mkosi: Add missing SPDX line
(cherry picked from commit 80d4ea44577e90beed49fcbb7c00538bf203dfbb)
2024-10-08 16:39:12 +01:00
Daan De Meyer
1ade483044 mkosi: Add back support for running clangd within mkosi
This allows hacking on systemd without installing any build
dependencies except mkosi on the host machine.

(cherry picked from commit 6d862a9dc08285fffb9da29055235b5c9935dcf8)
2024-10-08 16:39:12 +01:00
Mike Yuan
528cd7dc84 machined: fix bogus error check for machine_link()
(cherry picked from commit 533c20ca5bd7002d8983b7d48f47ff78c25347c3)
2024-10-08 16:39:12 +01:00
Daan De Meyer
efd5e357d7 Add an extra debug log to dissect_image()
(cherry picked from commit 0121b84e41cd187e44c275a23db1a656656ec37f)
2024-10-08 16:39:12 +01:00
Zbigniew Jędrzejewski-Szmek
bf64e901e4 mkosi: bump mkosi MinimumVersion
dbff64ddf06f64ab94bd314df27d6c089b75de52 bumped the hash to
a commit after 24.3, so let's tell the users that 25~devel is
the minimum required.

(cherry picked from commit 3a157e7cb4b1ec6fb822a014d67161ecfee546a2)
2024-10-08 16:39:12 +01:00
Yu Watanabe
06eb9b1482 sd-ipv4acd: fix assertion triggered when an ARP received in STARTED state
When a network is busy, an ARP may be received before the timer event
source triggered first time.

Fixes #34489.

(cherry picked from commit 146b44d0a0001712ced2f22ca76d242eedac26ad)
2024-10-08 16:39:12 +01:00
Mike Yuan
d7ae71b9c1 boot: use INC_SAFE where appropriate
(cherry picked from commit 48837c65008a312810c4cad2789dd3fb7bc27488)
2024-10-08 16:39:12 +01:00
Mike Yuan
7884db1b93 tmpfiles: ERRNO_IS_NOINFO -> _IS_NEG_, correct negative errno checks
(cherry picked from commit 755877f20a2e18d1a2c4149662c2caec80230879)
2024-10-08 16:39:12 +01:00
cvlc12
f535bbea13 man: update PCR and Secure Boot key names and paths
(cherry picked from commit dbf5b09de40a9d22b67611524bea12feae657462)
2024-10-08 16:39:12 +01:00
Yu Watanabe
308c93c51f test: add tests for seccomp_suppress_sync()
(cherry picked from commit c07e10628b6add9ee9664956a28d3f727c9848f8)
2024-10-08 16:39:12 +01:00
Yu Watanabe
4bbd6f589a seccomp-util: pass negative fds as is to fsync() and friends
Closes #34478.

Co-authored-by: Mike Yuan <me@yhndnzj.com>
(cherry picked from commit 144fbbac235b6b89d5d31795be1cc0dca9852ccc)
2024-10-08 16:39:12 +01:00
Daan De Meyer
3f313d0d49 test: Run TEST-74-AUX-UTILS in virtual machine
Various tests skip themselves when running in a container so make
sure the test runs in a virtual machine so we get full coverage.

(cherry picked from commit f4faac20730cbb339ae05ed6e20da687a2868e76)
2024-10-08 16:39:12 +01:00
Yu Watanabe
84d5d3af9d man: fix typo
Follow-up for 8aee931e7ae1adb01eeac0e1e4c0aef6ed3969ec.

(cherry picked from commit 07e6a111c0c64b68147d940fabe4d3c4e63e1172)
2024-10-08 16:39:12 +01:00
Daan De Meyer
e365f6edf8 ci: Don't add testuser to wheel and systemd-journal groups
This breaks TEST-74-AUX-UTILS when run in a VM as the user gets access
to journal files that the test expects it can't access.

(cherry picked from commit 1d5b4317cd0140c043495f946e5352b188f3bec0)
2024-09-25 21:27:25 +02:00
Daan De Meyer
f457acb663 mkosi: Stop applying device groups patch on Arch
It stopped applying so let's stop applying it to make CI green again.

(cherry picked from commit cf94f513f055d04d2c46b25e30948ea12adbe25c)
2024-09-25 21:27:25 +02:00