Commit Graph
100 Commits
Author SHA1 Message Date
Luca Boccassi 17e3db12ca test: coco credential transport on snp (#43827) 2026-09-25 13:33:03 +02:00
Luca Boccassi 3f9d31fdc0 cryptenroll-varlink: Allow to display recovery-key before enrolling (#43687)
Closes https://github.com/systemd/systemd/issues/43676
2026-09-23 16:28:19 +02:00
Luca Boccassi d8cea1b942 sysinstall: optionally, pick target block device automatically (#43582) 2026-09-23 16:27:01 +02:00
Luca Boccassi 1c168322cf Improve error report when PCR changes (#43579)
When PCR is extended during a TPM2 operation, the internal counter of
the TPM2 will detect a new extension. systemd already retry this
operation several times, but sometimes the report will be an error, and
will refer to the wrong PCR.

This situation happends when IMA is enabled (when secure boot is active,
for example). PCR 10 will receive an extension for each new kernel
module that is loaded, logging in the journal errors that are recovered
later after a subsequent retry.
2026-09-23 09:28:35 +02:00
Luca Boccassi 06c2dfa73c bless-boot: skip gracefully on kexec
If KExecsCount > 0 then do not attempt to mark a UKI, as the stub (and also
any addon and the bootloader) will not have been exercised, so there's no
guaranteed a full reboot with the same image will actually work.

Fixes https://github.com/systemd/systemd/issues/43738
2026-09-22 21:25:20 +02:00
Luca Boccassi 9bf36a72b1 test-journal: Expand coverage of reader and storage edge cases (#43835)
Let's make sure that we have wider regression coverage:

1. Verify duplicate, empty, binary, and repeated fields are stored and
enumerated correctly
2. Exercise reader position invalidation after seeking and changing
matches
3. Check cursor, data, unique-field, and field-enumeration lifetime
semantics
4. Test journal opening and following across invalid files, file
descriptor ownership, renames, unlinks, polling, immutable files, forked
readers, etc, etc
2026-09-22 16:12:20 +02:00
Luca Boccassi 726cc309b4 NEWS: open new changelog 2026-09-22 15:12:10 +02:00
Luca Boccassi af6469a83c meson: switch version to 263~devel 2026-09-22 15:12:10 +02:00
Luca Boccassi 8cc40e0c5e Finalize meson.version for v262 2026-09-22 15:12:10 +02:00
Luca Boccassi b9979c1e1a NEWS: finalize 2026-09-22 15:12:10 +02:00
Luca Boccassi 2972f1f047 NEWS: update contributors list 2026-09-22 15:12:10 +02:00
Luca Boccassi 6859ecd916 hwdb: update rules 2026-09-22 15:12:10 +02:00
Luca Boccassi 5d414df040 NEWS: drop truncated sentence 2026-09-21 11:17:45 +02:00
Luca Boccassi f3880debd7 meson: bump version to v262~rc3 2026-09-15 12:25:09 +01:00
Luca Boccassi 745b63fbb0 NEWS: finalize time and place 2026-09-15 12:25:09 +01:00
Luca Boccassi 0bf0584123 NEWS: update contributors list 2026-09-15 12:25:09 +01:00
Luca Boccassi a491517a09 hwdb: update rules 2026-09-15 12:25:09 +01:00
Luca Boccassi 5c1561452f test: drop unused include from test-parse-util.c
Fix clang-tidy regression:

../src/test/test-parse-util.c:11:1: error: included header string-util.h is not used directly [misc-include-cleaner,-warnings-as-errors]
   11 | #include "string-util.h"
      | ^~~~~~~~~~~~~~~~~~~~~~~~
   12 | #include "tests.h"

Follow-up for efdc4b0cc7
2026-09-14 10:31:36 +01:00
Luca Boccassi 8615027695 docs: list AGENTS.md in LICENSES/README.md
It doesn't use the default project license anymore so it needs to be listed

Follow-up for 75344c7829
2026-09-09 10:53:31 +01:00
Luca Boccassi 3b2900f050 meson: bump version to v262~rc2 2026-09-08 20:47:54 +01:00
Luca Boccassi baf4eae065 NEWS: finalize date 2026-09-08 20:47:54 +01:00
Luca Boccassi 406ef29870 NEWS: update contributors 2026-09-08 20:47:54 +01:00
Luca Boccassi 4407ba3a55 hwdb: update autosuspend rules 2026-09-08 20:47:54 +01:00
Luca Boccassi 904ce6ab38 hwdb: update rules 2026-09-08 20:47:54 +01:00
Luca Boccassi 816d1e48cc include: update syscalls lists 2026-09-08 20:47:54 +01:00
Luca Boccassi 548f87538a measure: expose offline signing data in policy-digest output
The PolicyPCR digest is not always the complete input to an offline
signature. PolicyAuthorize also includes the hashed policy reference.
This is now required for NVPCRs to work in the initrd.

Expose the complete data as "tbs" (to-be-signed) and use it when ukify
matches offline signatures. Keep "pol" as the compatibility fallback.

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

Follow-up for f0f3687700
2026-09-07 16:15:42 +01:00
Luca Boccassi cfca4412ca dns-packet: keep unreferenceable names out of the compression map (#43666)
Split out of https://github.com/systemd/systemd/pull/42983

## Problem
`dns_packet_append_name()` fails with `-EEXIST` once a name that was
first appended at an offset beyond RFC 1035's 14-bit compression-pointer
range (0x4000) occurs again in the same packet: the fall-through that
re-emits the labels trips `hashmap_ensure_put()` on the existing map
entry, and the whole packet build fails — reported by the caller as, for
example, "Failed to build reply packet: File exists".

The map is meant to hold only offsets a pointer can actually reference.
Names past that range were being inserted anyway, so they were dead
weight that could never be pointed at, and re-encountering one turned
into an error.

## Fix
Keep names at offsets ≥ 0x4000 out of the compression map entirely.
"Mapped implies referenceable" becomes an invariant of the map rather
than something callers have to reason about, and the `-EEXIST` collision
cannot arise. A re-occurrence of such a name is emitted as labels, still
compressed from the first suffix that *is* mapped in range — which is
the only encoding RFC 1035 section 4.1.4 permits in that case, since a
pointer must address ≤ 0x3FFF.

## Impact
Any packet large enough to push a name past 16KiB hits this — it is not
mDNS-specific, though that is where it was found: a DNS-SD announcement
covering a few hundred published services crosses the threshold easily,
and every record after it fails to encode.

## Test
`test-dns-packet-append` gains coverage for the boundary: a name first
written past the pointer range and then repeated, the same for a full
resource record, the rollback path when an append fails mid-name, and
the map invariant itself (asserted over the whole map, so a future
change that inserts an unreferenceable offset is caught rather than
silently reintroducing the bug).

## Testing status
Builds clean with `-Dwerror=true`; `meson test --suite resolve` passes
(19 ok, 1 skipped) at both commits.
2026-09-07 11:00:12 +01:00
Luca Boccassi bc17a73107 core: don't exit 0 when a failure action has nothing to propagate (#43647)
Fixes #43645.

`FailureAction=exit` propagates the exit status of the unit's main
process. When there is none, `emergency_action()` left `m->return_value`
at its initial 0, so the manager exited 0 for a unit that failed —
indistinguishable from an orderly shutdown to whoever supervises it.
2026-09-05 11:54:29 +01:00
Luca Boccassi 8cceaab8f5 ukify: generate initrd policy digests for offline signing
When --sign-initrd-pcrs is used with --policy-digest, generate the
extra enter-initrd policy with the "initrd" policy reference. This
matches the policy produced when ukify signs with a private key.

Fixes building UKIs with offline signing (e.g.: on OBS) and using
NVPCRs.

Follow-up for f0f3687700
2026-09-03 12:55:15 +02:00
Luca Boccassi a019396d2c tools: fix building manpages with lxml 6.1.3
manpages build fails on Arch with new lxml:

Traceback (most recent call last):
  File "/work/src/tools/make-directive-index.py", line 169, in make_page
    _extract_directives(directive_groups, formatting, page)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/src/tools/make-directive-index.py", line 18, in _extract_directives
    t = xml_parse(page)
  File "/work/src/tools/xml_helper.py", line 25, in xml_parse
    doc = tree.parse(page, _parser)
  File "src/lxml/etree.pyx", line 3717, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 2045, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 2071, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1962, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1231, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line 647, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 765, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 689, in lxml.etree._raiseParseError
  File "../src/man/hostname.xml", line 5
lxml.etree.XMLSyntaxError: Entity 'entities' not defined, line 5, column 11

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/work/src/tools/make-directive-index.py", line 180, in <module>
    _xml = make_page(_template_path, _xml_files)
  File "/work/src/tools/make-directive-index.py", line 171, in make_page
    raise ValueError('failed to process ' + page) from e
ValueError: failed to process ../src/man/hostname.xml

Relying on XMLParser() defaults leaves the external parameter entity
used to load custom-entities.ent unresolved. Request entity resolution explicitly.

Follow-up for 1a13e31d27
2026-09-03 06:34:04 +09:00
Luca Boccassi a7ee2a5ea4 mkosi: update opensuse commit reference to 60fbc2d95581a933f9dcdfdb8d7e27d2a7d13e35
* 60fbc2d955 Update systemd to version 261.2 / rev 473 via SR 1368021
* c32d9727e6 Update systemd to version 261.1 / rev 472 via SR 1365923
* 74fd672013 Update systemd to version 260.3 / rev 471 via SR 1362701
* 769e1c4254 Update systemd to version 260.2 / rev 470 via SR 1361320
2026-09-03 05:48:24 +09:00
Luca Boccassi 25c0b10671 mkosi: update debian commit reference to 70dd6c36578ecaa214992f54701eeedaa3b57aed
* 70dd6c3657 Update changelog for 262~rc1-2 release
* 84ccf4ddbf Install 60-tpm2-id.rules on all architectures
* 20cd9d23cf Update changelog for 262~rc1-1 release
* e479c1d28e Update d/copyright
* fac1cd6d40 Update Lintian overrides for new units
* 448fa0e577 Update symbols file for upstream release
* dd467c4e44 Install new files for upstream build
* cbcc96360e d/systemd.links: stop creating cryptdisks{,-early}.service masks (LP: #2153836)
2026-09-02 12:13:42 +09:00
Luca Boccassi 0896c97321 meson: bump version to v262~rc1 2026-09-01 11:42:23 +02:00
Luca Boccassi fdc59b371c meson: bump library sonames for v262~rc1 2026-09-01 11:42:23 +02:00
Luca Boccassi 9be66f9759 NEWS: finalize time and place 2026-09-01 11:42:23 +02:00
Luca Boccassi a25729eeda NEWS: list contributors 2026-09-01 11:42:23 +02:00
Luca Boccassi 72f3a4a73c NEWS: update up to 9064524e44 2026-09-01 11:42:23 +02:00
Luca Boccassi 7021a61392 hwdb: update autosuspend rules 2026-09-01 11:42:23 +02:00
Luca Boccassi 862b093df2 hwdb: update rules 2026-09-01 11:42:23 +02:00
Luca Boccassi 1085a93b9d Various zsh completion fixes (#43584) 2026-08-31 16:58:24 +01:00
Luca Boccassi b27a47207c core: minor PAM fixes (#43576)
Fixes: #39617
2026-08-31 16:57:19 +01:00
Luca Boccassi 164eff47a7 Add missing -n shorthand for --dry-run in shell completion (#43581) 2026-08-31 15:17:39 +01:00
Luca Boccassi 85cdcad36b test: make boot mode work in unprivileged containers, take TEST_MKOSI_ARGS (#43531)
The final enablement pieces needed for coco tests in systemd CI. Runners
will be incus containers, these two commits enable running coco tests
with mkosi boot (where image is a directory), then start a confidential
guest with vmspawn as part of the test.
2026-08-27 13:44:47 +01:00
Luca Boccassi 2de150d7b7 Add experimental manpage marker, use it for sd-sysupdate and move it back to libexecdir (#43533) 2026-08-27 10:46:01 +01:00
Luca Boccassi 104ce53916 NEWS: note that sysupdate is experimental again 2026-08-26 19:51:31 +01:00
Luca Boccassi 11a9b02493 mkosi: hack SUSE spec to remove bin/sd-sysupdate 2026-08-26 19:51:31 +01:00
Luca Boccassi bc4d0fde7c mkosi: update debian commit reference to b12500baf3363288c692d47814c53b55f13e424e
* b12500baf3 Drop sd-sysupdate for upstream builds, experimental again
* 674dd1e684 d/t/localed-locale: skip in Debian, not supported
* 9bd985d014 d/t/localed-locale: clean up on any error with a trap
* 56153a917f d/t/control: add dependencies missing for incus image
2026-08-26 19:51:31 +01:00
Luca Boccassi 35530fcf94 sysupdate: move back to libexecdir to mark as experimental
Fixes https://github.com/systemd/systemd/issues/43498
2026-08-26 19:51:31 +01:00
Luca Boccassi 9df2b26334 man: mark systemd-sysupdate[d] as experimental 2026-08-26 19:51:31 +01:00
Luca Boccassi 1637c093d3 man: add 'experimental feature' XML snippet 2026-08-26 15:02:55 +01:00
Luca Boccassi 7a0129655a po: update translations 2026-08-26 10:59:02 +01:00
Luca Boccassi 0ba9f36af5 po: update template
ninja -C build systemd-pot
2026-08-26 10:59:01 +01:00
Luca Boccassi 25c6573345 hwdb: update autosuspend rules 2026-08-26 10:59:01 +01:00
Luca Boccassi 4c172b81cb hwdb: run update tool 2026-08-26 10:59:01 +01:00
Luca Boccassi e1f9606096 News followups for v262 (#43524) 2026-08-26 10:29:35 +01:00
Luca Boccassi 1aec3dfbef NEWS: update up to b6c432be08 2026-08-25 19:27:50 +01:00
Luca Boccassi ffb861ef22 man: add some notes regarding security features (#43434) 2026-08-24 15:12:03 +01:00
Luca Boccassi dfaa2d3ee1 man: note that blocking w+x memory is required for RestrictFileSystemAccess= 2026-08-24 13:22:56 +01:00
Luca Boccassi 8ae9973783 man: note that overriding TTY isolation with run0 is discouraged 2026-08-24 13:22:56 +01:00
Luca Boccassi 744b7801cb man: note that GPT is implicitly trusted by sd-mountfsd 2026-08-24 13:22:56 +01:00
Luca Boccassi e8e852fa76 man: note that mixing sd-nsresourced and /etc/subuid is unsupported 2026-08-24 13:22:56 +01:00
Luca Boccassi cd4379bb54 nsresourced: harden the transient UID/GID write restriction (#43196)
nsresourced hands out transient, recyclable UID/GID ranges to
unprivileged user namespaces, and a BPF-LSM policy is what keeps a
client from leaving inodes owned by its transient range on a file system
that outlives the namespace, so that a later client which gets the same
range can't inherit them.

The old policy decided based on the mount a write went through, which is
forgeable: unshare(CLONE_NEWNS) gives you clones of every mount with
fresh mount IDs but the same superblock, and the mount namespace's owner
is yours to pick. overlayfs sidesteps it entirely. So this reworks the
check to look at where the write actually lands on disk.

The first commit (Christian Brauner's) replaces the per-mount allowlist
with two questions answered from fields the client can't forge and that
survive mount cloning: does the file system die together with the user
namespace (sb->s_user_ns at or below the managed one), and does the
transient ID actually reach the disk, or does an idmapped mount
translate it into something else first. It walks the userns chain
upwards so a nested namespace can't escape it. The map layout changed,
so the pins move to userns-restrict.v2 and the old ones are removed on
install.

The second commit handles overlayfs. A write through an overlay creates
the file on the upper layer via vfs_create(), which only trips the inode
LSM hooks, not the path hooks we attach to, and the one path hook that
does fire sees the overlay mount, which belongs to the managed namespace
and so looks like it dies with it even though the upper may be
persistent. So we judge the upper at mount time in sb_kern_mount and
refuse a writable overlay unless its upper dies with the namespace too.
Reading overlayfs' private ovl_fs/ovl_layer uses CO-RE type flavors
guarded by bpf_core_type_exists(), and the service now orders after
modprobe@overlay.service.

The third commit deals with restarts. The managed set only lives in the
pinned maps, so an upgrade that changes the map layout comes up with
empty maps and every already-running namespace silently loses its
restriction. manager_startup() now re-adds the live registry entries to
the maps in the same pass that reaps the dead ones. The setgroups()
denial is restored from a flag we now store in the registry.

One consequence: a managed namespace can only mount a writable overlay
whose upper dies with it, e.g. a tmpfs it set up itself. If you need a
writable persistent upperdir (mkosi does), use a plain unprivileged user
namespace for that, not a transient nsresourced range.
2026-08-21 22:05:25 +01:00
Luca Boccassi b98d348c37 resolved: drop dead assignment
The 'changed' variable is either unused on error or unconditionally
overwritten on success, so coverity warns about it. Drop the unused
assignment.

CID#1685266

Follow-up for a572dd2f60
2026-08-16 22:53:23 +09:00
Luca Boccassi 4f80cc06a1 test: add TEST-94-COCO integration test for confidential VMs (#43296) 2026-08-13 13:19:15 +01:00
Luca Boccassi aec25f2770 Two HWDB fixes (#43367) 2026-08-12 15:12:58 +01:00
Luca Boccassi 8271442983 test: drop forgotten set +e (#43359)
This was introduced all the way back in 2019 where this particular test
case was the last one in the file, so it worked as intended.
Unfortunately, since then we added new tests after this one, which means
this particular `set +e` masked fails in any of them (except for
assert_*() calls, which call exit on fail).
2026-08-11 17:40:25 +01:00
Luca Boccassi fd60772767 Update hwdb
ninja -C build update-hwdb
2026-08-10 10:30:11 +01:00
Luca Boccassi df9f84c80f tools: set user agent string when fetching acpi/pnp data
uefi.org now refuses connections if a user agent is not set, failing
the "update-hwdb" command. Set one so that it works again.
2026-08-10 10:30:10 +01:00
Luca Boccassi bf031984ff bootctl: also print .uname if present
A UKI might have a version from .osrelease which is not tied to the
kernel version. Pretty print the .uname section too, if present.

         type: Boot Loader Specification Type #2 (UKI, .efi)
        title: Debian GNU/Linux 13 (trixie) (34.186) (selected)
           id: debian-trixie_34.186_x86-64.efi
       source: /boot/efi//EFI/Linux/debian-trixie_34.186_x86-64.efi (on the EFI System Partition)
     sort-key: debian-trixie
      version: 34.186
        uname: 6.12.100+deb13-amd64
        linux: /boot/efi//EFI/Linux/debian-trixie_34.186_x86-64.efi
      profile: 0
2026-08-07 14:19:42 +09:00
Luca Boccassi 4e3fff9061 Revert "macro: EDG compiler frontends doesn't support enum types"
The EDG parser version 6.8 now supports C23 enums with fixed underlying
types, and VSCode ships with it, so this workaround can now be removed
without breaking VSCode's internal parser.

https://en.cppreference.com/c/compiler_support/23

This reverts commit e01ca3afdb.
2026-08-04 22:46:13 +09:00
Luca Boccassi fb3581af65 test: find out tpm device rather than hardcoding it in TEST-92-TPM2-SWTPM
Looks like the device might change depending on the boot sequence, so
discover it in the test rather than hardcoding it to /dev/tpmrm0.

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

Follow-up for 1b1900a6f3
2026-07-31 11:06:30 +09:00
Luca Boccassi cdc3fd019b test: retry units failed during package replacement in TEST-88-UPGRADE
Retry units that still exist and clear stale state for units removed by
a downgrade, as packages might be old and not have new units that were
added in the latest version.
2026-07-30 09:13:35 +01:00
Luca Boccassi f029c336e9 mkosi: stage volatile deb packages for upgrade test
Prepare scripts run before volatile packages are installed, so parse
the list from the config to ensure they are all included to avoid
failures due to some packages missing from the list.

Follow-up for 28e1f84d6a
2026-07-30 09:13:35 +01:00
Luca Boccassi bbc5511d6a test: add deb coverage and a few more sanity checks to TEST-88-UPGRADE (#43162) 2026-07-26 17:41:16 +01:00
Luca Boccassi 5578a22696 ci/mkosi: bump fedora release version to 44 (#43160) 2026-07-26 15:07:21 +01:00
Luca Boccassi a5819bd3f5 test: udev might not be running in container, skip check in TEST-88-UPGRADE 2026-07-26 13:45:28 +01:00
Luca Boccassi 14b93b6409 test: add a few more quick sanity checks to TEST-88-UPGRADE 2026-07-26 13:45:28 +01:00
Luca Boccassi 28e1f84d6a test: add deb coverage to TEST-88-UPGRADE 2026-07-26 13:45:28 +01:00
Luca Boccassi 765dc96746 homed: verify privileged worker changes
Workers may return a newer embedded identity while processing
an owner update. Accept self-modifiable changes, but require
privileged changes to carry a trusted signature.

Follow-up for 70a5db5822
2026-07-22 17:11:08 +02:00
Luca Boccassi b9ef5951f8 rm-rf: downgrade root check log when directory doesn't exist
When a unit is stopped we try to destroy the credential mount point,
which might not exist. This logs at error level, which is noisy and
pointless. Downgrade to debug level on ENOENT.

systemd[1]: Failed to determine whether '/run/credentials/run-p119516-i119816.service' is the root file system: No such file or directory

Follow-up for 9dd2dab37e
2026-07-22 15:09:36 +02:00
Luca Boccassi cab511f5f5 Fix typos reported by Fossies (#43084) 2026-07-20 12:38:47 +01:00
Luca Boccassi e304d559e8 udev: drop home-grown udev-ctrl socket (#40802)
Nowadays, varlink is used to control systemd-udevd. Let's drop the
legacy socket.

Note, the existence of /run/udev/control socket is widely used in both
our code and external projects. Also, the dependency to
systemd-udevd-control.socket is widely used in many projects. Hence, we
need to create a symlink to the socket file and .socket unit file.
2026-07-20 12:37:27 +01:00
Luca Boccassi 368eb65155 mkosi: update debian commit reference to 56402b2bde258999a8f01a8b04465fde9242d6a1
* 56402b2bde Drop symlink to systemd-udevd-control.socket
* 3afaaf4f89 Install new files for upstream build
2026-07-20 10:58:51 +01:00
Luca Boccassi e056e2a707 sd-dlopen: make header self-standing again
The purpose of this header was to provide MIT-0 sources that can be copied
and pasted liberally. Including an LGPL-2.1+ header from it deafeats its
purpose. Make it self-standing again.

Follow-up for aa0db003cf
2026-07-18 01:55:07 +09:00
Luca Boccassi 6308a7c2e7 nspawn: use chase() for creating dev nodes (#43037) 2026-07-17 09:02:28 +01:00
Luca Boccassi 15d0b477f0 nspawn: use chase() for creating dev nodes
Follow-up for de40a3037a
2026-07-16 22:46:31 +01:00
Luca Boccassi 002d467ce4 shift-uid: use TAKE_FD on input fd
Follow-up for c3eafb10a0
2026-07-16 19:21:48 +01:00
Luca Boccassi 305393135b rm-rf: use faccessat instead of fstatat
Follow-up for 9dd2dab37e
2026-07-16 19:20:57 +01:00
Luca Boccassi 2ef10ee3f1 nspawn: log at error level before exiting if parsing OCI fails
Currently it silently errors out, with nothing at all printed on the
console

Follow-up for de40a3037a
2026-07-16 17:41:27 +01:00
Luca Boccassi 0755bb125c homed: fix verification of local identity file
Follow-up for 70a5db5822
2026-07-16 14:24:18 +02:00
Luca Boccassi cec14f99d2 sysupdate: add config file with metadata for sysupdate components (#42651)
This carries some metadata for components. It's supposed to grow a bit,
and include a way to enable/disable transfers, and to condition them.
2026-07-16 12:48:10 +01:00
Luca Boccassi 9d4cb85cf5 sysext: validate work directory metadata before removal
unmerge_hierarchy() joined the persisted work_dir value directly with
--root=. An empty value therefore resolved to the root itself and was passed
to rm_rf().

Require the decoded metadata to name a non-empty, safe, normalized relative
path before constructing the removal target. Add coverage using a disposable
root with deliberately emptied metadata.

Follow-up for 9cfad502f4
2026-07-15 21:13:24 +01:00
Luca Boccassi c3eafb10a0 shift-uid: close consumed directory fds on early return
recurse_fd() consumes each directory fd passed to it, but it has no
cleanup set up until after take_fdopendir() succeeds.
Errors and skipped procfs, sysfs, or read-only subtrees therefore leak the
incoming fd.

Follow-up for b1fb2d971c
2026-07-15 21:13:24 +01:00
Luca Boccassi 9dd2dab37e rm-rf: fail closed when the root check fails
path_is_root_at() returns a negative errno when it cannot determine whether
a target is the root file system. rm_rf_at() treats those errors as a
negative answer and continued with destructive operations.

Propagate root-check errors before modifying the target, while preserving
REMOVE_MISSING_OK for an absent path.

Follow-up for c0228b4fa3
2026-07-15 21:13:24 +01:00
Luca Boccassi 57db794b9d vconsole: reject empty layout during keymap conversion with error
A leading-dash console keymap or leading-comma X11 layout can produce an
empty layout while converting between the two formats. find_converted_keymap()
then asserts on it, allowing malformed input to abort callers such as localed.

Return EINVAL for an empty derived layout instead.

Follow-up for 6d0f502736
2026-07-15 21:13:24 +01:00
Luca Boccassi fea9a64432 resolved: preserve unchanged question on asymmetric redirect
dns_question_cname_redirect() returns no replacement when a question
already matches a CNAME target or a DNAME does not apply. If only one of
the UTF-8 and IDNA questions redirects, dns_query_cname_redirect() then
installs NULL for the unchanged side.

Keep a reference to the original question on whichever side does not
redirect, and update the existing asymmetric DNAME test to verify it.

Follow-up for 23b298bce7
2026-07-15 21:13:24 +01:00
Luca Boccassi 14830891f3 journal-remote: zero-initialize MHD daemon wrapper
MHDDaemonWrapper_free() unconditionally unrefs both event sources, but
setup_microhttpd_server() could return before initializing either pointer.
Zero-initialize the wrapper so cleanup after MHD startup failures safely
unrefs NULL.

Follow-up for 3c67c8bd4c
2026-07-15 21:13:24 +01:00
Luca Boccassi 16c6758eb4 journal-remote: remove disabled compression entry before freeing
compression_config_put() frees the COMPRESSION_NONE value when a later
algorithm is selected, but lefts the map entry pointing at it. Remove the
entry first so subsequent parsing, mangling, and teardown cannot access or
free stale memory.

Follow-up for c259c9e253
2026-07-15 21:11:09 +01:00
Luca Boccassi 890dd23c83 network: cancel netlink calls for detached requests
Store the asynchronous netlink slot in the Request object and release it
when the request is detached. This cancels the pending callback instead of
keeping the request alive until its reply arrives.

Follow-up for 80d62d4f1a
2026-07-15 19:21:18 +01:00
Luca Boccassi f65d4e6c4e network: compare all multipath route nexthops
The multipath route comparator looks up every nexthop in the first
route and hence compares each entry with itself. Compare both ordered
nexthop sets instead, including weights, as the hash function does.

Follow-up for 47420573a7
2026-07-15 19:11:08 +01:00