]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 days agoadded root.conf to meson.build 41431/head
ipv6 [Thu, 9 Apr 2026 19:04:16 +0000 (14:04 -0500)] 
added root.conf to meson.build

11 days agoAdded NEWS
ipv6 [Wed, 8 Apr 2026 15:43:49 +0000 (10:43 -0500)] 
Added NEWS

11 days agoAdded tmpfiles.d/root.conf to set access permissions to root / dir
ipv6 [Wed, 8 Apr 2026 15:28:59 +0000 (10:28 -0500)] 
Added tmpfiles.d/root.conf to set access permissions to root / dir

2 weeks agoOnly enable `NoAuto=true` for supported partitions
Michael Ferrari [Fri, 27 Mar 2026 23:32:03 +0000 (00:32 +0100)] 
Only enable `NoAuto=true` for supported partitions

When `Format=empty` is set we need to check for `NoAuto` support for
the partition type, else we print a warning later in the build.

Followup for 381304a

2 weeks agocryptenroll: harden some variables with erasure on cleanup
Luca Boccassi [Fri, 27 Mar 2026 23:45:20 +0000 (23:45 +0000)] 
cryptenroll: harden some variables with erasure on cleanup

This doesn't really matter as it runs in user contexts, but
follow good practice and mark all variables containing secrets
for erasure on cleanup

Reported on yeswehack.com as YWH-PGM9780-170

2 weeks agoMore assorted coverity fixes (#41413)
Daan De Meyer [Mon, 30 Mar 2026 21:34:44 +0000 (23:34 +0200)] 
More assorted coverity fixes (#41413)

2 weeks agosysupdate: Ignore resources that are not pending
Valentin David [Mon, 30 Mar 2026 07:49:13 +0000 (09:49 +0200)] 
sysupdate: Ignore resources that are not pending

`updatectl enable --now` systematically fails because the update phase find
resources that are not pending. So instead we should ignore them.

Fixes #41254

2 weeks agodiscover-image: Ignore sysupdate temporary files
Valentin David [Mon, 30 Mar 2026 07:54:38 +0000 (09:54 +0200)] 
discover-image: Ignore sysupdate temporary files

Sysupdate temporary file names do not match their extension-release names. So
they will always fail. That makes enabling any other sysexts/confexts fail
which has catastrophic consequences. Unfortunately since 260, sysupdate
leaves temporary files for long time instead just while downloading. So
this kind of failure now happens much more often.

2 weeks agosysupdated: Accept "current+pending" key
Valentin David [Mon, 30 Mar 2026 08:07:04 +0000 (10:07 +0200)] 
sysupdated: Accept "current+pending" key

Since 594d0345fa997446b4c2dcfbccf3f83257bb55a3 the key for
current version might be "current+pending". So in order not to fail
we need to accept it.

Fixes #41409

2 weeks agomany: another set of checks for pointer access without NULL check (#41400)
Zbigniew Jędrzejewski-Szmek [Mon, 30 Mar 2026 17:52:08 +0000 (19:52 +0200)] 
many: another set of checks for pointer access without NULL check (#41400)

Followup for https://github.com/systemd/systemd/pull/41370

Next set of pointer-deref coccinelle tweaks for:
''src/core/'
 'src/journal/'
 'src/network/'
''src/nspawn/'

3 weeks agocore: make check-pointer-deref clean 41400/head
Michael Vogt [Sat, 28 Mar 2026 11:35:54 +0000 (12:35 +0100)] 
core: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

3 weeks agojournald: add assert for allocated buffer size 41413/head
Luca Boccassi [Sat, 28 Mar 2026 22:46:35 +0000 (22:46 +0000)] 
journald: add assert for allocated buffer size

Coverity flags allocated - 1 as a potential underflow when
allocated is 0. After GREEDY_REALLOC succeeds the buffer is
guaranteed non-empty, but Coverity cannot trace through the
conditional. Add an assert to document this.

CID#1548053

Follow-up for ec20fe5ffb8a00469bab209fff6c069bb93c6db2

3 weeks agotest-json: avoid divide-by-zero coverity warning for index 9
Luca Boccassi [Sat, 28 Mar 2026 22:32:06 +0000 (22:32 +0000)] 
test-json: avoid divide-by-zero coverity warning for index 9

Same fix as d0a066a1a4a391f629f7f52b5005103f8daf411f did for
index 10: add iszero_safe() check before dividing by the
json variant real value.

CID#1587762

Follow-up for d0a066a1a4a391f629f7f52b5005103f8daf411f

3 weeks agonetwork: make check-pointer-deref clean
Michael Vogt [Sat, 28 Mar 2026 11:02:32 +0000 (12:02 +0100)] 
network: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

3 weeks agojournal: make check-pointer-deref clean
Michael Vogt [Sat, 28 Mar 2026 09:48:27 +0000 (10:48 +0100)] 
journal: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

3 weeks agonspawn: make check-pointer-deref clean
Michael Vogt [Sat, 28 Mar 2026 09:24:18 +0000 (10:24 +0100)] 
nspawn: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

3 weeks agocleanup: address review feedback from claude
Michael Vogt [Sat, 28 Mar 2026 08:46:33 +0000 (09:46 +0100)] 
cleanup: address review feedback from claude

Trivial ordering/modernizing change that got highlighted by
claude and refined by keszybz to move to the modern systemd
style.

Thanks to keszybz for suggesting this.

3 weeks agomkosi: add coccinelle to the debian tools tree too
Michael Vogt [Sat, 28 Mar 2026 08:36:32 +0000 (09:36 +0100)] 
mkosi: add coccinelle to the debian tools tree too

It is already part of the fedora/opensues tools tree. It must
have slipped through for Debian so lets add it.

3 weeks agonspawn-oci: add asserts for UID/GID validity after dispatch
Luca Boccassi [Sat, 28 Mar 2026 22:15:56 +0000 (22:15 +0000)] 
nspawn-oci: add asserts for UID/GID validity after dispatch

Coverity flags UINT32_MAX - data.container_id as an underflow
when container_id could be UID_INVALID (UINT32_MAX). After
successful sd_json_dispatch_uid_gid(), the values are guaranteed
valid, but Coverity cannot trace through the callback. Add
asserts to document this invariant.

CID#1548072

Follow-up for 91c4d1affdba02a323dc2c7caccabe240ccb8302

3 weeks agoboot: clamp setup header copy size to sizeof(SetupHeader)
Luca Boccassi [Sat, 28 Mar 2026 22:06:51 +0000 (22:06 +0000)] 
boot: clamp setup header copy size to sizeof(SetupHeader)

The setup_size field from the kernel image header is used as part
of the memcpy size. Clamp it to sizeof(SetupHeader) to ensure the
copy does not read beyond the struct bounds even if the kernel
image header contains an unexpected value.

CID#1549197

Follow-up for d62c1777568ff69034fd5b5d582a2889229f7e20

3 weeks agocreds-util: add assert for output buffer size overflow safety
Luca Boccassi [Sat, 28 Mar 2026 22:00:25 +0000 (22:00 +0000)] 
creds-util: add assert for output buffer size overflow safety

Coverity flags the multi-term output.iov_len accumulation as a
potential overflow. Add an assert after the calculation to verify
the result is at least as large as the input, catching wraparound.

CID#1548068

Follow-up for 21bc0b6fa1de44b520353b935bf14160f9f70591

3 weeks agocalendarspec: use ADD_SAFE for repeat offset calculation
Luca Boccassi [Sat, 28 Mar 2026 21:56:41 +0000 (21:56 +0000)] 
calendarspec: use ADD_SAFE for repeat offset calculation

Use overflow-safe ADD_SAFE() instead of raw addition when
computing the next matching calendar component with repeat.
On overflow, skip the component instead of using a bogus value.

CID#1548052

Follow-up for a2eb5ea79c53620cfcf616e83bfac0c431247f86

3 weeks agorepart: use INC_SAFE for partition min size accumulation
Luca Boccassi [Sat, 28 Mar 2026 21:52:57 +0000 (21:52 +0000)] 
repart: use INC_SAFE for partition min size accumulation

Use overflow-safe INC_SAFE() instead of raw addition when
accumulating partition minimum size components.

CID#1548041

Follow-up for 170c98234530af6af487d37057b6e687569f8f91

3 weeks agotest-strv: avoid unsigned wraparound in backwards iteration
Luca Boccassi [Sat, 28 Mar 2026 21:47:08 +0000 (21:47 +0000)] 
test-strv: avoid unsigned wraparound in backwards iteration

Use pre-decrement starting from 3 instead of post-decrement
starting from 2, so that the unsigned counter does not wrap
past zero on the final iteration.

CID#1548035

Follow-up for 02f19706a9fd96e05c9ed16aa55ba3d03d008167

3 weeks agosd-bus: add assert_cc for message allocation size
Luca Boccassi [Sat, 28 Mar 2026 21:41:02 +0000 (21:41 +0000)] 
sd-bus: add assert_cc for message allocation size

Use CONST_ALIGN_TO to express the compile-time overflow check for
the ALIGN(sizeof(sd_bus_message)) + sizeof(BusMessageHeader)
allocation, since ALIGN() is not constexpr.

CID#1548031

Follow-up for de1c301ed165eb4d04a0c9d4babe97912b5233bb

3 weeks agosd-bus: use usec_add() for auth timeout calculation
Luca Boccassi [Sat, 28 Mar 2026 21:37:47 +0000 (21:37 +0000)] 
sd-bus: use usec_add() for auth timeout calculation

Use the overflow-safe usec_add() instead of raw addition for
computing the authentication timeout.

CID#1548036

Follow-up for e3017af97310da024ffb378ed155bc1676922ce7

3 weeks agonss-myhostname: add asserts for buffer index accumulation
Luca Boccassi [Sat, 28 Mar 2026 21:29:58 +0000 (21:29 +0000)] 
nss-myhostname: add asserts for buffer index accumulation

Coverity flags idx += 2*sizeof(char*) and idx += sizeof(char*)
as potential overflows. The idx is bounded by the ms buffer size
calculation, add asserts to document this.

CID#1548028

Follow-up for e8a7a315391a6a07897122725cd707f4e9ce63d7

3 weeks agotree-wide: add assert_cc for time constant multiplications
Luca Boccassi [Sat, 28 Mar 2026 21:28:56 +0000 (21:28 +0000)] 
tree-wide: add assert_cc for time constant multiplications

Coverity flags compile-time constant multiplications of
USEC_PER_SEC, USEC_PER_MSEC, and USEC_PER_HOUR as potential
overflows. Add assert_cc() to prove they fit at build time.

CID#1548025
CID#1548048
CID#1548055
CID#1548059

Follow-up for 500727c220354b81b68ed6667d9a6f0fafe3ba19
Follow-up for 27d340c772fb1b251085dba7bd5420484f7c5892
Follow-up for e537352b9bfffe6f6286483bff2c7601c78407e3
Follow-up for 1007ec60e664da03b7aea4803c643d991fcf6530

3 weeks agorepart: add assert for offset + current_size overflow safety
Luca Boccassi [Sat, 28 Mar 2026 21:20:39 +0000 (21:20 +0000)] 
repart: add assert for offset + current_size overflow safety

Coverity flags a->after->offset + a->after->current_size as a
potential overflow. Both values are validated as not UINT64_MAX
by existing asserts, add an explicit overflow check to document
the invariant for static analyzers.

CID#1548063

Follow-up for e594a3b154bd06c535a934a1cc7231b1ef76df73

3 weeks agonetworkd-ndisc: add assert for DNSSL allocation overflow safety
Luca Boccassi [Sat, 28 Mar 2026 21:19:14 +0000 (21:19 +0000)] 
networkd-ndisc: add assert for DNSSL allocation overflow safety

Coverity flags ALIGN(sizeof(NDiscDNSSL)) + strlen(*j) + 1 as a
potential overflow. Domain names are protocol-bounded but add an
assert to make this explicit for static analyzers.

CID#1548066

Follow-up for 1e7a0e21c97ac1bbc743009e5ec8c12bc6200e19

3 weeks agodns-packet: add asserts for allocation overflow safety
Luca Boccassi [Sat, 28 Mar 2026 21:14:35 +0000 (21:14 +0000)] 
dns-packet: add asserts for allocation overflow safety

Coverity flags ALIGN(sizeof(DnsPacket)) + size calculations in
dns_packet_new() and dns_packet_dup() as potential overflows. The
sizes are bounded by DNS_PACKET_SIZE_MAX but add asserts to make
this explicit for static analyzers.

CID#1548058
CID#1548076

Follow-up for c73ce96b569e2f10dff64b7dc0bd271972674c2a

3 weeks agolimits-util: add assert for physical memory calculation overflow
Luca Boccassi [Sat, 28 Mar 2026 21:14:07 +0000 (21:14 +0000)] 
limits-util: add assert for physical memory calculation overflow

Coverity flags (uint64_t) sc * (uint64_t) ps as a potential
overflow. Add an assert to make the bounds explicit for static
analyzers.

CID#1548042

Follow-up for eefc66aa8f77c96a13a78d6c40c79ed7f3d6dc9d

3 weeks agouser-util: add asserts for buffer allocation overflow safety
Luca Boccassi [Sat, 28 Mar 2026 21:12:31 +0000 (21:12 +0000)] 
user-util: add asserts for buffer allocation overflow safety

Coverity flags ALIGN(sizeof(struct passwd/group)) + bufsize as
potential overflows in the getpw/getgr helpers. Add asserts to
make the bounds explicit for static analyzers.

CID#1548047
CID#1548049
CID#1548069
CID#1548070

Follow-up for 75673cd8aee5c6174538e71dd36c7a353c836973

3 weeks agosd-bus: add asserts for message size overflow safety
Luca Boccassi [Sat, 28 Mar 2026 21:11:48 +0000 (21:11 +0000)] 
sd-bus: add asserts for message size overflow safety

Coverity flags arithmetic in BUS_MESSAGE_SIZE(),
BUS_MESSAGE_BODY_BEGIN() and message_from_header() as potential
overflows. The values are validated at message creation time, but
add asserts to make the invariants explicit for static analyzers.

CID#1548023
CID#1548030
CID#1548046

Follow-up for 6629161f827c82889cf45cfcdce62dcb543eda23

3 weeks agosd-daemon: add assert before CMSG_SPACE subtraction
Luca Boccassi [Sat, 28 Mar 2026 21:03:14 +0000 (21:03 +0000)] 
sd-daemon: add assert before CMSG_SPACE subtraction

Coverity flags the subtraction from msg_controllen as a potential
underflow. The CMSG_SPACE was added when send_ucred was set, and
the subtraction only runs when send_ucred was true, so it is safe.
Add an assert to document this invariant.

CID#1548074

Follow-up for 64144440a5d2d94482f882b992fd2a4e0dca7a05

3 weeks agosd-json: silence false positive in sd_json_variant_filter
Luca Boccassi [Sat, 28 Mar 2026 21:01:34 +0000 (21:01 +0000)] 
sd-json: silence false positive in sd_json_variant_filter

Same pattern as the fix for sd_json_variant_unset_field in
9b3715d529e4eba79e19c87e85583f7be5ee2c95: cache the element
count in a local variable and assert it is at least 2 before
subtracting.

CID#1548029

Follow-up for f2ff34ff2aaafd313a5c62b4b9f13ba6777731e5

3 weeks agojournal: add assert for max_size overflow safety
Luca Boccassi [Sat, 28 Mar 2026 20:59:35 +0000 (20:59 +0000)] 
journal: add assert for max_size overflow safety

Coverity flags max_size*2 as a potential overflow. The value is
bounded by MAX_SIZE_UPPER (128 MiB) or JOURNAL_COMPACT_SIZE_MAX
(4 GiB), so doubling is safe within uint64_t. Add an assert to
document this.

CID#1548019

Follow-up for 8580d1f73db36e9383e674e388b4fb55828c0c66

3 weeks agoman: fix caps in example path
Adam Dinwoodie [Wed, 11 Mar 2026 23:04:44 +0000 (23:04 +0000)] 
man: fix caps in example path

3 weeks agorepart: allow --el-torito= with any --empty= value
Daan De Meyer [Sun, 29 Mar 2026 21:11:52 +0000 (21:11 +0000)] 
repart: allow --el-torito= with any --empty= value

The restriction requiring --empty= to be require, force, or create
when using --el-torito= is unnecessary.
context_verify_eltorito_overlap() already validates that the ISO 9660
blocks don't collide with GPT partition entries or the first usable
LBA, which is sufficient to guarantee safety regardless of the empty
mode.

This is needed for two-stage image builds where the first stage creates
the usr and verity partitions, and the second stage adds --el-torito=
to produce a bootable ISO with a UKI containing usrhash= derived from
the verity hash of the first stage. In the second stage, repart runs
with --empty=allow since the image already exists.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
3 weeks agorepart: Optionally write minimal an El Torito boot catalog for EFI
Valentin David [Sat, 21 Mar 2026 14:42:13 +0000 (15:42 +0100)] 
repart: Optionally write minimal an El Torito boot catalog for EFI

This only points the firmware to the ESP. The ISO9660 is empty.
The initramfs should create a loop device to change block size
and enable GPT partitions.

This was tested using OVMF on qemu, with:
`-drive if=pflash,file=OVMF_CODE.fd,readonly=on,format=raw -drive if=pflash,file=OVMF_VARS.fd,format=raw -drive if=none,id=live-disk,file=dick.iso,media=cdrom,format=raw,readonly=on -device virtio-scsi-pci,id=scsi -device scsi-cd,drive=live-disk`

And a simple definition:
```
[Partition]
Type=esp
Format=vfat
CopyFiles=/usr/lib/systemd/boot/efi/systemd-bootx64.efi:/EFI/BOOT/BOOTX64.EFI
```

3 weeks agoAssorted coverity fixes (#41406)
Daan De Meyer [Sun, 29 Mar 2026 19:02:55 +0000 (21:02 +0200)] 
Assorted coverity fixes (#41406)

3 weeks agosd-varlink: export sd_varlink_set_sentinel
Zbigniew Jędrzejewski-Szmek [Sat, 28 Mar 2026 15:54:21 +0000 (16:54 +0100)] 
sd-varlink: export sd_varlink_set_sentinel

I tried to implement a varlink service using sd-varlink, and
not being able to use the approach with sentinel is exteremely
painful. This is useful internally and likewise externally.

3 weeks ago`systemd-repart` man page fixes (#41410)
Luca Boccassi [Sun, 29 Mar 2026 12:58:04 +0000 (13:58 +0100)] 
`systemd-repart` man page fixes (#41410)

Found two small issues in the man page.

3 weeks agoman/systemd-repart: quote jq expression 41410/head
Morten Linderud [Sun, 29 Mar 2026 12:20:28 +0000 (14:20 +0200)] 
man/systemd-repart: quote jq expression

Some shells will try to parse this, or expand it, causing an error. Lets
quote it so it's simpler for people.

Signed-off-by: Morten Linderud <morten@linderud.pw>
3 weeks agoman/systemd-repart: remove extra pipe character in manpage
Morten Linderud [Sun, 29 Mar 2026 12:15:05 +0000 (14:15 +0200)] 
man/systemd-repart: remove extra pipe character in manpage

Signed-off-by: Morten Linderud <morten@linderud.pw>
3 weeks agorepart: Make it possible to set persistent allow-discards activation flag
Valentin David [Mon, 16 Mar 2026 21:21:55 +0000 (22:21 +0100)] 
repart: Make it possible to set persistent allow-discards activation flag

AllowDiscards= will set allow-discards in the persistent flags which will make
activating the device automatically activate with that option. This is
useful for devices discovered through gpt-auto-generator without
needing to use some kernel command line to set the option.

3 weeks agofix list of inhibitor lock types
Adrian Wannenmacher [Sat, 28 Mar 2026 19:55:19 +0000 (20:55 +0100)] 
fix list of inhibitor lock types

Markdown and HTML don't support mixing ordered and unordered items
within a single list. This means the previous syntax actually produced
three separate lists.

Also, markdown converters don't necesarrily respect the first number in
an ordered list, and may just overwrite it to one. This is the case for
the one that generates the systemd.io page. And even if that wasn't the
case, the numbering of the second ordered list would be off by one.

3 weeks agorecurse-dir: add assert_cc for DIRENT_SIZE_MAX allocation 41406/head
Luca Boccassi [Sat, 28 Mar 2026 20:24:22 +0000 (20:24 +0000)] 
recurse-dir: add assert_cc for DIRENT_SIZE_MAX allocation

Coverity flags offsetof(DirectoryEntries, buffer) + DIRENT_SIZE_MAX * 8
as a potential overflow. All operands are compile-time constants, so add
an assert_cc() to prove this at build time.

CID#1548020

Follow-up for 6393b847f459dba14d2b615ee93babb143168b57

3 weeks agoexec-util: use unsigned shift for ExecCommandFlags
Luca Boccassi [Sat, 28 Mar 2026 20:13:40 +0000 (20:13 +0000)] 
exec-util: use unsigned shift for ExecCommandFlags

Using signed int literal '1' in left shift operations can
theoretically lead to undefined behavior. Use 1U to be explicit
about unsigned arithmetic.

CID#1548018

Follow-up for b3d593673c5b8b0b7d781fd26ab2062ca6e7dbdb

3 weeks agocompress: add assert for space doubling overflow safety
Luca Boccassi [Sat, 28 Mar 2026 20:13:03 +0000 (20:13 +0000)] 
compress: add assert for space doubling overflow safety

Coverity flags 2 * space as a potential overflow. The space value
is bounded by prior allocation success, but add an explicit assert
to document this for static analyzers.

CID#1548056

Follow-up for 5e592c66bdf76dfc8445b332f7a5088ca504ee90

3 weeks agoimportd: add assert for log_message_size accumulation bounds
Luca Boccassi [Sat, 28 Mar 2026 20:10:14 +0000 (20:10 +0000)] 
importd: add assert for log_message_size accumulation bounds

Coverity flags log_message_size += l as a potential overflow, but l
is bounded by the read() count parameter which is
sizeof(log_message) - log_message_size. Add an assert to make this
invariant explicit.

CID#1548062

Follow-up for 3d7415f43f0fe6a821d7bc4a341ba371e8a30ef3

3 weeks agosd-bus: add asserts for rbuffer_size accumulation bounds
Luca Boccassi [Sat, 28 Mar 2026 20:08:55 +0000 (20:08 +0000)] 
sd-bus: add asserts for rbuffer_size accumulation bounds

Coverity flags rbuffer_size += k as a potential overflow, but k is
always bounded by the iov size (which is the difference between the
allocated buffer and current rbuffer_size). Add asserts to make this
invariant explicit.

CID#1548044
CID#1548071

Follow-up for a7e3212d89d5aefee67de79c1e7eaccf2f5645ac

3 weeks agouid-range: add asserts to document overflow safety in coalesce
Luca Boccassi [Sat, 28 Mar 2026 19:55:35 +0000 (19:55 +0000)] 
uid-range: add asserts to document overflow safety in coalesce

Coverity flags the x->start + x->nr and y->start + y->nr additions
as potential overflows. These are safe because uid_range_add_internal()
validates start + nr <= UINT32_MAX before inserting entries. Add asserts
to document this invariant for static analyzers.

CID#1548015

Follow-up for 8530dc4467691a893aa2e07319b18a84fec96cad

3 weeks agosd-event: add assert to help static analysis trace signal bounds
Luca Boccassi [Sat, 28 Mar 2026 19:52:09 +0000 (19:52 +0000)] 
sd-event: add assert to help static analysis trace signal bounds

Coverity flags the signal_sources array access as a potential
out-of-bounds read because it cannot trace through the SIGNAL_VALID()
macro to know that ssi_signo < _NSIG. Add an explicit assert after
the runtime check to make the constraint visible to static analyzers.

CID#1548033

Follow-up for 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9

3 weeks agocpu-set-util: add asserts to guide static analysis after realloc
Luca Boccassi [Sat, 28 Mar 2026 19:49:20 +0000 (19:49 +0000)] 
cpu-set-util: add asserts to guide static analysis after realloc

Coverity flags CPU_SET_S() calls as potential out-of-bounds writes
because it cannot trace that cpu_set_realloc() guarantees the
allocated buffer is large enough for the given index. Add asserts
to make the size invariant explicit.

CID#1611787
CID#1611788

Follow-up for 0985c7c4e22c8dbbea4398cf3453da45ebf63800

3 weeks agodebug-generator: use unsigned bit shift for breakpoint flags
Luca Boccassi [Sat, 28 Mar 2026 19:47:27 +0000 (19:47 +0000)] 
debug-generator: use unsigned bit shift for breakpoint flags

Using signed int literal '1' in left shift can lead to undefined
behavior if the shift amount causes overflow of a signed int. Use
UINT32_C(1) since the result is stored in a uint32_t variable.

CID#1568482

Follow-up for e9f781a5a4721d3e58798b37e30bb4dcdbe54c02

3 weeks agoscsi_id: use strscpy instead of strncpy for wwn fields
Luca Boccassi [Sat, 28 Mar 2026 19:35:36 +0000 (19:35 +0000)] 
scsi_id: use strscpy instead of strncpy for wwn fields

strncpy does not null-terminate the destination buffer if the source
string is longer than the count parameter. Since wwn and
wwn_vendor_extension are char[17] and we copy up to 16 bytes, there's
a risk of missing null termination. Use strscpy which always
null-terminates.

CID#1469706

Follow-up for 4e9fdfccbdd16f0cfdb5c8fa8484a8ba0f2e69d3

3 weeks agoresolved: fix TOCTOU in hook discovery
Luca Boccassi [Sat, 28 Mar 2026 19:05:19 +0000 (19:05 +0000)] 
resolved: fix TOCTOU in hook discovery

Coverity complains that the directory is not pinned by FD
so it might changed between the stat and the open

CID#1643236

Follow-up for 8209f4adcde08d225f56269e608ccd5f6704cd70

3 weeks agostat-util: add assert to silence coverity
Luca Boccassi [Sat, 28 Mar 2026 18:55:37 +0000 (18:55 +0000)] 
stat-util: add assert to silence coverity

Coverity thinks _mntidb can be used uninitialized, but this
is not the case when r == 0. Add a bool variable to make it
clearer instead of reusing 'r' later, and an assert to guide
static analyzers.

CID#1644850

Follow-up for 5817c73391b5f3599c50df2c0873b26ea426f848

3 weeks agostat-util: fix return type of mode_verify_socket()
Luca Boccassi [Sat, 28 Mar 2026 18:50:49 +0000 (18:50 +0000)] 
stat-util: fix return type of mode_verify_socket()

It returns an error code, not a mode

Follow-up for 97fe03e12faa4e50d25a3ca8999967801c7e2da9

3 weeks agope-binary: add explicit cast to silence coverity
Luca Boccassi [Sat, 28 Mar 2026 18:45:52 +0000 (18:45 +0000)] 
pe-binary: add explicit cast to silence coverity

Otherwise it gets confused about underflows (which are already checked)

CID#1645068

Follow-up for a43427013949c6593629f551cf46e9cf9c167100

3 weeks agope-binary: fix error reporting
Luca Boccassi [Sat, 28 Mar 2026 18:35:09 +0000 (18:35 +0000)] 
pe-binary: fix error reporting

This is a local calculation, errno is not set

Follow-up for a43427013949c6593629f551cf46e9cf9c167100

3 weeks agoboot: add overflow check in GPT parser
Luca Boccassi [Sat, 28 Mar 2026 18:29:28 +0000 (18:29 +0000)] 
boot: add overflow check in GPT parser

ALIGN_TO() can overflow and return SIZE_MAX

CID#1644887

Follow-up for ccbd324a3a522362de0863e8d06cdd06a58d2fca

3 weeks agoimdsd: voidify unchecked call
Luca Boccassi [Sat, 28 Mar 2026 17:56:51 +0000 (17:56 +0000)] 
imdsd: voidify unchecked call

CID#1646046

Follow-up for eb6e5b07f13cefddf1f49e1f7bda4af22f5aba17

3 weeks agodissect: add asserts to appease coverity
Luca Boccassi [Sat, 28 Mar 2026 15:37:53 +0000 (15:37 +0000)] 
dissect: add asserts to appease coverity

CID#1645844
CID#1645845

Follow-up for 91578e529395a0299a1e5eaa6da08e73db6eeacd

3 weeks agohwdb: Add keymaps for Acer Nitro 5 AN517-54
RiskoZS [Sat, 28 Mar 2026 01:51:20 +0000 (21:51 -0400)] 
hwdb: Add keymaps for Acer Nitro 5 AN517-54

Add mappings for the Fn+F7 (microphone mute), NitroSense and power keys for the Acer Nitro 5 AN517-54

3 weeks agosysupdate: add more input validation
Luca Boccassi [Sat, 28 Mar 2026 00:58:32 +0000 (00:58 +0000)] 
sysupdate: add more input validation

Ensure bogus inputs are cleanly rejected. These are privileged
interfaces so in practice it's not a problem.

Reported on yeswehack.com as YWH-PGM9780-168

Follow-up for bf2c741fd772af6f04b4fa234ada2d364f9a5d6c

3 weeks agomkosi: add CI for Ubuntu 26.04 (#41383)
Luca Boccassi [Sat, 28 Mar 2026 01:19:35 +0000 (01:19 +0000)] 
mkosi: add CI for Ubuntu 26.04 (#41383)

It is in final beta now, so we can start building and testing it

3 weeks agomkosi: add test job for Ubuntu 26.04 41383/head
Luca Boccassi [Fri, 27 Mar 2026 17:04:29 +0000 (17:04 +0000)] 
mkosi: add test job for Ubuntu 26.04

It is now in beta freeze, so we can start adding test coverage

3 weeks agomkosi: pull in gnu coreutils for Ubuntu 26.04 and newer
Luca Boccassi [Fri, 27 Mar 2026 20:59:46 +0000 (20:59 +0000)] 
mkosi: pull in gnu coreutils for Ubuntu 26.04 and newer

The default coreutils in Ubuntu 26.04 moved to uutils, which is broken
in many subtle and annoying ways, breaking various tests. It's also
a giant monolithic megabinary which makes the minimal image size
go up and break other tests.

Force the gnu coreutils to be pulled in all images.

3 weeks agotest: exclude gnusleep from coredumps parsing
Luca Boccassi [Fri, 27 Mar 2026 22:29:27 +0000 (22:29 +0000)] 
test: exclude gnusleep from coredumps parsing

In Ubuntu 26.04 the actual binary is called gnusleep, and sleep is a symlink,
so fix the regex exclusion for the coredump checks

3 weeks agotest: check for bin/bash in dissect --mtree instead of cat
Luca Boccassi [Fri, 27 Mar 2026 17:02:41 +0000 (17:02 +0000)] 
test: check for bin/bash in dissect --mtree instead of cat

Ubuntu is doing shenanigans with their coreutils so they are now
symlinks instead of binaries, so the grep fails. Check bash instead
to fix test failure on 26.04.

3 weeks agomkosi: depend on bpftool for Ubuntu 26.04 build image
Luca Boccassi [Fri, 27 Mar 2026 17:03:32 +0000 (17:03 +0000)] 
mkosi: depend on bpftool for Ubuntu 26.04 build image

bpftool was disentangled, so we can depend on it, and build with bpf

3 weeks agoboot-entry: add 'auto' keyword to parse_boot_entry_token_type
Duncan Overbruck [Fri, 13 Mar 2026 21:35:42 +0000 (22:35 +0100)] 
boot-entry: add 'auto' keyword to parse_boot_entry_token_type

Add the auto keyword as documented in the help message and man pages of
`kernel-install`, `bootctl` and `systemd-pcrlock`.

3 weeks agoshutdown: remove kexec-tools dependency
Luca Boccassi [Fri, 27 Mar 2026 19:32:29 +0000 (19:32 +0000)] 
shutdown: remove kexec-tools dependency

'kexec -e' is just a small wrapper that does the xen hypercall
on xen, or otherwise just calls reboot(). Drop the dependency,
and reuse the existing xen hypercall helper.

3 weeks agomany: more checks for pointer access without NULL check (#41370)
Zbigniew Jędrzejewski-Szmek [Fri, 27 Mar 2026 13:58:27 +0000 (14:58 +0100)] 
many: more checks for pointer access without NULL check (#41370)

This is a followup for https://github.com/systemd/systemd/pull/41096
that makes more subsystems pass the new `check-pointer-deref` coccinelle
checks. See the individual commits.

My plan is to do a few more of these PRs until we have it all covered. I
could also do it in a single very big PR but I'm worried about a)
conflicts b) that its just too big/annoying to review. Only 7 dirs left
but some (like src/basic) are quite big (~50k loc) so those PRs will be
a bit bigger.

3 weeks agovmspawn: improve firmware selection to match mkosi's implementation
Daan De Meyer [Fri, 27 Mar 2026 11:40:59 +0000 (11:40 +0000)] 
vmspawn: improve firmware selection to match mkosi's implementation

Align find_ovmf_config() with mkosi's find_ovmf_firmware() by adding
checks that were previously missing:

- Filter on interface-types, only selecting UEFI firmware definitions.
  Previously non-UEFI (e.g. BIOS-only) firmware could be selected.

- Check machine type compatibility using substring matching against the
  target machine patterns in firmware descriptions (e.g. "q35" matches
  "pc-q35-*"), following the same approach as mkosi.

- Make nvram-template optional in the firmware JSON mapping. Firmware
  definitions without an nvram-template are now parsed successfully
  (with vars remaining NULL) rather than failing entirely.

Also rework the firmware target parsing to store both architecture and
machine arrays per target (instead of just a flat architecture list),
and extract the machine matching into firmware_data_matches_machine().

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
3 weeks agovmspawn: Add --firmware=describe
Daan De Meyer [Fri, 27 Mar 2026 11:55:32 +0000 (12:55 +0100)] 
vmspawn: Add --firmware=describe

It's useful to be able to check what firmware description vmspawn
will select. In particular, this will allow me to figure out the
nvram template file that will be picked up so I can pick it up in
mkosi and operate on it to pass a modified version of it to vmspawn
with --efi-nvram-template=.

3 weeks agovmspawn: add --efi-nvram-template= and --firmware-features= options
Daan De Meyer [Fri, 27 Mar 2026 10:43:26 +0000 (10:43 +0000)] 
vmspawn: add --efi-nvram-template= and --firmware-features= options

Add --efi-nvram-template=PATH to specify a custom firmware variables
file to copy and use as the initial EFI NVRAM state instead of the
default template from the firmware definition.

Add --firmware-features=FEATURE[,FEATURE...] to require or exclude
specific firmware features during automatic firmware discovery.
Features prefixed with "!" are excluded. If a feature appears in both
the included and excluded lists, inclusion takes priority. Firmware
with the "enrolled-keys" feature is excluded by default.

Refactor --secure-boot= to operate on the firmware features sets
instead of maintaining a separate tristate. --secure-boot=yes adds
"secure-boot" to the include set, --secure-boot=no adds it to the
exclude set, and --secure-boot=auto removes it from both.

Generalize find_ovmf_config() to accept include/exclude feature sets
instead of a secure boot tristate, removing the special-cased
enrolled-keys and secure-boot filtering logic.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
3 weeks agopo: Translated using Weblate (Czech)
Pavel Borecki [Fri, 27 Mar 2026 12:58:47 +0000 (12:58 +0000)] 
po: Translated using Weblate (Czech)

Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Pavel Borecki <pavel.borecki@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/cs/
Translation: systemd/main

3 weeks agotmpfile-util: don't log about lack of O_TMPFILE support
Lennart Poettering [Thu, 26 Mar 2026 17:11:30 +0000 (18:11 +0100)] 
tmpfile-util: don't log about lack of O_TMPFILE support

It's a very common case (vfat...), and it's just too much noise. After
all the whole function exists primarily to deal with O_TMPFILE not being
availeble everywhere...

3 weeks agosd-boot: 4 smaller fixes (#41367)
Luca Boccassi [Fri, 27 Mar 2026 11:47:33 +0000 (11:47 +0000)] 
sd-boot: 4 smaller fixes (#41367)

3 weeks agomachine: never ever allow non-root-owned host machine
Mike Yuan [Thu, 26 Mar 2026 11:16:36 +0000 (12:16 +0100)] 
machine: never ever allow non-root-owned host machine

We really should lock this down _hard_, as evidenced by recent
security fallouts.

3 weeks agomachine: introduce MACHINE_CLASS_CAN_REGISTER
Mike Yuan [Thu, 26 Mar 2026 10:59:45 +0000 (11:59 +0100)] 
machine: introduce MACHINE_CLASS_CAN_REGISTER

Follow-up for 6df5f80bd374be1b45c52d740e88f0236da922c7

Similar to SESSION_CAN_* macros in logind-session.h

3 weeks agomkosi: update debian commit reference to 23ef56be0050f78be704f288ed1ce30ace47cbfe
Luca Boccassi [Thu, 26 Mar 2026 23:36:25 +0000 (23:36 +0000)] 
mkosi: update debian commit reference to 23ef56be0050f78be704f288ed1ce30ace47cbfe

23ef56be00 Install new files for upstream build
98645a89ba Install new files for upstream build
dc2dd78cc0 Install new files for upstream build
aad316ec34 Drop wildcards, dh_exec does not suppor them for manpages
3bf8703dab Install new files for upstream build
d1e92a6493 Update changelog for 260.1-1 release
e7a80fe2b8 Install basic.conf in sd-standalone-sysusers package
48f796240e Add lpadmin group to basic.conf sysusers.d as requested by CUPS maintainer
c15703b8aa Update changelog for 260-1 release
f26cc52a43 Drop version from libselinux-dev dependency
7f3701ae2f Do not run "systemctl enable getty@.service" unconditionally
ec59ddd832 Switch from libselinux1-dev to libselinux-dev
35258cd599 Update changelog for 260~rc4-1 release
eb194c22ff Update changelog for 260~rc3-1 release
a6878815d6 Really enable getty@ via packaging scriptlets

3 weeks agoimport: make check-pointer-deref clean 41370/head
Michael Vogt [Fri, 27 Mar 2026 10:30:32 +0000 (11:30 +0100)] 
import: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

3 weeks agoboot: avoid division by zero in splash image handling
Luca Boccassi [Fri, 27 Mar 2026 01:04:25 +0000 (01:04 +0000)] 
boot: avoid division by zero in splash image handling

A malformed image can cause a division by zero, check that
the parameters are not zero.

Reported on yeswehackl.com as YWH-PGM9780-173

Follow-up for 0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360b

3 weeks agonss-systemd: make check-pointer-deref clean
Michael Vogt [Fri, 27 Mar 2026 10:20:20 +0000 (11:20 +0100)] 
nss-systemd: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

3 weeks agoresolved: make check-pointer-deref clean
Michael Vogt [Fri, 27 Mar 2026 10:20:10 +0000 (11:20 +0100)] 
resolved: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

3 weeks agolibsystemd-network: make check-pointer-deref clean
Michael Vogt [Fri, 27 Mar 2026 10:20:01 +0000 (11:20 +0100)] 
libsystemd-network: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.

3 weeks agococcinelle: document why src/libc/ and src/test/ are excluded
Michael Vogt [Fri, 27 Mar 2026 10:20:40 +0000 (11:20 +0100)] 
coccinelle: document why src/libc/ and src/test/ are excluded

For some of the directories it makes more sense to keep them
excluded from the coccinelle check. Specifically:
- libc: compatibility, no asserts or systemd headers yet
- test: uses NUL internally to test crashes etc

3 weeks agococcinelle: generalize pidref_is_set() to `=~ _is_set()`
Michael Vogt [Fri, 27 Mar 2026 09:44:03 +0000 (10:44 +0100)] 
coccinelle: generalize pidref_is_set() to `=~ _is_set()`

Our coccinelle/check-pointer-deref.cocci checker has a special
case for `assert(pidref_is_set(param))`. It turns out we can
generalize this and catch the following:
- iovec_is_set
- sd_dhcp_duid_is_set
- sd_dhcp_client_id_is_set

3 weeks agobootspec: honour profile number when sorting properly 41367/head
Lennart Poettering [Thu, 26 Mar 2026 22:44:59 +0000 (23:44 +0100)] 
bootspec: honour profile number when sorting properly

This corrects sorting of menu entries regarding profile numbers:

1. If the profile number is unset, let's treat this identical to profile
   0, when ordering stuff, because an item with no profile is
   conceptually the same as an item with only a profile 0.

2. Let's take the profile number into account also if sort keys are
   used. This was makes profiles work sensibly in type 1 entries, via
   the recently added "profile" stanza.

Follow-up for: 5fb90fa3194d998a971b21e4a643670ae5903f85

3 weeks agoboot: do no show pixel width/height in text mode
Lennart Poettering [Thu, 26 Mar 2026 22:43:32 +0000 (23:43 +0100)] 
boot: do no show pixel width/height in text mode

When running in pure text mode (i.e. serial terminal) the pixel
width/height is zero and makes no sense to report. Suppress it.

3 weeks agoboot: properly track internal menu entries
Lennart Poettering [Thu, 26 Mar 2026 22:43:12 +0000 (23:43 +0100)] 
boot: properly track internal menu entries

When showing the list of menu entries via "p", the "internal call:"
field was showing nonsense, since
fb6cf4bbb75baee8a6988d899de2c6b3e3805e31.

Fix that by adding a proper entry type for "internal" menu items such as
reboot/firmware/poweroff, and then check for that.

With this in place all entries now have a loader type that makes sense
and describes precisely what an entry is about.

3 weeks agofundamental: move strv_isempty() into src/fundamental/
Lennart Poettering [Wed, 25 Mar 2026 17:08:16 +0000 (18:08 +0100)] 
fundamental: move strv_isempty() into src/fundamental/

3 weeks agoMake imds networking unlocked by default (#41359)
Mike Yuan [Thu, 26 Mar 2026 19:08:17 +0000 (20:08 +0100)] 
Make imds networking unlocked by default (#41359)

3 weeks agobasic/proc-cmdline: extend comments
Zbigniew Jędrzejewski-Szmek [Thu, 26 Mar 2026 12:47:44 +0000 (13:47 +0100)] 
basic/proc-cmdline: extend comments

Inspired by the discussion in #41161.

Also change the order of flags to be more logical. First the option
to specify at what fields we look, then the option to specify how we
return their name, the the value, and finally what to do if the value
is missing.

3 weeks agocreds: minor cleanups for --newline= handling (#41329)
Mike Yuan [Thu, 26 Mar 2026 17:36:51 +0000 (18:36 +0100)] 
creds: minor cleanups for --newline= handling (#41329)

Prompted by #41325

Fixes #41348

3 weeks agocore: address review feedback from Mike (#41354)
Mike Yuan [Thu, 26 Mar 2026 17:18:01 +0000 (18:18 +0100)] 
core: address review feedback from Mike (#41354)

This commit addresses the review feedback from @YHNdnzj (many thanks)

Closes: https://github.com/systemd/systemd/issues/41324