]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 days agoudev/net: document IRQAffinityPolicy=, IRQAffinity=, and 40304/head
Quentin Deslandes [Thu, 8 Jan 2026 00:25:56 +0000 (01:25 +0100)] 
udev/net: document IRQAffinityPolicy=, IRQAffinity=, and
IRQAffinityNUMA=

9 days agoudev/net: add IRQAffinityNUMA= option for NUMA-aware filtering
Quentin Deslandes [Mon, 16 Feb 2026 19:43:37 +0000 (20:43 +0100)] 
udev/net: add IRQAffinityNUMA= option for NUMA-aware filtering

Add support for filtering IRQ affinity to CPUs on a specific NUMA node
via the new IRQAffinityNUMA= option in .link files. The option accepts:
- "local": use the NUMA node local to the NIC's PCIe slot
- Explicit node number (0, 1, 2, ...): use CPUs on the specified node

When both IRQAffinity= and IRQAffinityNUMA= are specified, their
intersection is used. If the intersection is empty, an error is logged
and IRQ affinity configuration is skipped.

When "local" is specified but the device's NUMA node cannot be
determined (numa_node shows -1), a warning is logged and IRQ affinity
configuration is skipped.

9 days agoudev/net: add IRQAffinity= option to filter eligible CPUs
Quentin Deslandes [Mon, 16 Feb 2026 19:40:38 +0000 (20:40 +0100)] 
udev/net: add IRQAffinity= option to filter eligible CPUs

Add IRQAffinity= option to .link files that filters the set of CPUs
eligible for IRQ placement. This works in conjunction with
IRQAffinityPolicy= to constrain which CPUs receive network IRQs.

When specified with spread policy, only the listed CPUs are considered
for IRQ distribution. When specified with single policy, IRQs are
pinned to the first CPU in the allowed set instead of CPU 0.

9 days agoudev/net: implement IRQAffinityPolicy=spread with topology awareness
Quentin Deslandes [Mon, 16 Feb 2026 19:38:19 +0000 (20:38 +0100)] 
udev/net: implement IRQAffinityPolicy=spread with topology awareness

Implement the spread policy for IRQ affinity distribution using a
topology-aware algorithm. The algorithm:

1. Discovers CPU topology from sysfs (NUMA node, package, die/L3, core)
2. Groups CPUs by L3 cache domain (die) with equidistant ordering
3. Round-robins across dies, spreading IRQs across the system
4. Uses first hyperthread of each core before second hyperthreads
5. Applies IRQ affinity via /proc/irq/<n>/smp_affinity

When there are more IRQs than CPUs, queues wrap around using round-robin.

9 days agoudev/net: add IRQAffinityPolicy= option for .link files
Quentin Deslandes [Mon, 16 Feb 2026 18:39:04 +0000 (19:39 +0100)] 
udev/net: add IRQAffinityPolicy= option for .link files

Add support for configuring IRQ affinity for network interfaces via
systemd .link files. For now, the new IRQAffinityPolicy= option in the [Link]
section only accepts "single", which pins all MSI IRQs to CPU 0.

This allows declarative IRQ affinity configuration for network devices
during udev processing, which is useful for optimizing network
performance on multi-core systems.

Further commits will expand the options supported by IRQAffinityPolicy=.

9 days agotest: add test-link-abi to enforce link-time ABI invariants
Daan De Meyer [Thu, 14 May 2026 19:20:02 +0000 (19:20 +0000)] 
test: add test-link-abi to enforce link-time ABI invariants

For every built executable, internal shared library, and plugin module,
verify two link-time properties via readelf:

1. No imported GLIBC symbol's version is newer than 2.34.
2. The dynamic section's NEEDED entries reference only glibc, the
   runtime linker, our own libraries.

9 days agotree-wide: Replace exp10() with our own impl
Daan De Meyer [Fri, 15 May 2026 12:16:01 +0000 (12:16 +0000)] 
tree-wide: Replace exp10() with our own impl

exp10() has a symbol version > 2.34 on latest glibc. To allow
dropping our baseline required glibc runtime version to <= 2.34,
let's add our own version to prevent pulling in the newer symbol
from glibc.

9 days agocore: introduce varlink `io.systemd.Job` interface (#42104)
Yu Watanabe [Wed, 20 May 2026 08:22:18 +0000 (17:22 +0900)] 
core: introduce varlink `io.systemd.Job` interface (#42104)

Methods:

- `io.systemd.Job.List` — list all queued jobs or look up by `id`/`unit`
name, with streaming support. Uses context/runtime split: `JobContext`
(Unit, JobType) and `JobRuntime` (Id, State, Result,
ActivationDetails). Follows the same SELinux and parameter-conflict
patterns as `io.systemd.Unit.List`.
- `io.systemd.Job.Cancel` — cancel a specific job by ID, with SELinux
and polkit authorization.
- `io.systemd.Job.ClearAll` — cancel all pending jobs, with SELinux and
polkit authorization.

9 days agonetworkd: fix race condition in per-interface ICMPv6 processing
Patrick Rohr [Mon, 4 May 2026 20:31:10 +0000 (13:31 -0700)] 
networkd: fix race condition in per-interface ICMPv6 processing

There exists a small window of time in icmp6_bind() between creating the
ICMPv6 socket and binding it to an ifindex, where the link-scoped socket
can process an ICMPv6 packet received on any interface. The applies to
both sd-radv and sd-ndisc codepaths.

This change adds an explicit check for ifindex on the receive path and
ignores packets received on other interfaces.

Co-developed-by: OpenAI Codex <noreply@openai.com>
9 days agosd-bus: add depth limit to message_skip_fields() to prevent stack overflow (#42164)
Yu Watanabe [Wed, 20 May 2026 01:22:32 +0000 (10:22 +0900)] 
sd-bus: add depth limit to message_skip_fields() to prevent stack overflow (#42164)

`message_skip_fields()` recursively processes D-Bus variant types in
message header fields with no depth limit. A crafted message with deeply
nested variants can cause unbounded recursion and overflow the stack.

Add a `depth` parameter checked against `BUS_CONTAINER_DEPTH` (128),
matching the limit already enforced by the public
`sd_bus_message_skip()` API. All recursive call sites pass `depth + 1`,
and the top-level caller in `message_parse_fields()` passes `0`.

9 days agoCouple of test fixes (#42185)
Yu Watanabe [Wed, 20 May 2026 01:15:01 +0000 (10:15 +0900)] 
Couple of test fixes (#42185)

9 days agocore: improve errors from varlink io.systemd.Unit.StartTransient
Michael Vogt [Tue, 19 May 2026 18:32:41 +0000 (20:32 +0200)] 
core: improve errors from varlink io.systemd.Unit.StartTransient

The existing error reporting for the varlink `StartTransient` code
was converting all errors into `VARLINK_ERROR_UNIT_BAD_SETTING`.

This is not correct in some cases, we need to have a more targted
pattern here, i.e. only convert EINVAL to VARLINK_ERROR_UNIT_BAD_SETTING
and otherwise return the matching varlink error from the errno instead.

This commit fixes this issue. Thanks to Ivan Kruglov for raising
this.

9 days agotree-wide: move static dl handles into their dlopen_*() functions (#42168)
Yu Watanabe [Wed, 20 May 2026 01:08:11 +0000 (10:08 +0900)] 
tree-wide: move static dl handles into their dlopen_*() functions (#42168)

Each dlopen_*() wrapper kept its dl handle as a file-scope
'static void *xxx_dl = NULL;' even though only the wrapper itself
ever referenced it. Move each one inside the corresponding function
so its scope matches its actual use, leaving the rest of each
translation unit free of the unused file-scope name.

In pcre2-util.c the assert(pcre2_dl) in pattern_matches_and_log()
becomes assert(sym_pcre2_match), which carries the same invariant
(pattern_compile_and_log() ran dlopen_pcre2()).

9 days agotest: switch TEST-55-OOMD stress-ng --vm-method to lfsr32 42185/head
Luca Boccassi [Tue, 19 May 2026 21:42:25 +0000 (22:42 +0100)] 
test: switch TEST-55-OOMD stress-ng --vm-method to lfsr32

Commit 881e4717c7 ("test: pin stress-ng --vm-method to a portable
scalar method in TEST-55-OOMD") pinned --vm-method=zero-one with the
rationale that it is "a long-standing scalar method". That rationale is
wrong: stress_vm_zero_one() in stress-ng's stress-vm.c is declared

    static size_t TARGET_CLONES stress_vm_zero_one(...)

i.e. it carries the exact same TARGET_CLONES attribute as 33 of the 35
other vm methods. On x86_64 with GCC >=5, TARGET_CLONES expands (see
core-target-clones.h in stress-ng) to a target_clones attribute
including "arch=skylake-avx512", "arch=cooperlake", "arch=tigerlake",
"arch=sapphirerapids", and several other AVX-512-bearing arch variants,
plus "default". GCC generates AVX-512 clones of stress_vm_zero_one() and
the IFUNC resolver picks them on any CPU that advertises AVX-512.

The only vm methods in stress-ng's registry whose function definitions
omit TARGET_CLONES entirely (and are therefore guaranteed not to
dispatch to an AVX-512 clone) are lfsr32 (portable, always registered)
and write64ds (x86_64-only, gated on HAVE_ASM_X86_MOVDIRI, i.e. Intel
Tremont / Tiger Lake+ MOVDIRI instruction).

Switch the four stress-ng --vm invocations in TEST-55-OOMD to
--vm-method=lfsr32 so the AVX-512 SIGILL on CPUs without AVX-512 (e.g.
AMD Zen 1-3) can no longer occur regardless of compiler version,
optimization level, or stress-ng package build.

Follow-up for 881e4717c7981b274853309e68b39153e3b292f4

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
9 days agotest: fix race in TEST-07-PID1.socket-on-failure.sh
Luca Boccassi [Tue, 19 May 2026 21:00:58 +0000 (22:00 +0100)] 
test: fix race in TEST-07-PID1.socket-on-failure.sh

The test waited for the OnFailure= service's filesystem side effect
(`rmdir` of the directory) and then immediately invoked
`systemctl is-active`. Between `rmdir(2)` returning (which causes the
shell loop to exit) and PID1 reaping the child and transitioning the
oneshot service from `activating` to `active`, there is a small window
where `is-active` can observe `activating` and fail the test.

Wait directly on the unit state instead, matching the pattern used a
few lines above for the `is-failed` case.

  [ 1880.326704] TEST-07-PID1.sh[21489]: + timeout --foreground 60 bash -c 'while [[ -d '\''/tmp/TEST-07-PID1-socket-8467/test'\'' ]]; do sleep .5; done'
  [ 1880.330482] TEST-07-PID1.sh[21489]: + [[ ! -e /tmp/TEST-07-PID1-socket-8467/test ]]
  [ 1880.330482] TEST-07-PID1.sh[21489]: + systemctl is-active TEST-07-PID1-socket-OnFailure.service
  [ 1880.347470] TEST-07-PID1.sh[21520]: activating
  [ 1880.349508] TEST-07-PID1.sh[21489]: + at_exit
  [ 1880.349508] TEST-07-PID1.sh[21489]: + systemctl stop TEST-07-PID1-socket-8467.socket
  [ 1880.367331] TEST-07-PID1.sh[107]: Subtest /usr/lib/systemd/tests/testdata/units/TEST-07-PID1.socket-on-failure.sh failed
  [ 1880.367331] TEST-07-PID1.sh[107]: + return 1

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
9 days agotest: add test for variant recursion depth limit in message_skip_fields() 42164/head
TristanInSec [Tue, 19 May 2026 21:33:11 +0000 (17:33 -0400)] 
test: add test for variant recursion depth limit in message_skip_fields()

Craft a raw D-Bus message with an unknown header field containing
BUS_CONTAINER_DEPTH+1 nested variants and verify that message parsing
rejects it with -EBADMSG rather than recursing until stack overflow.

9 days agosd-bus: add depth limit to message_skip_fields() to prevent stack overflow
TristanInSec [Tue, 19 May 2026 21:33:06 +0000 (17:33 -0400)] 
sd-bus: add depth limit to message_skip_fields() to prevent stack overflow

message_skip_fields() recurses for each nested variant ('v') type in
D-Bus message header fields. A crafted message with deeply nested
variants (e.g., a variant containing a variant containing a variant...)
causes unbounded stack growth, leading to stack overflow and crash.

Add a depth parameter that increments on each recursive call and
rejects messages exceeding BUS_CONTAINER_DEPTH with -EBADMSG. This
matches the existing depth limits enforced elsewhere in the sd-bus
message processing (e.g., bus_message_enter_container).

9 days agotools: add a test wrapper that replays crashing tests under gdb
Daan De Meyer [Sat, 16 May 2026 19:09:12 +0000 (19:09 +0000)] 
tools: add a test wrapper that replays crashing tests under gdb

meson test --wrapper hook to print a gdb backtrace inline in the test
log when a test exits with an actual crash signal (SIGSEGV, SIGABRT,
SIGBUS, SIGFPE, SIGILL). Wired into the default add_test_setup() so it
runs automatically on every `meson test`.

Environmental terminations (SIGTERM/SIGKILL/SIGPIPE/SIGALRM) are passed
through without replay, and the original signal is re-raised so the
parent's wait() observes WIFSIGNALED rather than a plain exit code.

9 days agosocket-proxy: implement PROXY protocol v1
Дамјан Георгиевски [Mon, 18 May 2026 21:07:37 +0000 (23:07 +0200)] 
socket-proxy: implement PROXY protocol v1

as specified by the haproxy documentation:
https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

only protocol v1 is implemented for now, protocol v2 is binary,
and will be implemented in the future.

the proxy protocol allows the destination/target to know the
address/port of the client connectiing.

in nginx it's supported by enabling the `proxy_protocol` parameter to
the `listen` directive.

9 days agotree-wide: move static dl handles into their dlopen_*() functions 42168/head
Daan De Meyer [Sat, 16 May 2026 15:50:31 +0000 (15:50 +0000)] 
tree-wide: move static dl handles into their dlopen_*() functions

Each dlopen_*() wrapper kept its dl handle as a file-scope
'static void *xxx_dl = NULL;' even though only the wrapper itself
ever referenced it. Move each one inside the corresponding function
so its scope matches its actual use, leaving the rest of each
translation unit free of the unused file-scope name.

In pcre2-util.c the assert(pcre2_dl) in pattern_matches_and_log()
becomes assert(sym_pcre2_match), which carries the same invariant
(pattern_compile_and_log() ran dlopen_pcre2()).

9 days agolibcrypt-util: Clean up dlopen_libcrypt()
Daan De Meyer [Tue, 19 May 2026 08:37:56 +0000 (08:37 +0000)] 
libcrypt-util: Clean up dlopen_libcrypt()

9 days agobpf-util; Add back caching on error/success
Daan De Meyer [Tue, 19 May 2026 08:32:26 +0000 (08:32 +0000)] 
bpf-util; Add back caching on error/success

Follow up for 7d822ca8

10 days agoudev: predictable names for auxiliary sub-function (SF) devices (#42154)
Yu Watanabe [Tue, 19 May 2026 18:33:15 +0000 (03:33 +0900)] 
udev: predictable names for auxiliary sub-function (SF) devices (#42154)

Some drivers (currently mlx5_core) expose sub-functions (SFs) of a PCI
Physical or Virtual Function as auxiliary devices that carry a stable
`sfnum` sysfs attribute (the user-defined SF number passed to `devlink
port add ... sfnum N`). Their leaf devices (net, infiniband, ...)
currently inherit the parent PF/VF's `ID_PATH` and the SF netdev falls
through to the kernel-assigned `eth<N>` name.

Two patches:

1. `udev-builtin-path_id`: prepend an `sf-<N>` token when the walk
crosses an aux device with `sfnum`, so SF leaf devices get an `ID_PATH`
distinct from the parent PF/VF (e.g. `pci-0000:c1:00.0-sf-88`). Aux
devices without `sfnum` keep the pre-patch behaviour, so existing
`ID_PATH` values are unchanged and the patch needs no naming-scheme gate
(path_id is unversioned).

2. `udev-builtin-net_id`: name SF host netdevs analogously to SR-IOV VF
host netdevs — walk to the parent PCI function and append a
single-character `S<sfnum>` suffix. SFs hosted on SR-IOV VFs (VF-SF) get
both suffixes chained on the PF's base name (`enp193s0f0v0S88`). Gated
behind `NAMING_SUBFUNC` / `NAMING_V261`. Man page
(`systemd.net-naming-scheme(7)`) updated.

The patches apply to any driver that exposes its SF leaf devices below
an aux device exposing `sfnum`.

Validated on mlx5 hardware: PF, VF, SF-on-PF (`enp8s0f0S88`,
`pci-0000:08:00.0-sf-88`). VF-SF case verified with a fake-sysfs setup
since this is not supported by any real device and is more a theoretical
use case.

10 days agomkosi: update mkosi ref to 77fce77807a9a92bc37edc8f1c967102e6236d94
Daan De Meyer [Tue, 19 May 2026 13:52:14 +0000 (13:52 +0000)] 
mkosi: update mkosi ref to 77fce77807a9a92bc37edc8f1c967102e6236d94

77fce77807 apk: Implement repository_key_fetch for the postmarketOS distribution
7068ed49ab postmarketos: Add ruff to tools tree
dea4b6bfc8 Add newline when writing machine id into /etc/machine-id
944b775d40 tools: add libtss2-tcti-device0 to opensuse tools tree
d856d65d3b mkosi-initrd: Also add cryptsetup-libs explicitly to the initrd
1cc967c5b3 mkosi-initrd: Trim orphaned GPU/audio modules, add ACPI platform attrs
a3e95a7c29 mkosi-tools: Add fish to misc profile
76b02d1f84 mkosi-tools: Add jujutsu to misc profile
0afe4cd254 mkosi-tools: Move gh to misc profile
9077634bad mkosi-tools: Add cryptsetup-libs to centos/fedora/opensuse
82846347af box: Drop background tinting
3e50b97101 mkosi-tools: Add libfido2
78c2784827 vmspawn: Use --ephemeral rather than copy_ephemeral()
dc801b00a3 Added second call to update kerneltype after kernel is defined
0c5cc04a8b vmspawn: Forward journal-remote settings to vmspawn
2518468c65 nspawn: Use --forward-journal instead of running journal-remote ourselves
d2b798d00c apk: skip removal of packages that aren't installed

10 days agoresolve: cap pre-allocation for questions/RRs
Frantisek Sumsal [Tue, 19 May 2026 12:51:56 +0000 (14:51 +0200)] 
resolve: cap pre-allocation for questions/RRs

Since [0] and [1] questions & answer RRs from the incoming packets are
parsed into a hashmap to speed things up. The hashmaps are even
pre-allocated to speed things up even more, but there's one caveat - the
size for the pre-allocation comes from one or more fields from the
incoming packets that are under sender's control.

This can be abused by a malicious DNS server which can send a packet
with a spoofed QDCOUNT (for question packets) or ANCOUNT/NSCOUNT/ARCOUNT
(for answer packets). The limit of the final value in both cases is 64K.
This value is then used to pre-allocate the hashmap (via
set_reserve()/ordered_set_reserve(), where the caller also multiplies
the input value by 2 in both cases), which in turns calls
resize_buckets() that memzero()s the pre-allocated area, so all the
pages are faulted in, showing in process' RSS. Each such spoofed packet
then can translate into a ~4 MiB allocation in the systemd-resolved
process, which doesn't sound that bad.

However, this can be further amplified if the spoofed packet ends up in
resolved's cache. So, if the spoofed packet contains one valid A record
and then an OPT record with a spoofed ARCOUNT, the whole packet ends up
in the cache that can hold 4K of entries, which can eventually cause
resolved to keep up to 16 GiB of memory just for the cache (and thanks
to the memzero() above it's all RSS). Note that all this requires
someone with enough privileges to configure resolved to actually point
to such malicious DNS server or it could come from a malicious DHCP
server on the network. This could also get exploited via LLMNR, but in
thas case an attacker would have to match an ID of a valid transaction
for the packet to end up in resolved's cache.

For example, with a malicious DNS already in resolved configuration:

$ resolvectl dns eth0
Link 2 (eth0): 192.168.99.1:5354

Filling resolved's cache:

$ for i in {0..4200}; do resolvectl query test-$i.example.com; done
...
test-4200.example.com: 192.0.2.1               -- link: dummy0

-- Information acquired via protocol DNS in 1.6ms.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: no
-- Data from: network

Yields following memory increase:

$ while :; do grep VmRSS /proc/$(pidof systemd-resolved)/status; sleep 1; done
VmRSS:     14280 kB
VmRSS:     14280 kB
...
VmRSS:    403352 kB
VmRSS:   1017976 kB
VmRSS:   1603876 kB
VmRSS:   2202028 kB
...
VmRSS:  16795724 kB
VmRSS:  16795724 kB

In my testing I also noticed one annoyance - after certain threshold the
RSS increase persisted even after the malicious entries were evicted
from the cache (or flushed via `resolvectl flush-caches`). This was most
likely due to mmap_threshold getting bumped to > 4 MiB and neither cache
eviction nor flush-caches call malloc_trim(0) (via
sd_event_trim_memory() or similar).

To mitigate this, let's cap the pre-allocation to a maximum number of
records the given packet body can realistically contain. If the minimum
size would be, for whatever unlikely reason, not enough, nothing serious
would happen - the hashmap would still get resized automatically by
resize_buckets(), it'd be just slightly slower.

[0] ae45e1a3832fbb6c96707687e42f0b4aaab52c9b
[1] 2d34cf0c16dd8fa71fb593e65ce4734cb61d9170

10 days agosystemd-coredump: add COREDUMP_CODE (#42019)
Yu Watanabe [Tue, 19 May 2026 18:10:40 +0000 (03:10 +0900)] 
systemd-coredump: add COREDUMP_CODE (#42019)

Add COREDUMP_CODE to the fields captured by systemd-coredump. This makes
it possible for system administrators to filter coredumps based on si_code,
which describes the reason why a given signal was sent.

For example, to find processes killed due to invalid permissions
(SEGV_ACCERR):

$ journalctl COREDUMP_SIGNAL=11 COREDUMP_CODE=2

I've decided to add the value of si_code to the 'Signal: ' line of
coredumpctl info:
    Signal: 11 (SEGV) si_code: SEGV_ACCERR

10 days agonetworkd: add RouteTable= to [DHCPv6] section
Nandakumar Raghavan [Tue, 28 Apr 2026 11:14:48 +0000 (11:14 +0000)] 
networkd: add RouteTable= to [DHCPv6] section

Allow users to allow DHCPv6 unreachable/blackhole routes (installed
for delegated prefixes) into a specific routing table, analogous to
the existing RouteTable= in [DHCPv4] and [IPv6AcceptRA].

The config parser config_parse_dhcp_or_ra_route_table() is extended
with an AF_UNSPEC ltype discriminator for DHCPv6 (AF_INET6 is already
taken by NDISC/RA). link_get_dhcp6_route_table() follows the same
pattern as link_get_dhcp4_route_table() and link_get_ndisc_route_table(),
falling back to the VRF table when not explicitly set.

In dhcp_request_unreachable_route(), the table is applied only for
NETWORK_CONFIG_SOURCE_DHCP6 routes (the uplink unreachable aggregates),
not DHCP_PD routes (per-subnet routes on downstream interfaces), matching
the intent of the feature. The !route->table_set guard avoids overriding
a table already set by the route code.

10 days agobuild(deps): bump the actions group with 2 updates
dependabot[bot] [Tue, 19 May 2026 15:08:45 +0000 (15:08 +0000)] 
build(deps): bump the actions group with 2 updates

Bumps the actions group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials).

Updates `github/codeql-action` from 4.35.2 to 4.35.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/95e58e9a2cdfd71adc6e0353d5c52f41a045d225...68bde559dea0fdcac2102bfdf6230c5f70eb485e)

Updates `aws-actions/configure-aws-credentials` from 6.1.0 to 6.1.1
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/ec61189d14ec14c8efccab744f656cffd0e33f37...d979d5b3a71173a29b74b5b88418bfda9437d885)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: aws-actions/configure-aws-credentials
  dependency-version: 6.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
10 days agoTranslations update from Fedora Weblate (#42181)
Luca Boccassi [Tue, 19 May 2026 16:53:11 +0000 (17:53 +0100)] 
Translations update from Fedora Weblate (#42181)

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)

10 days agopo: Translated using Weblate (Georgian) 42181/head
Temuri Doghonadze [Tue, 19 May 2026 16:01:24 +0000 (16:01 +0000)] 
po: Translated using Weblate (Georgian)

Currently translated at 100.0% (270 of 270 strings)

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ka/
Translation: systemd/main

10 days agopo: Translated using Weblate (Polish)
Marek Adamski [Tue, 19 May 2026 16:01:23 +0000 (16:01 +0000)] 
po: Translated using Weblate (Polish)

Currently translated at 100.0% (270 of 270 strings)

Co-authored-by: Marek Adamski <maradam@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pl/
Translation: systemd/main

10 days agopo: Translated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 19 May 2026 16:01:22 +0000 (16:01 +0000)] 
po: Translated using Weblate (Ukrainian)

Currently translated at 100.0% (270 of 270 strings)

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/uk/
Translation: systemd/main

10 days agopo: Translated using Weblate (Swedish)
Luna Jernberg [Tue, 19 May 2026 16:01:22 +0000 (16:01 +0000)] 
po: Translated using Weblate (Swedish)

Currently translated at 100.0% (270 of 270 strings)

Co-authored-by: Luna Jernberg <droidbittin@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sv/
Translation: systemd/main

10 days agopo: Translated using Weblate (Portuguese)
Américo Monteiro [Tue, 19 May 2026 16:01:21 +0000 (16:01 +0000)] 
po: Translated using Weblate (Portuguese)

Currently translated at 100.0% (270 of 270 strings)

Co-authored-by: Américo Monteiro <a_monteiro@gmx.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pt/
Translation: systemd/main

10 days agopo: Translated using Weblate (Turkish)
Oğuz Ersen [Tue, 19 May 2026 16:01:21 +0000 (16:01 +0000)] 
po: Translated using Weblate (Turkish)

Currently translated at 100.0% (270 of 270 strings)

Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/tr/
Translation: systemd/main

10 days agodependabot: Ignore mkosi
Daan De Meyer [Tue, 19 May 2026 13:56:57 +0000 (13:56 +0000)] 
dependabot: Ignore mkosi

It doesn't update MinimumVersion= in mkosi.conf which breaks
tools/fetch-mkosi.py.

10 days agotest: pin stress-ng --vm-method to a portable scalar method in TEST-55-OOMD
Luca Boccassi [Tue, 19 May 2026 10:29:58 +0000 (11:29 +0100)] 
test: pin stress-ng --vm-method to a portable scalar method in TEST-55-OOMD

The stress-ng "vm" stressor's default --vm-method=all cycles through every
VM stress method, including newer ones that use AVX-512 instructions. On
CPUs without AVX-512 support (e.g. AMD Zen 1 to 3) those methods crash with
SIGILL. In testcase_oom_rulesets_lasting_sec all 10 stress-ng workers die
within ~2.34 seconds, so by the time the 6 second sleep elapses the unit
is already in failed/exit-code state and the assert_eq for
ActiveState=active trips.

Pin --vm-method=zero-one, a long-standing scalar method, on all four
stress-ng --vm invocations in this test (the two transient services in
testcase_oom_rulesets and testcase_oom_rulesets_lasting_sec, plus
TEST-55-OOMD-testbloat.service and TEST-55-OOMD-testmunch.service) so the
workers do not crash on AVX-512-less CPUs. testbloat, testmunch and
testcase_oom_rulesets have not been observed failing because they get
OOM-killed by systemd-oomd within ~1 to 2 seconds, before stress-ng cycles
into an AVX-512 method, but they share the same latent flake.

Journal excerpts from the failing run, TEST-55-OOMD-slowrule.service in
testcase_oom_rulesets_lasting_sec (journalctl -o short-monotonic):

[   58.018676] stress-ng[1015]: invoked with '/usr/bin/stress-ng --timeout 15s --vm 10 --vm-bytes 50M --vm-keep' by user 0 'root'
[   59.866072] stress-ng[1030]: stress-ng: debug: [1030] caught SIGILL, address 0x000055bd8d609140 (ILL_ILLOPN)
[   59.921050] stress-ng[1030]: stress-ng: debug: [1030] stress-ng: info: 0x000055bd8d609140:<62>71 fd 48 6f 2d 36 14 1c 00 c5 d1 ef ed 49 29
[   59.929310] stress-ng[1015]: stress-ng: error: [1015] vm: [1021] terminated with an error, exit status=2 (stressor failed)
[   60.364111] stress-ng[1015]: stress-ng: info:  [1015] failed: 10: vm (10)
[   60.364493] stress-ng[1015]: stress-ng: info:  [1015] unsuccessful run completed in 2.34 secs
[   60.371290] systemd[1]: TEST-55-OOMD-slowrule.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
[   60.371396] systemd[1]: TEST-55-OOMD-slowrule.service: Failed with result 'exit-code'.
[   64.017061] TEST-55-OOMD.sh[1010]: + assert_eq failed active
[   64.018167] TEST-55-OOMD.sh[1039]: FAIL: expected: 'active' actual: 'failed'

The faulting bytes marked by stress-ng with <62> (the byte at the
instruction pointer) decode unambiguously to an AVX-512 VMOVDQA64 using
the 512-bit zmm13 register, confirmed independently by two disassemblers:

  $ printf '\x62\x71\xfd\x48\x6f\x2d\x36\x14\x1c\x00' | ndisasm -b 64 -
  00000000  6271FD486F2D3614  vmovdqa64 zmm13,zword [rel 0x1c1440]
           -1C00

  $ echo '0x62, 0x71, 0xfd, 0x48, 0x6f, 0x2d, 0x36, 0x14, 0x1c, 0x00' | \
        llvm-mc -disassemble -triple=x86_64 -mattr=+avx512f
          .text
          vmovdqa64       1840182(%rip), %zmm13

The leading 0x62 is the EVEX prefix (exclusive to AVX-512 on this target),
zmm13 is a 512-bit register that only exists when AVX-512 is implemented,
and VMOVDQA64 requires the AVX512F (Foundation) CPUID feature (Intel SDM
Vol 2C). Executing this on a CPU without AVX-512 raises #UD, delivered by
the kernel as SIGILL/ILL_ILLOPN, matching the journal entry above. The
same journal shows the kernel reporting "kvm_amd: TSC scaling supported",
i.e. the guest is on AMD KVM, and AMD did not ship AVX-512 before Zen 4.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
10 days agovmspawn: port help() to help-util.h APIs
Lennart Poettering [Tue, 19 May 2026 12:42:04 +0000 (14:42 +0200)] 
vmspawn: port help() to help-util.h APIs

10 days agoUpdate NEWS
Luca Boccassi [Tue, 19 May 2026 13:11:13 +0000 (14:11 +0100)] 
Update NEWS

10 days agohomed/fscrypt: add new xattr format hardening key sealing (#41816)
Luca Boccassi [Tue, 19 May 2026 13:56:18 +0000 (14:56 +0100)] 
homed/fscrypt: add new xattr format hardening key sealing (#41816)

The current key sealing format has some less-than-ideal weaknesses:

- PBKDF2 with only 65k iterations, where recommendations are ~200k
- AES with null IV, relying on salt for uniqueness
- lack of AES MAC/AEAD

However improbable, it is at least theorically possible that with
a lot of resources an offline bruteforce could be attempted.

Add a v2 sealing format, keeping unsealing compatibility with
the current format:

 `v2:<iterations>:<salt>:<IV>:<ciphertext>:<aes tag>`

and use 600k iterations for the PBKDF2 sha512

10 days agoNEWS: mention auxiliary sub-function (SF) network device naming 42154/head
Jiri Pirko [Tue, 19 May 2026 12:10:32 +0000 (14:10 +0200)] 
NEWS: mention auxiliary sub-function (SF) network device naming

Document user-visible effect of the new NAMING_SUBFUNC / v261 scheme.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
10 days agoupdate TODO
Lennart Poettering [Tue, 19 May 2026 12:41:45 +0000 (14:41 +0200)] 
update TODO

10 days agoudev-builtin-net_id: name auxiliary sub-function (SF) host network devices
Jiri Pirko [Thu, 7 May 2026 14:52:02 +0000 (16:52 +0200)] 
udev-builtin-net_id: name auxiliary sub-function (SF) host network devices

Some drivers (currently mlx5_core) expose sub-functions (SFs) of a PCI
Physical Function as auxiliary devices. Each SF carries a host network
interface that sits below the aux device in sysfs:

  /sys/devices/.../<PF BDF>/mlx5_core.sf.<idx>/net/eth<N>

Because the network device's immediate parent is the aux device and not
a PCI device, names_pci() bails out and these interfaces fall through
to the kernel-assigned eth<N> name, which is not stable across reboots,
module reloads or topology changes.

The naming applies when the SF network device's direct sysfs parent is
the aux device that exposes sfnum, i.e. the kernel driver passes the
aux device to SET_NETDEV_DEV(). mlx5_core does so. ice's
ice_sf_cfg_netdev() currently passes the parent PF's PCI device, so ice
SF network devices sit as siblings of the PF rather than below the aux
device and fall outside this precondition; pending a kernel change in
ice to mirror mlx5's SET_NETDEV_DEV(netdev, &adev->dev), they continue
to receive the kernel-assigned name as they do today.

The aux device exposes 'sfnum', the user-defined sub-function number
(the value passed to "devlink port add ... sfnum N"), which is stable
and unique within its parent PF. The aux device's direct sysfs parent
is the PF's PCI device.

Treat an SF host network device analogously to an SR-IOV VF host
network device: walk to the parent PCI function, derive the base name
from there, then append a single-character "S<sfnum>" suffix. Lowercase
's' is already taken (slot) and the existing grammar uses one character
per token, so 'S' is the best option.

E.g. for an SF whose parent PF is at PCI 0000:c1:00.0 and which was
added with "sfnum 88":

  ID_NET_NAME_PATH=enp193s0f0S88
  ID_NET_NAME_SLOT=enp193s0f0S88

This is parallel to how SR-IOV VFs get a "v<N>" suffix on top of the
parent PF's name.

Gate the new behaviour behind NAMING_SUBFUNC and NAMING_V261. Document
the new suffix in both the ID_NET_NAME_SLOT and ID_NET_NAME_PATH
grammars in systemd.net-naming-scheme(7) and add a v261 history entry.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
10 days agoudev-builtin-path_id: emit 'sf-<N>' token for auxiliary sub-functions
Jiri Pirko [Mon, 11 May 2026 10:58:05 +0000 (12:58 +0200)] 
udev-builtin-path_id: emit 'sf-<N>' token for auxiliary sub-functions

Some drivers expose sub-functions (SFs) of a PCI Physical or Virtual
Function as auxiliary devices that carry a stable 'sfnum' sysfs
attribute — the user-defined sub-function number (e.g. the value
passed to "devlink port add ... sfnum N"). The SF's leaf devices
(uverbs, infiniband, net, ...) sit below this aux device in sysfs:

  /sys/devices/.../<PF or VF BDF>/<sf aux>/.../<leaf>

Currently path_id walks straight past the aux device, so all leaf
devices below an SF end up sharing ID_PATH=pci-<BDF> with their
parent PF or VF. For uverbs this causes a /dev/infiniband/by-path/
symlink collision, and for any other consumer of ID_PATH/ID_PATH_TAG
it makes PF and SF (or VF and VF-SF) indistinguishable.

Recognise the 'auxiliary' subsystem in path_id's walk: when the aux
device exposes 'sfnum', prepend an 'sf-<N>' token; otherwise leave
it untokenised. The result for an SF whose parent PF is at PCI
0000:c1:00.0 and which was added with "sfnum 88" is:

  ID_PATH=pci-0000:c1:00.0-sf-88
  ID_PATH_TAG=pci-0000_c1_00_0-sf-88

This is parallel to how net_id's NAMING_SUBFUNC scheme appends 'S<N>'
on top of the PF base name. Aux devices without 'sfnum' keep the
pre-patch behaviour: the walk skips over them with no token. Existing
ID_PATH values for PF and VF leaf devices are therefore unchanged,
the change is purely additive, and there is no need to gate it behind
a naming scheme (path_id itself is unversioned).

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
10 days agosome NEWS fixed by Claude
Lennart Poettering [Tue, 19 May 2026 12:35:09 +0000 (14:35 +0200)] 
some NEWS fixed by Claude

10 days agohomed/fscrypt: add new xattr format hardening key sealing 41816/head
Luca Boccassi [Fri, 24 Apr 2026 19:43:30 +0000 (20:43 +0100)] 
homed/fscrypt: add new xattr format hardening key sealing

The current key sealing format has some less-than-ideal weaknesses:

- PBKDF2 with only 65k iterations, where recommendations are ~200k
- AES with null IV, relying on salt for uniqueness
- lack of AES MAC/AEAD

However improbable, it is at least theorically possible that with
a lot of resources an offline bruteforce could be attempted.

Add a v2 sealing format, keeping unsealing compatibility with
the current format:

 v2:<iterations>:<salt>:<IV>:<ciphertext>:<aes tag>

and use 600k iterations for the PBKDF2 sha512

10 days agofstab-generator: fix spurious quota warning for xfs
Vincent Mihalkovic [Mon, 11 May 2026 11:52:49 +0000 (13:52 +0200)] 
fstab-generator: fix spurious quota warning for xfs

Filesystems like xfs, btrfs, gfs2 and ocfs2 handle quotas internally
and do not need external quotacheck/quotaon services. When usrquota or
grpquota mount options are used in fstab for these filesystems,
generator_hook_up_quotacheck() falls through to the !fstype_needs_quota()
branch and emits a misleading warning that quotas are "not supported"
when they actually work fine — the kernel handles them internally.

Add fstype_has_internal_quota() to return early with a debug message,
and adopt a tri-state return convention so the caller skips quotaon
when quotacheck was not needed.

The buggy code path was introduced in #24824 and #24880.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
10 days agotest: add test coverage for homed+fscrypt
Luca Boccassi [Fri, 24 Apr 2026 18:16:36 +0000 (19:16 +0100)] 
test: add test coverage for homed+fscrypt

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
10 days agoupdate TODO
Lennart Poettering [Tue, 19 May 2026 11:04:18 +0000 (13:04 +0200)] 
update TODO

10 days agotest: add integration tests for io.systemd.Job varlink methods 42104/head
Ivan Kruglov [Fri, 15 May 2026 14:02:15 +0000 (07:02 -0700)] 
test: add integration tests for io.systemd.Job varlink methods

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
10 days agotest: wait systemd to finish reexec in TEST-74-AUX-UTILS.varlinkctl.sh
Ivan Kruglov [Mon, 18 May 2026 07:45:23 +0000 (00:45 -0700)] 
test: wait systemd to finish reexec in TEST-74-AUX-UTILS.varlinkctl.sh

10 days agotest: split TEST-74-AUX-UTILS.varlinkctl.sh into per-interface subtests
Ivan Kruglov [Fri, 15 May 2026 14:01:43 +0000 (07:01 -0700)] 
test: split TEST-74-AUX-UTILS.varlinkctl.sh into per-interface subtests

Split the monolithic varlinkctl test script into separate files per varlink interface for better organization and easier maintenance:
- varlinkctl.sh: core varlinkctl tool tests (CLI, transports, socket discovery, upgrade/serve) and io.systemd.Manager
- varlinkctl-network.sh: io.systemd.Network
- varlinkctl-unit.sh: io.systemd.Unit (system + user manager)
- varlinkctl-metrics.sh: io.systemd.Metrics

No functional changes — the test content is moved as-is.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
10 days agocore: introduce io.systemd.Job interface with List, Cancel, and ClearAll methods
Ivan Kruglov [Fri, 15 May 2026 14:01:27 +0000 (07:01 -0700)] 
core: introduce io.systemd.Job interface with List, Cancel, and ClearAll methods

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
10 days agoshared: extend Job varlink type with Unit and ActivationDetails fields
Ivan Kruglov [Fri, 15 May 2026 14:00:07 +0000 (07:00 -0700)] 
shared: extend Job varlink type with Unit and ActivationDetails fields

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
10 days agocoredump: add COREDUMP_CODE field for signal reason 42019/head
Emanuele Rocca [Wed, 6 May 2026 15:46:21 +0000 (15:46 +0000)] 
coredump: add COREDUMP_CODE field for signal reason

Introduce COREDUMP_CODE as a new captured field alongside the existing
COREDUMP_SIGNAL. While COREDUMP_SIGNAL identifies the signal number that
terminated the process, COREDUMP_CODE provides the reason the signal was sent.

For example, a process terminated by SIGSEGV due to invalid permissions would
produce COREDUMP_SIGNAL=11 and COREDUMP_CODE=2 (SEGV_ACCERR).

The kernel exposes coredump_code via pidfd starting with v7.1:
https://git.kernel.org/torvalds/c/701f7f4fbabbf4989ba6fbf033b160dd943221d5

System administrators can find both the signal and code in coredumpctl info:

$ coredumpctl info | grep Signal:
        Signal: 11 (SEGV) si_code: SEGV_MAPERR

Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
10 days agosignal-util: add signal_code_to_string
Emanuele Rocca [Mon, 11 May 2026 13:13:20 +0000 (13:13 +0000)] 
signal-util: add signal_code_to_string

Add signal_code_to_string() in signal-util.c and cover the si_code values
defined in libc's siginfo-consts.h. Fall back to the numeric value when no
symbolic name is known.

Co-developed-by: Codex (GPT-5) <noreply@openai.com>
Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
10 days agoinclude: add coredump_code to struct pidfd_info
Emanuele Rocca [Wed, 6 May 2026 15:43:58 +0000 (15:43 +0000)] 
include: add coredump_code to struct pidfd_info

Linux v7.1 adds coredump_code to struct pidfd_info and defines a few new
constants. Reflect the changes in include/override/sys/pidfd.h too.

Stop including the libc version of sys/pidfd.h to be able to override the
definition of pidfd_info.

Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
10 days agoVarious dlopen/linking cleanups from #42100 (#42166)
Daan De Meyer [Tue, 19 May 2026 06:54:27 +0000 (08:54 +0200)] 
Various dlopen/linking cleanups from #42100 (#42166)

- **bpf-util: rename from bpf-dlopen, unify version-specific symbol
handling**
- **cryptsetup: dlopen libcryptsetup in tokens**
- **tree-wide: dlopen libpam in pam plugins**
- **test-bus-marshal: dlopen() glib and libdbus instead of linking
directly**
- **lock-util: Simplify timeout for lock_generic_with_timeout()**
- **color-util: simplify hsv_to_rgb, fix rgb_to_hsv negative-hue wrap**
- **tree-wide: Use our own macros instead of fabs()/fmax()/fmin()**
- **locale-util: dlopen() libintl instead of linking against it**
- **home: Use log2u64() over log2()**
- **meson: drop libdl, threads, and librt dependencies**
- **libc: Use dlsym() from a constructor instead of weak symbols**
- **libc: Make sure C23 versions of strtol(), sscanf() are not used**

10 days agoFix an invalid section in example for NFTSet
Dmitry Konishchev [Tue, 19 May 2026 06:25:20 +0000 (09:25 +0300)] 
Fix an invalid section in example for NFTSet

`NFTSet` is supposed to be in `Service` instead of `Unit` section. The current example leads to `Unknown key 'NFTSet' in section [Unit], ignoring` in systemd logs.

10 days agodissect: guard against ssize_t overflow in LUKS2 header parser (#42162)
Lennart Poettering [Tue, 19 May 2026 06:30:07 +0000 (08:30 +0200)] 
dissect: guard against ssize_t overflow in LUKS2 header parser (#42162)

The `json_len` variable in `partition_is_luks2_integrity()` is
`ssize_t`, but the subtraction `be64toh(header.hdr_len) -
LUKS2_FIXED_HDR_SIZE` can yield a value exceeding `SSIZE_MAX` when
`hdr_len` is a large crafted value. This causes signed integer overflow
and a subsequent oversized `malloc()` that fails with `-ENOMEM`,
producing a misleading out-of-memory error instead of a clear
invalid-header rejection.

Two call sites pass `size = UINT64_MAX`, which neutralizes the existing
`hdr_len > size` guard.

Add an explicit check against `SSIZE_MAX` before the cast to `ssize_t`.

10 days agoresolved: add missing polkit checks on FlushCaches and ResetServerFeatures D-Bus...
TristanInSec [Mon, 18 May 2026 17:30:51 +0000 (13:30 -0400)] 
resolved: add missing polkit checks on FlushCaches and ResetServerFeatures D-Bus methods

The FlushCaches and ResetServerFeatures D-Bus methods perform
destructive operations (flushing all DNS caches and resetting server
feature negotiation including DNS-over-TLS state) without any
authorization check. The corresponding Varlink methods already enforce
polkit via verify_polkit(), but the D-Bus handlers were not updated.

Add bus_verify_polkit_async() calls to both methods, matching the
pattern used by ResetStatistics. Add the corresponding policy actions
to the polkit policy file.

10 days agoupdate NEWS
Lennart Poettering [Mon, 18 May 2026 21:43:23 +0000 (23:43 +0200)] 
update NEWS

10 days agoupdate NEWS
Lennart Poettering [Mon, 18 May 2026 21:17:28 +0000 (23:17 +0200)] 
update NEWS

10 days agolibc: Make sure C23 versions of strtol(), sscanf() are not used 42166/head
Daan De Meyer [Thu, 14 May 2026 19:20:02 +0000 (19:20 +0000)] 
libc: Make sure C23 versions of strtol(), sscanf() are not used

When _GNU_SOURCE is defined, glibc will always use c23 versions
of strtol(), sscanf() and friends if available (introduced after
glibc 2.34). Which means that any binaries built with headers
from newer glibc won't load on glibc < 2.38. To work around this,
redefine the appropriate constants to zero make sure the c99
versions are used instead.

10 days agolibc: Use dlsym() from a constructor instead of weak symbols
Daan De Meyer [Thu, 14 May 2026 19:20:02 +0000 (19:20 +0000)] 
libc: Use dlsym() from a constructor instead of weak symbols

Weak symbols still introduce a version requirement on a newer libc.
Resolve each libc symbol via dlsym(RTLD_DEFAULT) from a per-shim
constructor and cache the result in a file-scope static instead. This
avoids the version requirement, keeps the call path free of atomics
(constructors run single-threaded before main() and before any signal
handler can fire), and keeps dlsym() out of contexts where it is not
async-signal-safe.

10 days agomeson: drop libdl, threads, and librt dependencies
Daan De Meyer [Fri, 15 May 2026 09:54:53 +0000 (09:54 +0000)] 
meson: drop libdl, threads, and librt dependencies

Our baseline glibc is 2.34, which merged libdl, libpthread (the
dependency('threads') target), and librt into libc. Empty .so/.a stubs
remain for backward compatibility with old binaries, but new builds
resolve dl_*, pthread_*, mq_*, timer_*, etc. directly from libc.
On musl the same libraries are likewise empty stubs.

Drop the libdl, threads, and librt entries from every meson.build, and
remove the now-stale 'Libs.private: -lrt -pthread' from libudev.pc.in
since both flags resolve to empty link-time stubs on glibc 2.34+ and
musl.

Verified with readelf -d that libsystemd.so, libudev.so, and systemd no
longer carry DT_NEEDED entries for libdl/libpthread/librt.

10 days agohome: Use log2u64() over log2()
Daan De Meyer [Fri, 15 May 2026 11:06:21 +0000 (11:06 +0000)] 
home: Use log2u64() over log2()

And drop the libm dependency.

10 days agolocale-util: dlopen() libintl instead of linking against it
Daan De Meyer [Fri, 15 May 2026 18:33:43 +0000 (18:33 +0000)] 
locale-util: dlopen() libintl instead of linking against it

dgettext() lives in libc on glibc and in libintl.so.8 on musl with
gettext. Resolve it via dlsym() so neither configuration produces a
hard link-time dependency on libintl: try libintl.so.8 first and fall
back to RTLD_DEFAULT (which finds dgettext in libc on glibc).

The _() macro now expands to a runtime check that returns the
untranslated string if dlopen_libintl() has not run successfully, so
callers don't have to gate every translatable message on a runtime
check. pam_systemd_home — currently the only consumer of _() — calls
dlopen_libintl() best-effort from each PAM entry point.

The meson find_library('intl') dance is replaced with a has_header()
check; the only thing we need at build time is the prototype.

10 days agotree-wide: Use our own macros instead of fabs()/fmax()/fmin()
Daan De Meyer [Fri, 15 May 2026 11:06:21 +0000 (11:06 +0000)] 
tree-wide: Use our own macros instead of fabs()/fmax()/fmin()

To make this work, ABS() is made generic so it also works on
floats and doubles.

While at it, fold the __ABS_INTEGER indirection and the
assert_cc(sizeof(long long) == sizeof(intmax_t)) away. The previous
form switched between __builtin_llabs (clang) and __builtin_imaxabs
(gcc), with the assert keeping the two paths behaviorally identical
on every platform we build for. imaxabs was originally chosen because
intmax_t is conceptually the widest signed integer type the platform
exposes, but the _Generic ABS already casts to (long long) before the
call, so the extra width imaxabs could in theory carry was being
narrowed away immediately anyway. With both paths collapsed to
__builtin_llabs((long long) (a)), the size relationship between
long long and intmax_t is no longer relevant.

Also add explicit unsigned long long / unsigned long / unsigned int
cases that pass the argument through unchanged. The previous default
branch cast unsigned values to (long long); for values above LLONG_MAX
this reinterprets them as negative, and __builtin_llabs(LLONG_MIN) is
UB. Unsigned values are already non-negative, so passing them through
is both correct and avoids the narrowing. Smaller unsigned types
(unsigned char, unsigned short) still go through the default branch
but promote to int first and fit in long long losslessly.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
10 days agocolor-util: simplify hsv_to_rgb, fix rgb_to_hsv negative-hue wrap
Daan De Meyer [Sun, 17 May 2026 11:28:00 +0000 (11:28 +0000)] 
color-util: simplify hsv_to_rgb, fix rgb_to_hsv negative-hue wrap

In hsv_to_rgb, restructure the conversion around the sector index
k = (int)(h/60) and fractional offset f = h/60 - k. The auxiliary
x value becomes c * (k & 1 ? 1.0 - f : f) and the six branches turn
into a switch on k. This drops the two xfmod() calls that were doing
the modulo work, in exchange for a single assert(h >= 0 && h < 360) —
all in-tree callers satisfy this and never relied on the wrap.

In rgb_to_hsv, the two xfmod() calls were no-ops (their arguments
were always within the divisor's magnitude). The trailing
xfmod(*ret_h, 360) appeared to be wrapping negative hues from the
r-max branch back into [0, 360), but fmod is sign-preserving so it
never did. Drop the no-ops and add an explicit +360 wrap so magenta
(1, 0, 1) now yields h ≈ 300 instead of -60.

Extend the tests to cover all six primary/secondary colors at sector
boundaries, all six sector midpoints (to catch any future inversion
of the ramp direction), the h-near-360 edge of the last sector, and
the rgb_to_hsv negative-wrap path via magenta. Switch the new and
existing integer-channel checks to ASSERT_EQ from tests.h; the
double-typed h/s/v range checks stay on ASSERT_TRUE since the
ASSERT_* comparison macros only support integer types.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
10 days agolock-util: Simplify timeout for lock_generic_with_timeout()
Daan De Meyer [Fri, 15 May 2026 08:57:24 +0000 (08:57 +0000)] 
lock-util: Simplify timeout for lock_generic_with_timeout()

We can just put a timeout on the parent process completing
rather than doing it inside the subprocess.

10 days agotest-bus-marshal: dlopen() glib and libdbus instead of linking directly
Daan De Meyer [Fri, 15 May 2026 18:24:11 +0000 (18:24 +0000)] 
test-bus-marshal: dlopen() glib and libdbus instead of linking directly

The test only uses 9 symbols (5 from glib, 4 from libdbus) for its
interop checks; dlopen them at runtime so the binary no longer carries a
hard link-time dependency on either library. Headers are still pulled in
through the *_cflags partial dependencies for the type declarations.

While we're at it, drop the compat glue for glib 2.36 which is long obsolete
at this point.

10 days agotree-wide: dlopen libpam in pam plugins
Daan De Meyer [Fri, 15 May 2026 14:54:04 +0000 (14:54 +0000)] 
tree-wide: dlopen libpam in pam plugins

Same reasoning as for cryptsetup tokens. It means we can include
the pam plugins in the main systemd package without the package
manager introducing a dependency on libpam. It also makes things
more consistent and makes writing the upcoming linking test script
a lot simpler.

At the same time, we get rid of the libpam_misc dependency as the
one symbol we were using from it is trivial to reimplement ourselves.

10 days agocryptsetup: dlopen libcryptsetup in tokens
Daan De Meyer [Fri, 15 May 2026 12:16:01 +0000 (12:16 +0000)] 
cryptsetup: dlopen libcryptsetup in tokens

This avoids having to subpackage the tokens separately. If they link directly
against libcryptsetup, package manager will automatically add a dependency on
libcryptsetup to the package containing the tokens. With this change, the tokens
can ship in the main systemd package without necessarily pulling in libcryptsetup.

It also makes things more consistent. Once we also do the same for pam, any direct
linking will be limited to just libc, which for example simplifies writing tests for
ensuring we don't link unnecessarily as we don't have to add exceptions for the
cryptsetup tokens.

This actually drops the dependency on cryptsetup-libs for the fedora/centos/opensuse
systemd-udev package so install it explicitly in the initrd now to keep the tests
working.

10 days agobpf-util: rename from bpf-dlopen, unify version-specific symbol handling
Daan De Meyer [Thu, 14 May 2026 17:13:06 +0000 (17:13 +0000)] 
bpf-util: rename from bpf-dlopen, unify version-specific symbol handling

Renames src/shared/bpf-dlopen.{c,h} to src/shared/bpf-util.{c,h} and
folds the former src/shared/bpf-compat.h (struct forward decl and
compat_bpf_map_create() helper) into the new header.

Aligns dlopen_bpf() with the standard wrapper pattern: drops the
manual dlopen_safe()/dlsym_many_or_warn()/TAKE_PTR(dl) plumbing and
the bespoke 'cached' int in favor of dlopen_many_sym_or_warn() inside
a FOREACH_STRING() soname-fallback loop.

Unifies declaration of the version-specific symbols (bpf_create_map,
bpf_map_create, bpf_object__next_map, bpf_token_create) into a single
DISABLE_WARNING_REDUNDANT_DECLS block in the header, and alphabetically
merges the DLSYM_PROTOTYPE list. DLSYM_OPTIONAL is used to load each
one — call sites already handle NULL (compat_bpf_map_create() and the
sym_bpf_object__next_map guard in userns-restrict.c). bpf_token_create
additionally defaults to a missing_bpf_token_create() stub returning
-ENOSYS, so callers can branch on the errno instead of NULL-checking
the pointer.

Updates test-bpf-token to match: drops the compile-time
LIBBPF_MAJOR_VERSION ≥ 1.5 gate and the direct <bpf/bpf.h> include in
favor of dlopen_bpf() + sym_bpf_token_create(), and treats -ENOSYS as
the test-skip path (covering both 'libbpf too old' and 'kernel lacks
BPF_TOKEN_CREATE support').

10 days agoimport: Handle small files (#42150)
Luca Boccassi [Mon, 18 May 2026 20:47:41 +0000 (21:47 +0100)] 
import: Handle small files (#42150)

When systemd-pull encountered a file shorter than the compression magic
    headers it looks for, then it would complete the download in the
    analysis state and fail.
    When we are still in the analysis state and the download is done, we
know there is no compression and we should leave the analysis state and
    continue writing out to disk as usual.

10 days agooomd: ruleset parsing
Matteo Croce [Thu, 25 Sep 2025 19:17:26 +0000 (21:17 +0200)] 
oomd: ruleset parsing

Add to oomd the capability to define rulesets in /etc/systemd/oomd/rules.d/
and then reference them with a new config option OOMRule=

11 days agodissect: use practical 16 MiB limit instead of SSIZE_MAX 42162/head
TristanInSec [Mon, 18 May 2026 18:39:44 +0000 (14:39 -0400)] 
dissect: use practical 16 MiB limit instead of SSIZE_MAX

As suggested by @yuwata, SSIZE_MAX is still too large and would cause
malloc() to fail anyway. Use a 16 MiB limit which is generous compared
to the typical 4 MiB maximum in cryptsetup (LUKS2_HDR_OFFSET_MAX).

11 days agodissect: guard against ssize_t overflow in LUKS2 header parser
TristanInSec [Mon, 18 May 2026 17:30:02 +0000 (13:30 -0400)] 
dissect: guard against ssize_t overflow in LUKS2 header parser

The json_len variable is ssize_t, but the subtraction
be64toh(header.hdr_len) - LUKS2_FIXED_HDR_SIZE can yield a value
exceeding SSIZE_MAX when hdr_len is a large crafted value. This causes
signed integer overflow and a subsequent oversized malloc() that fails
with -ENOMEM, producing a misleading out-of-memory error.

Add an explicit check against SSIZE_MAX before the cast to ssize_t.

11 days agoerrno-util: include -ENOENT in ERRNO_IS_XATTR_ABSENT()
Ivan Kruglov [Mon, 18 May 2026 10:57:43 +0000 (03:57 -0700)] 
errno-util: include -ENOENT in ERRNO_IS_XATTR_ABSENT()

The getxattr(2) man page only enumerates xattr-specific errors (ENODATA,
ENOTSUP, ERANGE, E2BIG, ...) in its own ERRORS section, but at the
bottom of that section notes that "the errors documented in stat(2) can
also be returned." stat(2) returns -ENOENT when a component of the path
does not exist, so any xattr lookup against a path can fail with -ENOENT
exactly the same way as -ENODATA — both mean "there is nothing here for
me to read." The previous definition of ERRNO_IS_NEG_XATTR_ABSENT()
reflected only the directly-enumerated errors and missed -ENOENT, so
callers that should semantically swallow "the xattr is absent" instead
bubbled -ENOENT up as a hard error.

The most visible consequence on real fleets has been systemd-journald
spamming dmesg with one line per dispatched log message whenever a
unit's cgroup directory cannot be found at the time
client_context_read_log_filter_patterns() is called — typically inside
containers whose journald observes clients whose unit cgroup is no
longer present in its view (cgroup-namespace boundary, unit teardown
race, transient sub-scope already collapsed back to its unit cgroup,
etc.). The same bug pattern lurks at every other cgroup-xattr callsite:
systemd-oomd reading user.oomd_avoid / user.oomd_omit / user.oomd_ooms
on cgroups it is concurrently killing; killall reading
user.survive_final_kill_signal during shutdown; cg_is_delegated() /
cg_has_coredump_receive() / cgroup_get_managed_oom_kill_last(); etc. For
these, "path is gone" is by construction the same answer as "xattr is
not set" — there is no way for the user to have attached an xattr to a
path that does not exist.

A quick survey of non-cgroup callers (src/portable/portable.c,
src/home/{homework-luks,user-record-util}.c,
src/random-seed/random-seed-tool.c, src/basic/os-util.c) confirms they
all operate on fds or on paths whose absence is already the desired
silent-skip outcome, so widening the macro to also fold in -ENOENT does
not change observable behavior at any other site.

Extend test-xattr-util's getxattr_at_malloc test with an explicit
non-existent-path lookup that asserts ERRNO_IS_NEG_XATTR_ABSENT() now
matches, alongside the pre-existing non-existent-xattr (-ENODATA) check.

11 days agodhcp-client: reject messages larger than the maximum UDP payload
Luca Boccassi [Mon, 18 May 2026 11:05:10 +0000 (12:05 +0100)] 
dhcp-client: reject messages larger than the maximum UDP payload

dhcp_message_verify_header() only enforced a lower bound on the input
length, so dhcp_message_parse() happily accepted arbitrarily large
buffers. Such inputs could never have been received via UDP and would
later fail in dhcp_message_build() with -E2BIG once the parsed options'
combined size exceeds UDP_PAYLOAD_MAX_SIZE, which the fuzzer surfaced as
an assertion failure.

Reject inputs above UDP_PAYLOAD_MAX_SIZE up front, so the parse stage
mirrors what the wire format can actually carry.

Follow-up for 8c18bb6547c2138f2f17b921ec06f2c1f7cd17cd

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

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
11 days agoChores for v261~rc1 (#42157)
Luca Boccassi [Mon, 18 May 2026 14:51:49 +0000 (15:51 +0100)] 
Chores for v261~rc1 (#42157)

11 days agoNEWS: typo fixes
Jörg Behrmann [Mon, 18 May 2026 13:24:54 +0000 (15:24 +0200)] 
NEWS: typo fixes

11 days agoFixes for claude review report (#42152)
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2026 13:13:24 +0000 (15:13 +0200)] 
Fixes for claude review report (#42152)

11 days agomeson: bump library sonames for v261~rc1 42157/head
Luca Boccassi [Mon, 18 May 2026 11:26:28 +0000 (12:26 +0100)] 
meson: bump library sonames for v261~rc1

11 days agoUpdate po files
Luca Boccassi [Mon, 18 May 2026 11:24:56 +0000 (12:24 +0100)] 
Update po files

ninja -C build systemd-update-po

11 days agoUpdate pot file
Luca Boccassi [Mon, 18 May 2026 11:18:45 +0000 (12:18 +0100)] 
Update pot file

ninja -C build systemd-pot

11 days agoUpdate syscall numbers
Luca Boccassi [Mon, 18 May 2026 11:18:04 +0000 (12:18 +0100)] 
Update syscall numbers

ninja -C build update-syscall-tables update-syscall-header

11 days agoUpdate hwdb autosuspend rules
Luca Boccassi [Mon, 18 May 2026 11:17:23 +0000 (12:17 +0100)] 
Update hwdb autosuspend rules

ninja -C build update-hwdb-autosuspend

11 days agoUpdate hwdb
Luca Boccassi [Mon, 18 May 2026 11:16:44 +0000 (12:16 +0100)] 
Update hwdb

ninja -C build update-hwdb

11 days agoNEWS: add new items for v261~rc1
Luca Boccassi [Mon, 18 May 2026 10:50:07 +0000 (11:50 +0100)] 
NEWS: add new items for v261~rc1

11 days agosysupdate: fix noop assert 42152/head
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2026 10:33:24 +0000 (12:33 +0200)] 
sysupdate: fix noop assert

Reported by qarmin (Rafał Mikrut).

11 days agorepart: fix bogus errno in error message and returned value
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2026 10:33:08 +0000 (12:33 +0200)] 
repart: fix bogus errno in error message and returned value

Reported by qarmin (Rafał Mikrut).

11 days agoresolved: add configurable DNS cache size
ishwarbb [Mon, 23 Mar 2026 13:02:40 +0000 (13:02 +0000)] 
resolved: add configurable DNS cache size

Add CacheSize= option to [Resolve] section of resolved.conf to allow
configuring the maximum number of entries in the per-scope DNS cache.
The default remains 4096 entries. Setting this to 0 disables caching
(similar to Cache=no).

CacheSize= is only read when Cache=yes or Cache=no-negative. When
Cache=no, caching is fully disabled regardless of CacheSize=.

Changes:
- Add cache_size field to Manager struct
- Parse CacheSize= from resolved.conf via gperf
- Thread cache_size through dns_cache_put() and helper functions
- Replace hard-coded CACHE_MAX with the configurable cache_size
- When cache_size is 0 or Cache=no, flush cache and skip caching
- Add man page documentation for the new option
- Add unit tests for cache size enforcement

Co-developed-by: Claude <claude@anthropic.com>
11 days agonsresourced: fix typo
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2026 10:31:55 +0000 (12:31 +0200)] 
nsresourced: fix typo

Reported by qarmin (Rafał Mikrut).

11 days agocoredump: use a fixed string instead a scope-delimited compound literal
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2026 10:31:46 +0000 (12:31 +0200)] 
coredump: use a fixed string instead a scope-delimited compound literal

The compound literal (const char[]){'.','.','.'} has block scope
(C99 6.5.2.5p6). Once we leave the if and loop back, copy[1].iov_base
formally points into a destroyed object. Works on GCC/Clang in practice,
but is UB.

Let's do the easy thing and use a string.

Reported by qarmin (Rafał Mikrut).

11 days agotree-wide: stop using lambda assignment in Python code (#42145)
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2026 10:42:02 +0000 (12:42 +0200)] 
tree-wide: stop using lambda assignment in Python code (#42145)

Follow-up for #40758.

11 days agocore/manager: fix (theoretical) fd leak on invalid messages
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2026 10:30:36 +0000 (12:30 +0200)] 
core/manager: fix (theoretical) fd leak on invalid messages

We'd leak fds on early return. We are sending a message to ourself,
so it's unlikely to fail. But let's keep the logic correct.

Reported by qarmin (Rafał Mikrut).

11 days agoimport: Handle small files 42150/head
Kai Lüke [Mon, 18 May 2026 07:46:28 +0000 (16:46 +0900)] 
import: Handle small files

When systemd-pull encountered a file shorter than the compression magic
headers it looks for, then it would complete the download in the
analysis state and fail.
When we are still in the analysis state and the download is done, we
know there is no compression and we should leave the analysis state and
continue writing out to disk as usual.

11 days agocore/dbus-execute: propagate oom in property_get_cpu_affinity
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2026 10:29:12 +0000 (12:29 +0200)] 
core/dbus-execute: propagate oom in property_get_cpu_affinity

The function already returns errors, so I'm not sure why we ignored
the error in the second call, potentially leaving variables unitialized.
It seems easiest to propagate the error.

Reported by qarmin (Rafał Mikrut).