Commit Graph
82766 Commits
Author SHA1 Message Date
Yu Watanabe 543a48b653 libc-wrapper: introduce a tiny libc wrapper
Then, move syscall definitions to the wrapper, and prototypes are moved
to relevant headers.

This also adds checks for add_key() and request_key(), as one day
glibc may be going to add some of them separatedly.

The check for fspick in meson.build is dropped, as it is currently
unused in our code.

This also moves
- basic/missing_bpf.h -> include/override/linux/bpf.h,
- basic/missing_keyctl.h -> include/override/linux/keyctl.h.
2025-07-11 13:05:46 +09:00
Yu Watanabe da522c9921 basic: move basic/missing_syscall_defs.h -> include/override/sys/syscall.h
This also moves syscall tables and generators to the same directory.

Note, inclusion of asm/sgidefs.h is dropped, as it is already included
by unistd.h and sys/syscall.h.
2025-07-11 13:05:46 +09:00
Yu Watanabe 2b912d2066 tree-wide: several cleanups for generating symbol lists and gperf files
- pass our system include directories to make generators use our libc
  wrappers and latest kernel headers,
- include relevant headers in generated gperf file,
- use files() rather than find_program(), as the result of
  find_program() cannot be passed to 'input' of custom_target(),
- move generate-bpf-delegate-configs.py to src/core/, as it is only used
  by libcore.
2025-07-11 13:05:42 +09:00
Yu Watanabe 1a60b97524 include: move libc header wrappers to src/include/override/, and kernel headers to src/include/uapi/
Preparation for later changes.
2025-07-11 12:44:26 +09:00
Yu Watanabe 98751cf16e mkosi: various improvements (#38156) 2025-07-11 12:40:22 +09:00
Yu Watanabe 99ae2ae328 test-cgroup: Ignore ENOENT from cg_create(); test-cgroup-util: Ignore ENXIO in one more place (#38158)
This was the only test failure building systemd-252-51.el9 in a
container, also previously reported against 252-rc1 under Gentoo in
#25015

This is a forward-port of the patch we actually started using for CIQ's
builds of the EL9-derived package, which was:

```diff
--- systemd-252/src/test/test-cgroup.c	2022-10-31 18:59:18.000000000 +0000
+++ systemd-252-test/src/test/test-cgroup.c	2025-07-10 00:47:07.541000000 +0000
@@ -62,7 +62,7 @@
         log_info("Paths for test:\n%s\n%s", test_a, test_b);
 
         r = cg_create(SYSTEMD_CGROUP_CONTROLLER, test_a);
-        if (IN_SET(r, -EPERM, -EACCES, -EROFS)) {
+        if (IN_SET(r, -EPERM, -EACCES, -EROFS, -ENOENT)) {
                 log_info_errno(r, "Skipping %s: %m", __func__);
                 return;
         }
```

I confirmed that the `ERRNO_IS_NEG_FS_WRITE_REFUSED` macro is equivalent
to checking the first 3 error codes above, so the addition of the check
for `ENOENT` is still just as relevant as it was in 252, but adding it
into the macro would be inconsistent with its name, description, and
possible other uses. Hence, in this PR I'm adding the extra check into
the `if`.
2025-07-11 10:38:04 +09:00
Yu Watanabe 878fa7d26e journalctl: do not fail on SIGTERM/SIGINT or STDOUT disconnect when running with --follow (#38116)
Closes #38114.
2025-07-11 10:36:31 +09:00
Yu Watanabe 0c0b4d544c io.systemd.Manager.Describe fix context/runtime split (#38135)
This PR rearranges fields in io.systemd.Manager.Describe according to
the guidance by Lennart:

> If a property can be set in a unit file, ever, then it belongs in context.
> Otherwise, it belongs to runtime.

Closes #38124.
2025-07-11 10:26:57 +09:00
Yu Watanabe b3337feb55 Plumbing to perform SELinux checks in varlink API (#38146)
This PR does minimal changes to introduce varlink support. Ideally, the
code should switch to using `mac_selinux_get_our_label()` and new
`mac_selinux_get_peer_label()`. But I leave it for now to minimize
breakage. `mac_selinux_get_peer_label()` remains unused.

This is a prep step to merge
https://github.com/systemd/systemd/pull/38032
2025-07-11 10:20:36 +09:00
Solar Designer 52fe0a490d test-cgroup-util: Ignore ENXIO in one more place 2025-07-11 01:49:36 +02:00
Yu Watanabe 49bdc8b1e8 NEWS: mention about the exit code change in journalctl --follow 2025-07-11 08:45:46 +09:00
Yu Watanabe d6b3793704 test: drop unnecessary disablement of pipefail 2025-07-11 08:45:46 +09:00
Yu Watanabe 054464ad52 main-func: drop unused DEFINE_MAIN_FUNCTION_WITH_POSITIVE_SIGNAL() 2025-07-11 08:44:43 +09:00
Yu Watanabe 390097724b journalctl: do not fail on SIGTERM/SIGINT, or when STDOUT is disconnected
The current behavior is not useful when e.g. pipefail is enabled.
Let's exit cleanly in such cases.

Closes #38114.
2025-07-11 08:41:10 +09:00
Solar Designer 470da65110 test-cgroup: Ignore ENOENT from cg_create()
which was the only test failure building systemd-252-51.el9 in a
container, also previously reported against 252-rc1 under Gentoo
in #25015
2025-07-11 00:28:14 +02:00
Matteo Croce 7aefb194e7 man/systemd.exec: explain how BPF token works
Add a small paragraph explaining how BPF token works, how it's being
created and its relationship between the BPF filesystem.
Move all the relevant documentation in the PrivateBPF= section and let
point all the BPFDelegate* options to that one.
2025-07-10 21:40:07 +02:00
Ubuntu df5b3426f6 journald: support reloading configuration at runtime 2025-07-10 21:38:36 +02:00
Lennart Poettering c35ceb84e3 Introduce ERRNO_IS_FS_WRITE_REFUSED(), and use it in binfmt_mounted() (#38117)
- This introduces ERRNO_IS_FS_WRITE_REFUSED(), and apply it where
usable.
- This makes unexpected errors in access_fd() called by binfmt_mounted()
propagated to the caller.
- Renames binfmt_mounted() to binfmt_mounted_and_writable(), as it also
checks the fs is writable.
- Voidifies one disable_binfmt() call in shutdown.c.
2025-07-10 21:38:13 +02:00
DaanDeMeyer cc43510a13 userdb: Add userdb.transient credentials
To implement --bind-user in systemd-vmspawn, we need a transient
version of these credentials. These are useful when the home directory
of the user is mounted into the container/vm and every trace of the user
will be (mostly) gone again when the container/vm is shut down.
2025-07-10 21:36:09 +02:00
Ivan Kruglov d5f4bd3700 selinux: mac_selinux_unit_access_check_varlink macros 2025-07-10 21:16:32 +02:00
Ivan Kruglov e3fef210c8 selinux: mac_selinux_access_check_varlink_internal() 2025-07-10 21:16:32 +02:00
Ivan Kruglov fe3f2ac073 selinux: check_access() 2025-07-10 21:16:32 +02:00
Ivan Kruglov 5dc3096efb core: leave a comment about context/runtime split 2025-07-10 21:08:11 +02:00
Ivan Kruglov 79eec46dfd core: move ControlGroup move runtime to context 2025-07-10 21:08:11 +02:00
Ivan Kruglov 89701e02ac core: move ConfirmSpawn from runtime to context 2025-07-10 21:08:11 +02:00
Ivan Kruglov 303d1b6b57 core: move ShowStatus/Log* from runtime to context 2025-07-10 21:08:11 +02:00
Ivan Kruglov 712f763036 core: move WatchdogDevice from runtime to context 2025-07-10 21:08:11 +02:00
Ivan Kruglov 545fde151a core: move RuntimeWatchdog* + RebootWatchdog + KExecWatchdog from runtime to spec 2025-07-10 21:08:11 +02:00
Ivan Kruglov afa9992429 core: fix double Environment present in both context and runtime 2025-07-10 21:08:11 +02:00
Ivan Kruglov a5d8520f86 core: move Version/Arch/Features/Taints/UnitPath from context to runtime 2025-07-10 21:08:11 +02:00
Ivan Kruglov 84c05ec632 selinux: get_our_contexts() 2025-07-10 21:06:51 +02:00
Ivan Kruglov 3484af2800 selinux: rename mac_selinux_access_check_internal() -> mac_selinux_access_check_bus_internal() 2025-07-10 21:06:51 +02:00
Ivan Kruglov 5a1cb174f8 selinux-utils: rename and expose log_selinux_enforcing_errno() 2025-07-10 21:06:51 +02:00
Ivan Kruglov 204e3cb6c8 selinux-util: mac_selinux_get_peer_label() 2025-07-10 21:06:51 +02:00
DaanDeMeyer 88444243b8 ruff: Default to python 3.7 version
For some use cases we still want python 3.7 compat so let's default
to that and only target python 3.9 in a few specific cases.
2025-07-10 18:09:17 +02:00
Li Tian b6d4997683 Add --entry-type=type1|type2 option to kernel-install.
Both kernel-core and kernel-uki-virt call kernel-install upon removal. Need an additional argument to avoid complete removal for both traditional kernel and UKI.

Signed-off-by: Li Tian <litian@redhat.com>
2025-07-10 18:07:23 +02:00
DaanDeMeyer 7f76ff2821 tree-wide: Use "mkosi box" instead of "mkosi sandbox"
The box verb was added as a synonym for sandbox. sandbox still works,
but let's switch to box as it's shorter.
2025-07-10 16:24:34 +02:00
DaanDeMeyer a4488ae6ae mkosi: Drop unnecessary [Match] sections
These are already satisfied in every path that includes pkgenv.conf.
2025-07-10 16:24:34 +02:00
DaanDeMeyer 3800adc9e5 mkosi: Simplify centos/fedora configuration
Both EPEL 9 and 10 now have the packages we need except for dhcp-server
so let's get rid of the EPEL conditionals and simply skip the tests that
require dhcp-server on CentOS.

While we're at it, make sure we use the new Architecture=uefi match in
mkosi to simplify the uefi checks.
2025-07-10 16:24:34 +02:00
DaanDeMeyer 24a14e9050 mkosi: update mkosi commit reference to 184472f0f1f831ca29953546ec01fd941ff763a6
* 184472f0f1 mkosi-tools: make sure p11-kit dir exists when configuring module
* 9fb807884e mkosi-tools: Explicitly install p11-kit
* 9131877d60 Support matching against architectures with uefi support
* f1eab5a783 Rename sandbox verb to box
* d609f55d98 Fix /var/tmp directory cleanup
* 4997b9495c build(deps): bump github/codeql-action from 3.28.18 to 3.29.2
2025-07-10 16:24:34 +02:00
DaanDeMeyer 33a5cc768c socket-activate: Always send NOTIFY=ready
Even if we're not using --accept=, it's very useful to be able to
synchronize on systemd-socket-activate having binded to its listen
socket, so let's always send READY=1. This means the payload can't
send READY=1 anymore but it's doubtful whether that's useful in this
case in the first place.
2025-07-10 16:19:46 +02:00
Daan De Meyer 6a9cb1936f Two trivial nspawn fixes (#38152) 2025-07-10 16:19:18 +02:00
DaanDeMeyer 1f24a954e4 vmspawn: Use virtio-blk-pci for image instead of virtio-scsi-pci
We don't need a full blown SCSI controller just to present the main
root drive device to the VM. Let's simplify the storage stack by using
virtio-blk-pci instead.

Additionally, virtio-blk-pci is a builtin module in Arch and Fedora
which means we can do qemu direct kernel boot without needing an initrd.
2025-07-10 16:18:33 +02:00
DaanDeMeyer 6ed684db41 escape: Make quote_command_line() argument const 2025-07-10 16:18:10 +02:00
DaanDeMeyer 8ba6c2b7f5 vmspawn: Disable hpet for vmspawn x86 virtual machines
hpet is an emulated clocksource that is generally discouraged in favor
of kvm-clock or tsc for virtual machines. While vmspawn's virtual machines
already use kvm-clock, leaving hpet enabled causes qemu on the host to
consume a non-trivial amount of cpu, so let's disable the hpet feature since
we're not making use of it anyway.
2025-07-10 16:14:52 +02:00
Yu Watanabe 0b565facc4 Revert "resolve: query the parent zone for DS records"
This reverts commit 49ff90c70d.
2025-07-10 15:18:07 +02:00
DaanDeMeyer 4f54d81ace nspawn: Use in_child_chown() in one more place 2025-07-10 13:55:45 +02:00
DaanDeMeyer 6f60ce002b nspawn: Improve log message 2025-07-10 13:55:43 +02:00
Eisuke Kawashima dc6e9c548b zsh-completion: generate completion for systemd-run from systemd-analyze
continuation of #37641
2025-07-10 11:39:06 +02:00
Jörg Behrmann 693f11d5ba news: fix typo 2025-07-10 10:23:28 +02:00