]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 weeks agosocket-util: filter out VMADDR_CID_ANY in vsock_get_local_cid() 41230/head
Nick Rosbrook [Fri, 20 Mar 2026 15:23:39 +0000 (11:23 -0400)] 
socket-util: filter out VMADDR_CID_ANY in vsock_get_local_cid()

It has been observed on some systems[1] that ssh-issue may print out:

 Try contacting this VM's SSH server via 'ssh vsock%4294967295' from host.

i.e. it suggests connecting with VMADDR_CID_ANY, which is not valid. It
seems that IOCTL_VM_SOCKETS_GET_LOCAL_CID may return VMADDR_CID_ANY in
some cases, e.g. when vsock is not full initialized or so.

Treat VMADDR_CID_ANY as special in vsock_get_local_cid(), the same as
VMADDR_CID_LOCAL and VMADDR_CID_HOST, and return an error.

[1] https://launchpad.net/bugs/2145027

4 weeks agossh-proxy: return an error if user supplies VMADDR_CID_ANY
Nick Rosbrook [Fri, 20 Mar 2026 15:13:28 +0000 (11:13 -0400)] 
ssh-proxy: return an error if user supplies VMADDR_CID_ANY

Right now, if a user tries to pass VMADDR_CID_ANY to systemd-ssh-proxy,
an assert is triggered:

 $ ssh vsock%4294967295
 Assertion 'cid != VMADDR_CID_ANY' failed at src/ssh-generator/ssh-proxy.c:21, function process_vsock_cid(). Aborting.
 mm_receive_fd: recvmsg: expected received 1 got 0
 proxy dialer did not pass back a connection

This is becauase the value returned from vsock_parse_cid is not checked
before being passed to process_vsock_string. Add a check to prevent
that.

4 weeks agomake static hostname settable via firstboot credential (#41212)
Daan De Meyer [Fri, 20 Mar 2026 14:50:51 +0000 (15:50 +0100)] 
make static hostname settable via firstboot credential (#41212)

Split out of #40980

4 weeks agoshared: extract `socket_forward_new()` helper from socket-proxyd (#41168)
Daan De Meyer [Fri, 20 Mar 2026 14:45:33 +0000 (15:45 +0100)] 
shared: extract `socket_forward_new()` helper from  socket-proxyd (#41168)

4 weeks agohwdb: sensor: fix bncf newbook 11
David Santamaría Rogado [Thu, 19 Mar 2026 01:38:06 +0000 (02:38 +0100)] 
hwdb: sensor: fix bncf newbook 11

Actually was found that this device has panel mount at -90º. This fixes
the matrix to follow panel orientation.

More info in the previous PR comments:
https://github.com/systemd/systemd/pull/40773

Fixes: 774e8059590fac45614a135161dee4669945e342
4 weeks agosensor: gpd fix matches
David Santamaría Rogado [Thu, 19 Mar 2026 03:07:07 +0000 (04:07 +0100)] 
sensor: gpd fix matches

Actually for example the Win Max 2 match is affecting devices that even
didn't exist when the matrix was added.

4 weeks agosd-json: when parsing optionally insist top-level variant is object or array
Lennart Poettering [Thu, 19 Mar 2026 10:23:45 +0000 (11:23 +0100)] 
sd-json: when parsing optionally insist top-level variant is object or array

Typically, the top-level JSON object has to be an object, in any json
document we parse, hence let's add a simple way to enforce that.

Make use of this in various places.

(Note, various other JSON parsers insist on this logic right from the
beginning, but I actually thinking making this insisting optional like
this patch does it is the cleaner approach)

4 weeks agonsresourced: fix BPF loading when using kernel compiled with Clang
Clayton Craft [Fri, 20 Mar 2026 00:08:31 +0000 (17:08 -0700)] 
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.

4 weeks agotest: skip D-Bus FD truncation test with dbus-daemon
Luca Boccassi [Fri, 20 Mar 2026 00:43:26 +0000 (00:43 +0000)] 
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 744d589632c545e90ae76853abbfbc90cb530e24

4 weeks agokernel-install: fix assert in context_copy
Robin Ebert [Fri, 20 Mar 2026 12:32:04 +0000 (13:32 +0100)] 
kernel-install: fix assert in context_copy

4 weeks agoimds preparation (#41214)
Daan De Meyer [Fri, 20 Mar 2026 14:14:21 +0000 (15:14 +0100)] 
imds preparation (#41214)

4 weeks agostub: make debug logging controllable via smbios11 work in the stub too, not just...
Lennart Poettering [Sat, 7 Mar 2026 22:45:25 +0000 (23:45 +0100)] 
stub: make debug logging controllable via smbios11 work in the stub too, not just the boot menu

Follow-up for: 0ce83b8a578f3076d9ecff6b1d59613ff4afa3b5

4 weeks agofirstboot: permit setting the static hostname via a system credential 41212/head
Lennart Poettering [Thu, 5 Mar 2026 09:39:28 +0000 (10:39 +0100)] 
firstboot: permit setting the static hostname via a system credential

For the IMDS case there's value in being able to set the static
hostname, instead of just the transient one. Let's introduce
firstboot.hostname, which only applies to first boot, and write the
static hostname. This is different from system.hostname which applies to
any boot, and writes the transient hostname.

4 weeks agofirstboot: harden credential handling a bit
Lennart Poettering [Wed, 11 Mar 2026 10:15:27 +0000 (11:15 +0100)] 
firstboot: harden credential handling a bit

Credentials are highly privileged things, but still, let's do some
validation, because we can.

4 weeks agoiovec-util: introduce IOVEC_MAKE_BYTE() helper 41214/head
Lennart Poettering [Thu, 26 Feb 2026 09:10:53 +0000 (10:10 +0100)] 
iovec-util: introduce IOVEC_MAKE_BYTE() helper

4 weeks agoudev: tag DMI id device with "systemd", so that we can order units after it
Lennart Poettering [Thu, 26 Feb 2026 10:24:21 +0000 (11:24 +0100)] 
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.

4 weeks agofileio: introduce write_data_file_atomic_at() helper
Lennart Poettering [Fri, 27 Feb 2026 09:05:16 +0000 (10:05 +0100)] 
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.

4 weeks agoshared: extract `socket_forward_new()` helper from socket-proxyd 41168/head
Michael Vogt [Wed, 18 Mar 2026 10:38:48 +0000 (11:38 +0100)] 
shared: extract `socket_forward_new()` helper from socket-proxyd

This commit extracts the socket forwarding code from the existing
socket-proxyd into a new shared helper that will be used by the
varlinkctl protocol upgrade support code and is used as is in
the socket-proxyd.c.

It tries to keep the changes as small as possible, its mostly
renaming like:
* connection_create_pipes -> socket_forward_create_pipes
* connection_shovel -> socket_forward_shovel
* connection_enable_event_sources -> socket_forward_enable_event_sources
* traffic_cb -> socket_forward_traffic_cb

and a new socket_forward_new() that creates/starts the forwarding.

All log_error_errno() got downgraded to log_debug_errno().

4 weeks agounits: allow io.systemd.Hostname to be available earlier
Michael Vogt [Thu, 19 Mar 2026 15:05:52 +0000 (16:05 +0100)] 
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.

4 weeks agotests: drop _weak_ from the SYSTEMD_TEST_TABLE definition
Zbigniew Jędrzejewski-Szmek [Thu, 19 Mar 2026 10:44:40 +0000 (11:44 +0100)] 
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.

4 weeks agotest-bpf-token: convert "intro" to a test
Zbigniew Jędrzejewski-Szmek [Thu, 19 Mar 2026 10:43:08 +0000 (11:43 +0100)] 
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.

4 weeks agotimesyncd: drop obsolete privilege dropping code
Zbigniew Jędrzejewski-Szmek [Thu, 19 Mar 2026 17:57:11 +0000 (18:57 +0100)] 
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 00a415fc8f9e3469549a56d29f448b8cf14b0598, which made
running under an unprivileged user unconditional.

4 weeks agotest: add basic TEST-74-AUX-UTILS.socket-proxyd.sh
Michael Vogt [Wed, 18 Mar 2026 12:23:20 +0000 (13:23 +0100)] 
test: add basic TEST-74-AUX-UTILS.socket-proxyd.sh

With the planned extraction of the socket-forward code its useful
to have a basic way to validate the functionality. So add a basic
test that ensures at least base functionality is intact.

4 weeks agoVarious dissect-image cleanups (#41178)
Chris Down [Fri, 20 Mar 2026 03:52:32 +0000 (11:52 +0800)] 
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.

4 weeks agopo: Translated using Weblate (Kabyle)
Massii Aqvayli [Thu, 19 Mar 2026 20:58:44 +0000 (20:58 +0000)] 
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

4 weeks agohwdb/keyboard: Map FN key on Wareus B15
Artem Proskurnev [Thu, 19 Mar 2026 15:39:21 +0000 (18:39 +0300)] 
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

4 weeks agodissect-image: Add usr verity partition coverage 41178/head
Chris Down [Thu, 19 Mar 2026 13:35:46 +0000 (21:35 +0800)] 
dissect-image: Add usr verity partition coverage

4 weeks agotest-time-util: restore relaxation of check is special timezones
Zbigniew Jędrzejewski-Szmek [Thu, 19 Mar 2026 11:39:17 +0000 (12:39 +0100)] 
test-time-util: restore relaxation of check is special timezones

Fixup for 514fa9d39ae9935ef1e014a3dd48dd5856007df2. 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.

4 weeks agodissect-image: Consolidate verity validation and setup
Chris Down [Thu, 19 Mar 2026 13:15:44 +0000 (21:15 +0800)] 
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.

4 weeks agodissect-image: Merge partition handler code
Chris Down [Thu, 19 Mar 2026 13:10:21 +0000 (21:10 +0800)] 
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.

4 weeks agodissect-image: Fix wrong UUID logged on usr verity partition mismatch
Chris Down [Thu, 19 Mar 2026 13:01:54 +0000 (21:01 +0800)] 
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.

4 weeks agovconsole-setup: make work somewhat cleanly if loadkeys/setfont are not available...
Lennart Poettering [Thu, 19 Mar 2026 12:23:32 +0000 (13:23 +0100)] 
vconsole-setup: make work somewhat cleanly if loadkeys/setfont are not available (#40959)

4 weeks agoci: Update prompt to reduce time spent re-checking comments
Daan De Meyer [Thu, 19 Mar 2026 10:34:25 +0000 (11:34 +0100)] 
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.

4 weeks agoci: Instruct claude to not do any escaping for review comments
Daan De Meyer [Thu, 19 Mar 2026 10:12:37 +0000 (11:12 +0100)] 
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.

4 weeks agoci: Have claude spend more effort on reviews
Daan De Meyer [Thu, 19 Mar 2026 09:34:04 +0000 (10:34 +0100)] 
ci: Have claude spend more effort on reviews

Let's give this a try and see how it impacts reviews (and cost).

4 weeks agovconsole-setup: handle gracefully if setfont/loadkeys are not available 40959/head
Lennart Poettering [Thu, 5 Mar 2026 15:13:39 +0000 (16:13 +0100)] 
vconsole-setup: handle gracefully if setfont/loadkeys are not available

Let's not complain too loudly if these external binaries aren't there.

4 weeks agovconsole-setup: add a bunch of assert()s
Lennart Poettering [Thu, 5 Mar 2026 15:13:34 +0000 (16:13 +0100)] 
vconsole-setup: add a bunch of assert()s

4 weeks agouserdb: add birthDate field to JSON user records (#40954)
Luca Boccassi [Wed, 18 Mar 2026 23:04:03 +0000 (23:04 +0000)] 
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.

4 weeks agoAdd tmpfiles --inline and use it in one unit file (#41034)
Zbigniew Jędrzejewski-Szmek [Wed, 18 Mar 2026 21:49:11 +0000 (22:49 +0100)] 
Add tmpfiles --inline and use it in one unit file (#41034)

4 weeks agouserdb: add birthDate field to JSON user records 40954/head
Dylan M. Taylor [Fri, 6 Mar 2026 12:34:57 +0000 (07:34 -0500)] 
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.

4 weeks agohostname: add API for getting custom fields from machine-info
seaeunlee [Fri, 6 Mar 2026 00:33:01 +0000 (00:33 +0000)] 
hostname: add API for getting custom fields from machine-info

4 weeks agoTranslations update from Fedora Weblate (#41164)
Luca Boccassi [Wed, 18 Mar 2026 20:42:46 +0000 (20:42 +0000)] 
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)

4 weeks agopo: Translated using Weblate (Punjabi) 41164/head
A S Alam [Wed, 18 Mar 2026 18:58:46 +0000 (18:58 +0000)] 
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

4 weeks agopo: Translated using Weblate (Finnish)
Jan Kuparinen [Wed, 18 Mar 2026 18:58:46 +0000 (18:58 +0000)] 
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

4 weeks agopo: Translated using Weblate (Kabyle)
Massii Aqvayli [Wed, 18 Mar 2026 18:58:45 +0000 (18:58 +0000)] 
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

4 weeks agoman: switch ostree link to manpage
Luca Boccassi [Wed, 18 Mar 2026 18:18:39 +0000 (18:18 +0000)] 
man: switch ostree link to manpage

Webpage has been defaced and taken over

4 weeks agoci: Add back subagents and stop using --json-schema in claude-review
Daan De Meyer [Wed, 18 Mar 2026 13:32:21 +0000 (14:32 +0100)] 
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.

4 weeks agoRename verb functions for consistency and add per-verb constant parameter (#41003)
Zbigniew Jędrzejewski-Szmek [Wed, 18 Mar 2026 15:46:13 +0000 (16:46 +0100)] 
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.

4 weeks agoTEST-22-TMPFILES: add simple test for tmpfiles --inline 41034/head
Zbigniew Jędrzejewski-Szmek [Tue, 10 Mar 2026 22:20:15 +0000 (23:20 +0100)] 
TEST-22-TMPFILES: add simple test for tmpfiles --inline

Also add tests for handling of invalid_config.

4 weeks agounits: stop using rm in system-update-cleanup.service
Zbigniew Jędrzejewski-Szmek [Tue, 10 Mar 2026 21:59:37 +0000 (22:59 +0100)] 
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.

4 weeks agotmpfiles: add --inline
Zbigniew Jędrzejewski-Szmek [Tue, 10 Mar 2026 21:53:03 +0000 (22:53 +0100)] 
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 ...

4 weeks agotime-util: extract parse_calendar_date() from sysupdate
Dylan M. Taylor [Fri, 6 Mar 2026 12:27:10 +0000 (07:27 -0500)] 
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.

4 weeks agoci: Don't read claude settings from the repo
Daan De Meyer [Wed, 18 Mar 2026 12:40:13 +0000 (13:40 +0100)] 
ci: Don't read claude settings from the repo

Shouldn't be possible, but extra hardening never hurts.

4 weeks agoci: Prettify JSON in pr context file so claude can parse it
Daan De Meyer [Wed, 18 Mar 2026 12:38:17 +0000 (13:38 +0100)] 
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.

4 weeks agoci: Allow claude-review access to /tmp and /var/tmp
Daan De Meyer [Wed, 18 Mar 2026 12:34:34 +0000 (13:34 +0100)] 
ci: Allow claude-review access to /tmp and /var/tmp

4 weeks agoci: Stop using subagents in claude-review workflow
Daan De Meyer [Wed, 18 Mar 2026 11:55:45 +0000 (12:55 +0100)] 
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.

4 weeks agomeasure: make tpm_log_tagged_event() measure CC as well
Vitaly Kuznetsov [Fri, 13 Mar 2026 12:02:51 +0000 (13:02 +0100)] 
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.

4 weeks agosd-dlopen: make macros to generate .notes.dlopen sections public API (#41047)
Luca Boccassi [Wed, 18 Mar 2026 12:33:58 +0000 (12:33 +0000)] 
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"]}]
```

4 weeks agoci: Allow all commands in claude-review workflow
Daan De Meyer [Wed, 18 Mar 2026 11:30:41 +0000 (12:30 +0100)] 
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.

4 weeks agoci: Enable unpriv user namespaces for claude-review
Daan De Meyer [Wed, 18 Mar 2026 11:24:34 +0000 (12:24 +0100)] 
ci: Enable unpriv user namespaces for claude-review

Required for bubblewrap to work properly.

4 weeks agoansi-color: fix SYSTEMD_COLORS=true regression when output is piped
Nandakumar Raghavan [Mon, 16 Mar 2026 10:42:08 +0000 (10:42 +0000)] 
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.

4 weeks agoci: Bump number of turns for claude and mention turns in prompt
Daan De Meyer [Wed, 18 Mar 2026 10:46:01 +0000 (11:46 +0100)] 
ci: Bump number of turns for claude and mention turns in prompt

claude keeps failing by its subagents completing after it has already
written the review for large prs. It seems to run out of turns, tries
to get the subagents to post partial reviews but doesn't seem to stop
them.

Let's insist that it waits for background tasks to stop but let's also
increase the max turns a bit so it doesn't run out as quickly.

4 weeks agoci: Enable network isolation for claude and allow most tools
Daan De Meyer [Wed, 18 Mar 2026 10:28:55 +0000 (11:28 +0100)] 
ci: Enable network isolation for claude and allow most tools

claude wants to use python to access the JSON context so let's allow
it. Since python3 basically allows you to reimplement every other tool,
let's just enable all tools except the web related ones but enable network
isolation so it can't try to exfiltrate anything via python.

4 weeks agorepart: add --grain-size= option for partition alignment
Nandakumar Raghavan [Wed, 25 Feb 2026 06:38:31 +0000 (06:38 +0000)] 
repart: add --grain-size= option for partition alignment

Add a --grain-size= CLI option to override the default 4 KiB partition
alignment grain. Setting --grain-size=1M matches the alignment used by
fdisk/parted and fixes misaligned partitions after small fixed-size
partitions like the 16 KiB verity-sig partition.

Also fix context_place_partitions() to re-align the start offset after
each partition, not just once per free area. Without this, a small
partition would cause all subsequent partitions in the same free area
to start at an unaligned offset.

4 weeks agodocs: update security policy to suggest GH advisories
Luca Boccassi [Tue, 17 Mar 2026 18:26:04 +0000 (18:26 +0000)] 
docs: update security policy to suggest GH advisories

4 weeks agoci: reeanble compilation test with clang -O2, disable -Wmaybe-uninitialized for old gcc 41003/head
Zbigniew Jędrzejewski-Szmek [Mon, 9 Mar 2026 12:18:22 +0000 (13:18 +0100)] 
ci: reeanble compilation test with clang -O2, disable -Wmaybe-uninitialized for old gcc

In CI we get spurious failures about unitialized variables with gcc
versions older then (depending on the case) 12, 13, or 14. Let's only
try to do this check with newer gcc which returns more useful results.
At the same time, do compile with both gcc and clang at -O2, just
disable the warning.

The old logic seems to have been confused. We compile with -Wall, at
least in some cases, which includes -Wmaybe-unitialized. So if we
_don't_ want it, we need to explicitly disable it.

4 weeks agobless-boot: use verb function argument
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 16:13:58 +0000 (17:13 +0100)] 
bless-boot: use verb function argument

4 weeks agoreport: use verb function argument
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 16:03:47 +0000 (17:03 +0100)] 
report: use verb function argument

4 weeks agotree-wide: extend verbs functions with extra per-verb data parameter
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 13:16:08 +0000 (14:16 +0100)] 
tree-wide: extend verbs functions with extra per-verb data parameter

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
parse_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.

This matches a pattern we have in conf-parser.h, where we have both
void *userdata (more global) and void *data (per-config item). Here,
I opted for uintptr_t userdata. It seems that most of the time we'll
want to just pass an enum value. This works OK with no casts. I also
tried a void* and union. In both cases, much more boilerplate is needed:
either a cast or a macro to help avoid compiler warnings. uintptr_t
seems generic enough to cover foreseeable usecases with no fuss.

This is a noop refactoring. See next commit for an example.

4 weeks agoupdate-utmp: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 13:03:10 +0000 (14:03 +0100)] 
update-utmp: call all verb functions verb_*

4 weeks agopull: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:32:05 +0000 (13:32 +0100)] 
pull: call all verb functions verb_*

4 weeks agoimport-fs: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:29:54 +0000 (13:29 +0100)] 
import-fs: call all verb functions verb_*

4 weeks agoimport: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:27:59 +0000 (13:27 +0100)] 
import: call all verb functions verb_*

4 weeks agoexport: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:27:03 +0000 (13:27 +0100)] 
export: call all verb functions verb_*

4 weeks agooomctl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:18:14 +0000 (13:18 +0100)] 
oomctl: call all verb functions verb_*

4 weeks agoportablectl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:17:11 +0000 (13:17 +0100)] 
portablectl: call all verb functions verb_*

4 weeks agoresolvectl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:15:41 +0000 (13:15 +0100)] 
resolvectl: call all verb functions verb_*

4 weeks agotimedatectl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:13:37 +0000 (13:13 +0100)] 
timedatectl: call all verb functions verb_*

4 weeks agoudevadm: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:11:18 +0000 (13:11 +0100)] 
udevadm: call all verb functions verb_*

4 weeks agouserdbctl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:06:44 +0000 (13:06 +0100)] 
userdbctl: call all verb functions verb_*

4 weeks agonetworkctl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:05:09 +0000 (13:05 +0100)] 
networkctl: call all verb functions verb_*

4 weeks agomachinectl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 12:00:39 +0000 (13:00 +0100)] 
machinectl: call all verb functions verb_*

4 weeks agohostnamectl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 11:56:09 +0000 (12:56 +0100)] 
hostnamectl: call all verb functions verb_*

4 weeks agolocalectl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 11:56:03 +0000 (12:56 +0100)] 
localectl: call all verb functions verb_*

4 weeks agoimportctl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 11:51:19 +0000 (12:51 +0100)] 
importctl: call all verb functions verb_*

4 weeks agologinctl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 11:47:40 +0000 (12:47 +0100)] 
loginctl: call all verb functions verb_*

4 weeks agocoredumpctl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 11:45:01 +0000 (12:45 +0100)] 
coredumpctl: call all verb functions verb_*

4 weeks agobusctl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 11:33:06 +0000 (12:33 +0100)] 
busctl: call all verb functions verb_*

4 weeks agohomectl: call all verb functions verb_*
Zbigniew Jędrzejewski-Szmek [Fri, 6 Mar 2026 11:26:05 +0000 (12:26 +0100)] 
homectl: call all verb functions verb_*

This series of renaming patches has a few overlapping motivations:
- when functions are named uniformly, it code is more obvious
- I want to add a parameter to all verb functions
- in #40880 uniform naming of verb functions will be necessary too.
So let's do this cleanup. Some tools had a mix of functions w/ and
w/o "verb_", which looked messy.

4 weeks agosd-dlopen: relicense header to MIT-0 41047/head
Christian Brauner [Thu, 12 Mar 2026 12:51:16 +0000 (13:51 +0100)] 
sd-dlopen: relicense header to MIT-0

Relicense sd-dlopen.h from LGPL-2.1-or-later to MIT-0 so that
downstream projects can copy/paste the macros directly without
introducing a build dependency on the systemd headers.

Acked-by: Lennart Poettering <lennart@amutable.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
4 weeks agoman: add sd-dlopen(3) and SD_ELF_NOTE_DLOPEN(3) man pages
Christian Brauner [Wed, 11 Mar 2026 14:55:08 +0000 (15:55 +0100)] 
man: add sd-dlopen(3) and SD_ELF_NOTE_DLOPEN(3) man pages

Document the new public sd-dlopen.h header and SD_ELF_NOTE_DLOPEN()
macro with associated constants. Includes usage examples for single
and multiple soname annotations.

Signed-off-by: Christian Brauner <brauner@kernel.org>
4 weeks agodlfcn-util: migrate to public SD_ELF_NOTE_DLOPEN() API
Christian Brauner [Wed, 11 Mar 2026 14:55:02 +0000 (15:55 +0100)] 
dlfcn-util: migrate to public SD_ELF_NOTE_DLOPEN() API

Switch all internal callers from the private ELF_NOTE_DLOPEN() macro to
the new public SD_ELF_NOTE_DLOPEN() API from sd-dlopen.h, and remove
the now-redundant macro definitions from dlfcn-util.h.

Signed-off-by: Christian Brauner <brauner@kernel.org>
4 weeks agosd-dlopen: add header-only public API for FDO .note.dlopen ELF metadata
Christian Brauner [Wed, 11 Mar 2026 14:54:54 +0000 (15:54 +0100)] 
sd-dlopen: add header-only public API for FDO .note.dlopen ELF metadata

Expose ELF note dlopen annotation macros as a public header-only API in
sd-dlopen.h. This allows any project to embed .note.dlopen metadata in
their ELF binaries by simply including the header - no runtime linkage
against libsystemd is required.

The header provides SD_ELF_NOTE_DLOPEN() and associated macros/constants
implementing the ELF dlopen metadata specification for declaring optional
shared library dependencies loaded via dlopen() at runtime.

Signed-off-by: Christian Brauner <brauner@kernel.org>
4 weeks agocoredump: capture crashing thread ID and name
noxiouz [Fri, 13 Mar 2026 00:36:08 +0000 (00:36 +0000)] 
coredump: capture crashing thread ID and name

Add %I (TID in initial PID namespace) to the core_pattern, so the
kernel passes the crashing thread's TID to systemd-coredump. Use it
to read the thread's comm name from /proc/<tid>/comm and log both as
new journal fields:

  COREDUMP_TID=       — TID of the crashing thread
  COREDUMP_THREAD_NAME= — comm name of the crashing thread

These fields are also stored as xattrs on external coredump files
(user.coredump.tid, user.coredump.thread_name) and displayed by
coredumpctl info alongside the PID line.

For single-threaded processes the TID equals the PID and thread_name
equals comm; for multi-threaded programs with named worker threads
(pthread_setname_np / PR_SET_NAME) this identifies which thread
crashed without needing to open the coredump file itself.

The new fields are optional in the socket forwarding path, so older
systemd-coredump senders are handled gracefully.

Co-developed-by: Claude <claude@anthropic.com>
4 weeks agofind-esp: introduce _full() flavour of ESP/XBOOTLDR discovery functions
Lennart Poettering [Fri, 13 Mar 2026 10:53:57 +0000 (11:53 +0100)] 
find-esp: introduce _full() flavour of ESP/XBOOTLDR discovery functions

These functions take so many return paramaters, and in many of our cases
we don't actually needt them. Hence introduce _full() flavours of the
funcs, and hide the params by default.

4 weeks agoci: Reduce retention for pr-context JSON file to a week
Daan De Meyer [Wed, 18 Mar 2026 09:35:28 +0000 (10:35 +0100)] 
ci: Reduce retention for pr-context JSON file to a week

We don't need to keep this around fpr 90 days, let's keep it around
for a week.

4 weeks agoci: Enable users without write action to the repo to access claude review
Daan De Meyer [Wed, 18 Mar 2026 07:59:48 +0000 (08:59 +0100)] 
ci: Enable users without write action to the repo to access claude review

The labelling approach introduced in 6089075265765b43e6666e4d5978292a32501496
means contributors can now trigger the workflow on their own when the label
is added by a maintainer and they update the PR. Hence we need to allow all
users to access the claude code action. This is safe because we already gate
the workflow ourselves to only the contributors that we want to allow.
Additionally, the claude code job has no permissions anymore except read access
to the repository and can execute very limited tools, so this should be safe.

4 weeks agoci: Fix artifact name in claude-review workflow
Daan De Meyer [Wed, 18 Mar 2026 08:11:09 +0000 (09:11 +0100)] 
ci: Fix artifact name in claude-review workflow

The name doesn't actually matter, it gets replaced with the name
of the file when not archiving. So stop passing a name and pass in
the filename as the name when downloading the artifact.

4 weeks agoci: Use artifacts to pass around pr context
Daan De Meyer [Tue, 17 Mar 2026 23:02:26 +0000 (00:02 +0100)] 
ci: Use artifacts to pass around pr context

The current approach runs into issues on large prs:
https://github.com/systemd/systemd/actions/runs/23220105199/job/67490722033

4 weeks agoci: Add issue comments to pr context for claude-review as well
Daan De Meyer [Tue, 17 Mar 2026 22:10:01 +0000 (23:10 +0100)] 
ci: Add issue comments to pr context for claude-review as well

Follow up for fb513a7e1c5aa5f1ac7a274a0ebf9a6ed7fc02d1. The issue
comments are the regular comments left on the pr.