Commit Graph
87259 Commits
Author SHA1 Message Date
Clayton Craft bc6380ae07 nsresourced: fix BPF loading when using kernel compiled with Clang
This fixes an issue where nsresourced fails to load BPF on kernels
compiled with Clang (this output was from v259):

    $ sudo env SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/systemd-nsresourced
    ; int BPF_PROG(userns_restrict_path_chown, struct path *path, void* uid, void *gid, int ret) { @ userns-restrict.bpf.c:134
    ...
    ; return validate_path(path, ret); @ userns-restrict.bpf.c:135
    ...
    ; static int validate_path(const struct path *path, int ret) { @ userns-restrict.bpf.c:120
    ...
    ; task = (struct task_struct*) bpf_get_current_task_btf(); @ userns-restrict.bpf.c:84
    ...
    ; task_userns = task->cred->user_ns; @ userns-restrict.bpf.c:85
    ...
    R2 invalid mem access 'rcu_ptr_or_null_'

When Clang is used (which sets CONFIG_PAHOLE_HAS_BTF_TAG), btf_type_tag
support is enabled. As a result, an rcu type tag is added to
task_struct::cred:

    $ bpftool btf dump file /sys/kernel/btf/vmlinux | grep "STRUCT 'task_struct'"
    [459] STRUCT 'task_struct' size=4672 vlen=242

    $ bpftool btf dump file /sys/kernel/btf/vmlinux | grep -A200 "^\[459\] STRUCT 'task_struct'" | grep cred
	    'ptracer_cred' type_id=802 bits_offset=14528
	    'real_cred' type_id=802 bits_offset=14592
	    'cred' type_id=802 bits_offset=14656

    $ bpftool btf dump file /sys/kernel/btf/vmlinux | grep '^\[802\]'
    [802] PTR '(anon)' type_id=801

    $ bpftool btf dump file /sys/kernel/btf/vmlinux | grep '^\[801\]'
    [801] TYPE_TAG 'rcu' type_id=803

Since the struct ptr *could* be null, we have to add a null pointer
check to satisfy the bpf verifier.
2026-03-20 15:27:08 +01:00
Luca Boccassi 69c087bade test: skip D-Bus FD truncation test with dbus-daemon
dbus-daemon intentionally disconnects peers when FDs get
truncated. Detect it and skip it in that case, as the purpose
of the test is not to exercise the D-Bus implementation, but
our library.
When running with dbus-broker (Fedora, etc) we'll get full
coverage.

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

Follow-up for 744d589632
2026-03-20 15:25:26 +01:00
Robin Ebert 55e7dc5ce4 kernel-install: fix assert in context_copy 2026-03-20 15:17:44 +01:00
Daan De Meyer ea68a9385e imds preparation (#41214) 2026-03-20 15:14:21 +01:00
Lennart Poettering dae21304ff stub: make debug logging controllable via smbios11 work in the stub too, not just the boot menu
Follow-up for: 0ce83b8a57
2026-03-20 13:56:44 +00:00
Lennart Poettering 56f3ae9292 iovec-util: introduce IOVEC_MAKE_BYTE() helper 2026-03-20 11:53:33 +01:00
Lennart Poettering 56356c9dec udev: tag DMI id device with "systemd", so that we can order units after it
For various usecases it is useful to read relevant data from the DMI
udev device, but this means we need a way to wait for it for this to be
probed to be race-free. Hence tag it with "systemd", so that
sys-devices-virtual-dmi-id.device can be used as synchronization point.
2026-03-20 11:53:33 +01:00
Lennart Poettering 6738762688 fileio: introduce write_data_file_atomic_at() helper
This is very similar to write_string_file_atomic(), but is intentionally
kept separate (after long consideration). It focusses on arbitrary
struct iovec data, not just strings, and hence also doesn't do stdio at
all. It's hence a lot more low-level.

We might want to consider moving write_string_file*() on top of
write_data_file_atomic_at(), but for now don't.
2026-03-20 11:53:33 +01:00
Michael Vogt 55356a7821 units: allow io.systemd.Hostname to be available earlier
Currently the varlink interface for hostname is only available
after sysinit. This means it is not available until systemd-firstboot
is finished. But there is information like the boot-id in there that
is useful to get early.

My use-case is to query the system early via the varlink-http-bridge
and currently I can't get data from io.systemd.Hostname until
systemd-firstboot is completed which is a bit limiting.

So to fix it this commit sets DefaultDependencies=no on both the socket
and service units.

It also changes hostnamed.c to use
bus_open_system_watch_bind_with_description() which means we will
reconnect once dbus is available. This mimics what resolved-bus.c
is doing (and which was originally introduced in d7afd945b).

Thanks to Lennart for pointing this out.
2026-03-20 10:04:26 +01:00
Zbigniew Jędrzejewski-Szmek abb03c7c9d tests: drop _weak_ from the SYSTEMD_TEST_TABLE definition
This will cause test binaries that reference SYSTEMD_TEST_TABLE,
e.g. by trying to iterate over the test list, to fail if no tests are
defined. I think this is the correct thing to do, as the lack of tests
indicates some kind of mistake.
2026-03-20 09:59:58 +01:00
Zbigniew Jędrzejewski-Szmek 4268e95fb9 test-bpf-token: convert "intro" to a test
This file was a bit strange… It was shoehorning a manual test into
the intro block and not using the rest of the TEST machinery. Let's
convert it into a normal executable with a run function as we do
in other similar cases.
2026-03-20 09:59:58 +01:00
Zbigniew Jędrzejewski-Szmek a28dbc9d88 timesyncd: drop obsolete privilege dropping code
systemd-timesyncd always runs as an unprivileged user via the service
file, so the code to resolve the systemd-timesync user, drop privileges
adjust file ownership/permissions, or even create the directory cannot
do anything useful and is unnecessary.

Follow-up for 00a415fc8f, which made
running under an unprivileged user unconditional.
2026-03-20 09:57:55 +01:00
Chris Down caed31e148 Various dissect-image cleanups (#41178)
I noticed the message for verity partition mismatch was wrong, which
then led me down this rabbit hole...

Aside from the new test for usr verity partitions, this is 49
insertions(+), 127 deletions(-), and reduces the space for bugs to hide
a bit.
2026-03-20 11:52:32 +08:00
Massii Aqvayli b3388e7cd6 po: Translated using Weblate (Kabyle)
Currently translated at 15.0% (40 of 266 strings)

Co-authored-by: Massii Aqvayli <massiin@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/kab/
Translation: systemd/main
2026-03-19 22:13:24 +00:00
Artem Proskurnev f8e31900ce hwdb/keyboard: Map FN key on Wareus B15
After kernel commit 907bc9268a ("Input: atkbd - map F23 key to support default copilot shortcut")
Fn+F5 combination (switch touchpad on/off) stopped working correctly.

Fn produces F23, it is probably a bug in BIOS, ther eis no "Copilot" key.
It was ignored before that commit, but now we have to remap it here in hwdb.

This workaround is similar to systemd commit d2502f5
("hwdb/keyboard: Map FN key on TUXEDO InfinityFlex 14 Gen1")

Hardware probe of this notebook: https://linux-hardware.org/?probe=2d5266f5c6
2026-03-19 19:44:14 +01:00
Chris Down 15a2fdcd96 dissect-image: Add usr verity partition coverage 2026-03-19 22:36:57 +08:00
Zbigniew Jędrzejewski-Szmek bcb65f4b57 test-time-util: restore relaxation of check is special timezones
Fixup for 514fa9d39a. We are now getting
failures in CI i386 builds in Fedora rawhide:
  TZ=Europe/Lisbon, tzname[0]=WET, tzname[1]=WEST
  @212545617716594 → Sun 1976-09-26 00:26:57 WET → @212542017000000 → Sun 1976-09-26 00:26:57 CET
  src/test/test-time-util.c:450: Assertion failed: Expected "ignore" to be true

Restore the conditionalization for CAT, EAT, WET that was removed
in the refactoring.
2026-03-19 14:36:22 +00:00
Chris Down 91578e5293 dissect-image: Consolidate verity validation and setup
The verity consistency checks and verity setup code also have parallel
blocks for root and usr that do basically identical work. Let's
consolidate them and reduce the footprint for bugs or deviance to
manifest.
2026-03-19 21:37:36 +08:00
Chris Down 779e70a8e8 dissect-image: Merge partition handler code
dissect-image has six(!) different branches with basically the same
code. Let's avoid that and reduce the spaces for bugs or differing
behaviour to subtly creep in.
2026-03-19 21:37:36 +08:00
Chris Down 8a66ad0c66 dissect-image: Fix wrong UUID logged on usr verity partition mismatch
When there's a partition mismatch the USR_VERITY branch logs usr_uuid in
the mismatch message, but the check is actually against usr_verity_uuid.
2026-03-19 21:01:54 +08:00
Lennart Poettering 2f44726924 vconsole-setup: make work somewhat cleanly if loadkeys/setfont are not available (#40959) 2026-03-19 13:23:32 +01:00
Daan De Meyer 2c01818816 ci: Update prompt to reduce time spent re-checking comments
I noticed looking at the logs that claude spends a lot of time re-checking
existing comments, so let's update the prompt to hopefully reduce
the amount of comments that it re-checks.
2026-03-19 11:46:26 +01:00
Daan De Meyer 2c5e0cfb1d ci: Instruct claude to not do any escaping for review comments
Should hopefully fix cases like
https://github.com/systemd/systemd/pull/40780#discussion_r2956841573.
2026-03-19 11:14:33 +01:00
Daan De Meyer 1c8b460b16 ci: Have claude spend more effort on reviews
Let's give this a try and see how it impacts reviews (and cost).
2026-03-19 10:39:33 +01:00
Lennart Poettering 3327a411be vconsole-setup: handle gracefully if setfont/loadkeys are not available
Let's not complain too loudly if these external binaries aren't there.
2026-03-19 08:51:18 +01:00
Lennart Poettering 3d153bfeb6 vconsole-setup: add a bunch of assert()s 2026-03-19 08:51:18 +01:00
Luca Boccassi acb6624fa1 userdb: add birthDate field to JSON user records (#40954)
Add an optional field that can be used to store a user's birth date.
userdb already stores personal metadata (`emailAddress`, `realName`,
`location`) so `birthDate` is a natural fit.
2026-03-18 23:04:03 +00:00
Zbigniew Jędrzejewski-Szmek ba1caf070f Add tmpfiles --inline and use it in one unit file (#41034) 2026-03-18 22:49:11 +01:00
Dylan M. Taylor 7a858878a0 userdb: add birthDate field to JSON user records
Add a birthDate field to the JSON user record, stored internally as a
struct tm with INT_MIN/negative sentinels for unset fields. The field
is serialized as a YYYY-MM-DD string in JSON and validated via
parse_birth_date(), which shares its core logic with
parse_calendar_date() through a new parse_calendar_date_full()
function.

For birth dates, timegm() is called directly (rather than
mktime_or_timegm_usec) to support pre-epoch dates. The wday field is
used to distinguish timegm() failure from a valid (time_t) -1 return.

birthDate is excluded from user_record_self_modifiable_fields(), so
only administrators can set or change it via homectl. The field
remains in the regular (non-privileged) JSON section, keeping it
readable by the user and applications.
2026-03-18 17:33:22 -04:00
seaeunlee 59aed18d69 hostname: add API for getting custom fields from machine-info 2026-03-18 20:47:00 +00:00
Luca Boccassi 4bc110154d Translations update from Fedora Weblate (#41164)
Translations update from [Fedora
Weblate](https://translate.fedoraproject.org) for
[systemd/main](https://translate.fedoraproject.org/projects/systemd/main/).



Current translation status:

![Weblate translation
status](https://translate.fedoraproject.org/widget/systemd/main/horizontal-auto.svg)
2026-03-18 20:42:46 +00:00
A S Alam 145fcbe711 po: Translated using Weblate (Punjabi)
Currently translated at 34.9% (93 of 266 strings)

Co-authored-by: A S Alam <aalam@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pa/
Translation: systemd/main
2026-03-18 18:58:47 +00:00
Jan Kuparinen 38e7ba033c po: Translated using Weblate (Finnish)
Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fi/
Translation: systemd/main
2026-03-18 18:58:46 +00:00
Massii Aqvayli a3da9c5cf3 po: Translated using Weblate (Kabyle)
Currently translated at 7.5% (20 of 266 strings)

Co-authored-by: Massii Aqvayli <massiin@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/kab/
Translation: systemd/main
2026-03-18 18:58:46 +00:00
Luca Boccassi 136d839fec man: switch ostree link to manpage
Webpage has been defaced and taken over
2026-03-18 18:40:43 +00:00
Daan De Meyer d105f4c5a5 ci: Add back subagents and stop using --json-schema in claude-review
Let's stop using --json-schema and instead have claude write a JSON
file in the repo root which we pass around as an artifact similar to
how we pass around the input. This works around the bug where claude
receives task notifications after producing structured output which
breaks the structured output.
2026-03-18 16:50:17 +01:00
Zbigniew Jędrzejewski-Szmek 26230ed5c1 Rename verb functions for consistency and add per-verb constant parameter (#41003)
We often have a pattern where the same verb function is used for
multiple actions. This leads to an antipattern where we figure out what
action needs to be taken from argv[0] multiple times: often once in
arse_argv() to figure out what options are allowed, then once again
implicitly in dispatch_verb(), and then again in the action verb itself.
Let's allow passing a parameter into the verb to simplify this.
2026-03-18 16:46:13 +01:00
Zbigniew Jędrzejewski-Szmek 151f803c3e TEST-22-TMPFILES: add simple test for tmpfiles --inline
Also add tests for handling of invalid_config.
2026-03-18 14:58:43 +01:00
Zbigniew Jędrzejewski-Szmek ee97cef1ea units: stop using rm in system-update-cleanup.service
If we are running on a system without coreutils, rm might not be
available. Let's use our own binary that should be available.
2026-03-18 14:58:43 +01:00
Zbigniew Jędrzejewski-Szmek 548816e058 tmpfiles: add --inline
This option is exactly like the one in sysusers. (In fact the
implementation is copied too.) It is occasionally useful to be able to
specify and execute some tmpfiles config not through config files but
directly on the command line. This also makes it very easy to test
config with:
  SYSTEMD_LOG_LEVEL=debug systemd-tmpfiles --dry-run --inline ...
2026-03-18 14:58:43 +01:00
Dylan M. Taylor 770958e24a time-util: extract parse_calendar_date() from sysupdate
Move the YYYY-MM-DD date parsing and validation logic from
sysupdate-resource.c into a shared parse_calendar_date() function
in time-util, so it can be reused by other subsystems.
2026-03-18 09:39:06 -04:00
Daan De Meyer fb2cf9f557 ci: Don't read claude settings from the repo
Shouldn't be possible, but extra hardening never hurts.
2026-03-18 13:48:55 +01:00
Daan De Meyer 20a8f5832a ci: Prettify JSON in pr context file so claude can parse it
Currently it's a single line which makes it hard for claude to read
what's in it.
2026-03-18 13:48:55 +01:00
Daan De Meyer 9374d7fa06 ci: Allow claude-review access to /tmp and /var/tmp 2026-03-18 13:48:55 +01:00
Daan De Meyer 1a7678e881 ci: Stop using subagents in claude-review workflow
As it seems impossible to prevent claude from receiving notifications
about subagents finishing after it has produced structured output, which
breaks the structured output as it has to be the final reply, let's stop
using subagents and background tasks completely to avoid the issue.
2026-03-18 13:48:55 +01:00
Vitaly Kuznetsov a06992dd16 measure: make tpm_log_tagged_event() measure CC as well
tpm_log_tagged_event() only measures the event to the TPM while
tpm_log_ipl_event() measures the event both to the TPM and CC. Fix the
inconsistency.

Note, this is a potentially breaking change for TDX guests as systemd will
now measure more stuff to the MRTD/RTMRs, reference values for attestation may
need to be adjusted.

Found by Claude Code Review.
2026-03-18 12:35:21 +00:00
Luca Boccassi cd1f2f2ff9 sd-dlopen: make macros to generate .notes.dlopen sections public API (#41047)
If this new scheme of adding dependencies is supposed to be used more
widely we need to start making it easy to add them. So add a new
self-contained header that projects can simply include without the need
to link against libsystemd itself. This will allow them to generate
`.notes.dlopen` sections:

```
> readelf -p .note.dlopen ./l2md

String dump of section '.note.dlopen':
  [     a]  |@FDO
  [    10]  [{"feature":"manifest-json","description":"Manifest-based change detection via gzip and JSON parsing","priority":"suggested","soname":["libz.so.1","libsystemd.so.0"]}]
  [    c2]  |@FDO
  [    c8]  [{"feature":"manifest-http","description":"HTTP transport for lore.kernel.org manifest fetch","priority":"suggested","soname":["libcurl.so.4"]}]
```
2026-03-18 12:33:58 +00:00
Daan De Meyer 2e676fd636 ci: Allow all commands in claude-review workflow
claude is asking for permissions in the logs, let's grant it access
to execute all commands to avoid the permission denials.
2026-03-18 12:44:48 +01:00
Daan De Meyer 02ab8dfc4f ci: Enable unpriv user namespaces for claude-review
Required for bubblewrap to work properly.
2026-03-18 12:44:48 +01:00
Nandakumar Raghavan a4aae32478 ansi-color: fix SYSTEMD_COLORS=true regression when output is piped
The SYSTEMD_COLORS=true/1/yes no longer forced colors
when stdout was not a TTY (e.g. piped), because the COLOR_TRUE bypass
of the terminal_is_dumb() check was accidentally dropped.

Restore the old behavior by guarding the TTY check with
`m != COLOR_TRUE`, so an explicit boolean "true" value continues to
unconditionally force color output regardless of whether stdout is a TTY
or whether $NO_COLOR is set.
2026-03-18 12:03:38 +01:00