]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
26 hours agoefivars: fix potential memory leak
Luca Boccassi [Fri, 17 Oct 2025 09:23:28 +0000 (10:23 +0100)] 
efivars: fix potential memory leak

If 'ret' is not passed, 'x' is leaked

Follow-up for c8d60ae79d1763c6ef16fdb306b65d909a769de8

CID#1621673

(cherry picked from commit 05d45875f74cfb7455d127a5229dca440986e689)

26 hours agodissect: drop leftover assert
Luca Boccassi [Fri, 17 Oct 2025 09:15:24 +0000 (10:15 +0100)] 
dissect: drop leftover assert

This was refactored, and the assert is now wrongly placed. Drop
it to fix coverity warning.

Follow-up for dfdeb0b1cbb05a213f0965eedfe0e7ef06cd39d3

CID#1639975

(cherry picked from commit d2754100864d6de14a4758bfea5d8e4401120c69)

26 hours agocore/mount: properly handle REMOUNTING_* states in mount_stop()
Mike Yuan [Sun, 9 Feb 2025 22:12:15 +0000 (23:12 +0100)] 
core/mount: properly handle REMOUNTING_* states in mount_stop()

Currently, mount_stop() simply turns REMOUNTING_* into corresponding
UNMOUNTING_* states. However the transition is bogus, because
the interruption of remount does not bring down the mount.
Let's instead follow the logic of service_stop(), i.e. terminate
the remount process and spawn umount.

(cherry picked from commit 6ebb91d92fb5ea7d43b22bec1b76cde1230b0e12)

26 hours agocore/mount: remove one more unused temporary variable
Mike Yuan [Fri, 4 Jul 2025 15:05:38 +0000 (17:05 +0200)] 
core/mount: remove one more unused temporary variable

Similar to 3cea9c403c6d5ff0edb2b8fc99884f2243b1456e,
but for mount_get_what_escaped().

(cherry picked from commit a8fe8e83447a39831a23d82a82614fc19f2b9b46)

26 hours agocore: Don't use TTYPath= for PAM unless StandardInput=tty
Daan De Meyer [Thu, 16 Oct 2025 06:42:03 +0000 (08:42 +0200)] 
core: Don't use TTYPath= for PAM unless StandardInput=tty

Fixes #39334

(cherry picked from commit f875a8026ec2dfa6026da3ee216782e9f7c04a43)

26 hours agonsresource: fix varlink method dispatch table
Yu Watanabe [Wed, 15 Oct 2025 01:25:11 +0000 (10:25 +0900)] 
nsresource: fix varlink method dispatch table

Follow-up for 716bf93c4bde07c1870b9b0837f2ec33f36686f1 (v258).

(cherry picked from commit 0d87de0b8ed77f05c3f60dbee7b801cf3dd5f647)

26 hours agotimer: rebase the next elapse timestamp only if timer didn't already run
Frantisek Sumsal [Mon, 13 Oct 2025 15:36:55 +0000 (17:36 +0200)] 
timer: rebase the next elapse timestamp only if timer didn't already run

The test added in f4c3c107d9be4e922a080fc292ed3889c4e0f4a5 uncovered a
corner case while recalculating the next elapse timestamp of a timer unit
that uses RandomizedDelaySec= during deserialization.

If the scheduled time (without RandomizedDelaySec=) already elapsed,
systemd "rebases" the next elapse timestamp to the time when systemd
first started, to make the RandomizedDelaySec= feature work even at
boot. However, since it was done unconditionally, it always overrode the
next elapse timestamp, which could then cause the final next elapse
timestamp to fall out of the expected window.

With a couple of additional debug logs one of the test fail looks like
this:

[  132.129815] TEST-53-TIMER.sh[384]: + : 'Next elapse timestamp after daemon-reload, try #328'
[  132.129815] TEST-53-TIMER.sh[384]: + systemctl daemon-reload
[  132.136352] systemd[1]: Reload requested from client PID 16399 ('systemctl') (unit TEST-53-TIMER.service)...
[  132.136636] systemd[1]: Reloading...
[  132.446160] systemd[1]: Rebasing next elapse timestamp
[  132.446168] systemd[1]: v->next_elapse: Tue 2025-10-14 00:10:00 CEST
[  132.446170] systemd[1]: rebased: Tue 2025-10-14 00:10:56 CEST
[  132.446172] systemd[1]: v->next_elapse after rebase: Tue 2025-10-14 00:10:56 CEST
[  132.447361] systemd[1]: Reloading finished in 310 ms.
[  132.484041] TEST-53-TIMER.sh[384]: + check_elapse_timestamp
[  132.484041] TEST-53-TIMER.sh[384]: + systemctl status timer-RandomizedDelaySec-16377.timer
[  132.533657] TEST-53-TIMER.sh[16440]: ● timer-RandomizedDelaySec-16377.timer
[  132.533657] TEST-53-TIMER.sh[16440]:      Loaded: loaded (/run/systemd/system/timer-RandomizedDelaySec-16377.timer; static)
[  132.533657] TEST-53-TIMER.sh[16440]:      Active: active (waiting) since Mon 2025-10-13 23:00:00 CEST; 1h 13min ago
[  132.533657] TEST-53-TIMER.sh[16440]:  Invocation: 5555d4f060114a5493ff228013830d17
[  132.533657] TEST-53-TIMER.sh[16440]:     Trigger: Tue 2025-10-14 22:10:04 CEST; 21h left
[  132.533657] TEST-53-TIMER.sh[16440]:    Triggers: ● timer-RandomizedDelaySec-16377.service
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:07 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Changed dead -> waiting
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:07 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Adding 15h 35min 1.230173s random time.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:07 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Realtime timer elapses at Tue 2025-10-14 15:45:58 CEST.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:07 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Changed dead -> waiting
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Adding 16h 29min 44.084409s random time.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Realtime timer elapses at Tue 2025-10-14 16:40:41 CEST.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Changed dead -> waiting
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Adding 21h 59min 7.955828s random time.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Realtime timer elapses at Tue 2025-10-14 22:10:04 CEST.
[  132.533657] TEST-53-TIMER.sh[16440]: Oct 14 00:13:08 H systemd[1]: timer-RandomizedDelaySec-16377.timer: Changed dead -> waiting
[  132.535386] TEST-53-TIMER.sh[384]: + systemctl show -p InactiveExitTimestamp timer-RandomizedDelaySec-16377.timer
[  132.537727] TEST-53-TIMER.sh[16442]: InactiveExitTimestamp=Mon 2025-10-13 23:00:00 CEST
[  132.540317] TEST-53-TIMER.sh[16444]: ++ systemctl show -P NextElapseUSecRealtime timer-RandomizedDelaySec-16377.timer
[  132.547745] TEST-53-TIMER.sh[384]: + NEXT_ELAPSE_REALTIME='Tue 2025-10-14 22:10:04 CEST'
[  132.548020] TEST-53-TIMER.sh[16445]: ++ date '--date=Tue 2025-10-14 22:10:04 CEST' +%s
[  132.550218] TEST-53-TIMER.sh[384]: + NEXT_ELAPSE_REALTIME_S=1760472604
[  132.550218] TEST-53-TIMER.sh[384]: + : 'Next elapse timestamp should be Tue 2025-10-14 00:10:00 CEST <= Tue 2025-10-14 22:10:04 CEST <= Tue 2025-10-14 22:10:00 CEST'
[  132.550218] TEST-53-TIMER.sh[384]: + assert_ge 1760472604 1760393400
[  132.550555] TEST-53-TIMER.sh[16446]: + set +ex
[  132.550702] TEST-53-TIMER.sh[384]: + assert_le 1760472604 1760472600
[  132.550832] TEST-53-TIMER.sh[16447]: + set +ex
[  132.551091] TEST-53-TIMER.sh[16447]: FAIL: '1760472604' > '1760472600'

Here the original next elapse timestamp was Tue 2025-10-14 00:10:00 CEST
as expected, but it was overridden by the rebased timestamp:
Tue 2025-10-14 00:10:56 CEST. And when a new randomized delay was added
to it (21h 59min 7.955828s) the final next elapse timestamp fell out of
the expected window, i.e. Tue 2025-10-14 00:10:00 (scheduled time) <
Tue 2025-10-14 22:10:04 CEST (rebased elapse timestamp + randomized
delay) < Tue 2025-10-14 22:10:00 CEST (scheduled time + maximum from
RandomizedDelaySec=, i.e. 22h).

By limiting the timestamp rebase only the case where the unit hasn't
already run should prevent this from happening during daemon-reload.

(cherry picked from commit bdb8e584f4509de0daebbe2357d23156160c3a90)

26 hours agotest: format the min/max timestamps in "systemd" style
Frantisek Sumsal [Mon, 13 Oct 2025 15:35:02 +0000 (17:35 +0200)] 
test: format the min/max timestamps in "systemd" style

Before:
  Next elapse timestamp should be Sun Oct 12 00:10:00 UTC 2025 <= Sun 2025-10-12 05:43:04 UTC <= Sun Oct 12 22:10:00 UTC

After:
  Next elapse timestamp should be Tue 2025-10-14 00:10:00 CEST <= Tue 2025-10-14 19:39:11 CEST <= Tue 2025-10-14 22:10:00 CEST
(cherry picked from commit 62ca845ac776d5877fe46dab52692053df6c8efa)

26 hours agocore: allow split /usr/local/s?sbin with merged /usr/s?bin
Zbigniew Jędrzejewski-Szmek [Fri, 10 Oct 2025 12:29:50 +0000 (14:29 +0200)] 
core: allow split /usr/local/s?sbin with merged /usr/s?bin

Previously, we used either the fully split path or the fully merged path,
treating "split sbin" as a boolean condition. The idea was that conversion to
to merged bin would be a single event, so we don't need to care about the
details of the transition. But it turns out that some systems may be converted
in disparate steps. In https://bugzilla.redhat.com/show_bug.cgi?id=2400220,
there was a lengthy discussion about a coreos system where
/usr/local/{bin,sbin} were created as separate directories. Since /usr/local is
not part of the packaged system, it might remain split for a longer time. So
check /usr/local/s?bin separately and stop adding /usr/sbin to $PATH if only
/usr/local/s?bin is split. (I don't think it makes sense to handle the reverse
case, i.e. only /usr/s?bin being split, since that should be much rarer.)

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=2400220.

(cherry picked from commit e63917abe16c37c828f99710f1e9922093d9a2b9)

26 hours agocore/service: properly handle freezer action -> watchdog propagation
Mike Yuan [Mon, 6 Oct 2025 00:03:12 +0000 (02:03 +0200)] 
core/service: properly handle freezer action -> watchdog propagation

Follow-up for 25178aadb2bd04ef9e63f48c1ef42fb309f9332e

(cherry picked from commit 4f07ec2b651e40fe04455e660606d2a0f9ae375c)

26 hours agocore/service: drop "cgroup" part of service_cgroup_freezer_action()
Mike Yuan [Sun, 5 Oct 2025 23:46:58 +0000 (01:46 +0200)] 
core/service: drop "cgroup" part of service_cgroup_freezer_action()

This operates on more than cgroup, hence use generic naming,
which also aligns with slice_freezer_action().

(cherry picked from commit b5381d76d591a3cf428bc1a5f3e187dccaf5ea2e)

26 hours agounit-def: introduce freezer_state_objective()
Mike Yuan [Mon, 6 Oct 2025 00:27:55 +0000 (02:27 +0200)] 
unit-def: introduce freezer_state_objective()

No functional change, preparation for later commits.

(cherry picked from commit 1cbbb05bc76015bb6f48c217453e98a73cc30344)

33 hours agomkosi: Disable lto feature of systemd spec
Daan De Meyer [Wed, 29 Oct 2025 12:56:16 +0000 (13:56 +0100)] 
mkosi: Disable lto feature of systemd spec

This makes sure the systemd spec doesn't check if LTO is working as
expected when it is actually disabled.

(cherry picked from commit a835537f75875bdc1a5d49b82c99c0fccd598366)

33 hours agolibsystemd: drop unused header
Yu Watanabe [Tue, 4 Nov 2025 17:42:19 +0000 (02:42 +0900)] 
libsystemd: drop unused header

Follow-up for 2dbf1c0f1556bcf8fbab2491ec0f23a85884c551.

(cherry picked from commit 89040373dd989d22ca62e4aff9b9328c1d1a8d68)

33 hours agotree-wide: add missing '#pragma once'
Yu Watanabe [Sun, 2 Nov 2025 08:43:14 +0000 (17:43 +0900)] 
tree-wide: add missing '#pragma once'

(cherry picked from commit 5963cdf49867885d1d0641fe0693a3513aa4182a)

33 hours agomkosi: update fedora commit reference to 8e2833a5b64f7e2ce62ea0a2d0ec9e393e718dfa
Zbigniew Jędrzejewski-Szmek [Mon, 3 Nov 2025 11:19:37 +0000 (12:19 +0100)] 
mkosi: update fedora commit reference to 8e2833a5b64f7e2ce62ea0a2d0ec9e393e718dfa

8e2833a5b6 Automatically figure out the name of the top-level tar dir
dffbf2beba Make sure fallback source is listed first
1d3b892105 Enable sysupdate and sysupdated

(cherry picked from commit 9218e4eacc545a36a1275264013cb3d6b3eef41f)

33 hours agobacklight: fix typo
jouyouyun [Mon, 3 Nov 2025 08:04:33 +0000 (16:04 +0800)] 
backlight: fix typo

(cherry picked from commit 10cdb586905e7620fd67e723d42464e4b96dd950)

33 hours agobootctl: fix typo
jouyouyun [Mon, 3 Nov 2025 06:17:35 +0000 (14:17 +0800)] 
bootctl: fix typo

(cherry picked from commit 49ca2d87780354c5bb791da06b926111b4522450)

33 hours agodocs: add comment about requiring the mount hierarchy to be mounted MS_SHARED
Lennart Poettering [Sat, 1 Nov 2025 21:21:32 +0000 (22:21 +0100)] 
docs: add comment about requiring the mount hierarchy to be mounted MS_SHARED

This has been tripping up container manager people. let's document this
explicitly.

(Note that the container interface could really use some updates, i.e.
it was written before a time where cgroup namespacing was a thing. But I
am too lazy to fix that now, so let's just add this once facet.)

(cherry picked from commit 32f4e30be58c2d5fabff32efbd4d266ae0d7503d)

33 hours agodoc: indicate Type=oneshot also detects invocation failures
Christoph Anton Mitterer [Mon, 20 Oct 2025 01:30:58 +0000 (03:30 +0200)] 
doc: indicate Type=oneshot also detects invocation failures

Type `simple` explicitly mentions that invocation failures like a missing binary
or `User=` name won’t get detected – whereas type `exec` mentions that it does.

Type `oneshot` refers to being similar to `simple`, which could lead one to
assume it doesn’t detect such invocation failures either – it seems however it
does.

Indicate this my changing its wording to be similar to `exec`.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
(cherry picked from commit a983cf253fd099877eae1fa125c95bdef578a15b)

33 hours agoman: fix outdated link to freedesktop.org documentation (#39511)
Florian [Fri, 31 Oct 2025 17:03:43 +0000 (18:03 +0100)] 
man: fix outdated link to freedesktop.org documentation (#39511)

Freedesktop changed their link format.

(cherry picked from commit f2875c73a2a6816fe190eae2549681922b65925e)

33 hours agonspawn: Fix docs
Daan De Meyer [Thu, 30 Oct 2025 21:20:36 +0000 (22:20 +0100)] 
nspawn: Fix docs

(cherry picked from commit 097b6d3f662c9c2917360ea779bc531039ba96f1)

33 hours agoman: clarify quoting of `$` in command lines (#39494)
Christoph Anton Mitterer [Fri, 31 Oct 2025 06:28:57 +0000 (07:28 +0100)] 
man: clarify quoting of `$` in command lines (#39494)

When the special executable prefix `:` is used, `$$` yield the literal `$$`.

(cherry picked from commit bfb365d92445f8ac0bb5c57106a8598dc5eb56d4)

33 hours agoman: clarify requirements for BridgeVLAN to work
dgengtek [Thu, 30 Oct 2025 18:50:11 +0000 (19:50 +0100)] 
man: clarify requirements for BridgeVLAN to work

(cherry picked from commit 4207abb6e108ada8b24f2008533090f318b789e4)

33 hours agoman: handle leading/trailing/repeating whitespaces in anchor links
Frantisek Sumsal [Thu, 23 Oct 2025 13:30:52 +0000 (15:30 +0200)] 
man: handle leading/trailing/repeating whitespaces in anchor links

So even if a <term> section contains newlines, we get a reasonable
anchor link to it.

Before:
<dt id="
  bind
  UNIT
  PATH
  [PATH]
"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#%0A%20%20%20%20%20%20%20%20%20%20%20%20bind%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT%0A%20%20%20%20%20%20%20%20%20%20%20%20PATH%0A%20%20%20%20%20%20%20%20%20%20%20%20[PATH]%0A%20%20%20%20%20%20%20%20%20%20">¶</a>

After:
<dt id="bind UNIT PATH [PATH]"><span class="term">
...
<a class="headerlink" title="Permalink to this term" href="#bind%20UNIT%20PATH%20[PATH]">¶</a>

Resolves: #39196
(cherry picked from commit 7168535165282772b0a1de56ba3c8fbf506fbe95)

33 hours agozsh: add completion for dbus bus address
Ronan Pigott [Sun, 26 Oct 2025 04:04:03 +0000 (21:04 -0700)] 
zsh: add completion for dbus bus address

The DBUS_SESSION_BUS_ADDRESS and DBUS_SYSTEM_BUS_ADDRESS parameters have
an interesting syntax thats useful to complete. Let's include a
completion definition for these parameters.

(cherry picked from commit 6f8e6e50a0e3901e347840c323b1b450945d047a)

33 hours agoman/network: extend document about the default value of IPv6AcceptRA=
Yu Watanabe [Tue, 21 Oct 2025 17:52:28 +0000 (02:52 +0900)] 
man/network: extend document about the default value of IPv6AcceptRA=

Prompted by #39304.

(cherry picked from commit cc7ccd3c6a2be9203057f81be4ef55e94b2ab85c)

33 hours agoman: Clarify usage of /usr/share/factory/ in programs
Ryan Brue [Mon, 18 Aug 2025 17:12:26 +0000 (12:12 -0500)] 
man: Clarify usage of /usr/share/factory/ in programs

As discussed in this thread:
https://github.com/redhat-performance/tuned/issues/798#issuecomment-3197697654

/usr/share/factory/ is not intended to be read from by programs,
but the wording in the FHS can be misread to think that programs
should be using /usr/share/factory/ as the vendor supplied configuration
directory rather than something like /usr/lib/foo/ or /usr/share/foo/.

This commit points developers to the UAPI configuration spec for how to
make their programs hermetic /usr/ compatible.

Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
(cherry picked from commit e80c5eb6e63c394fd90c2d8cf454ee649e59ae21)

33 hours agoman: fix position of </para> tag
Yu Watanabe [Mon, 20 Oct 2025 05:26:28 +0000 (14:26 +0900)] 
man: fix position of </para> tag

Follow-up for 65664bba4090816f7e1fe40ed743480c19d702ee.

(cherry picked from commit b200f57bfaf19054e5f9e175e8b760a7a8e585e4)

33 hours agodocs: fix conversion / calculation errors
Marien Zwart [Sun, 19 Oct 2025 13:41:08 +0000 (00:41 +1100)] 
docs: fix conversion / calculation errors

0x1770 is 6000, not 60000. It looks like 60000 is intended (the next
range starts at 60000 in both decimal and hex), so use that.

1000 to 60000 is 59001 users, as the range is inclusive on both sides.
Similar off-by-one for one of the "unused" ranges. After these changes,
the sizes of the ranges up to and including the "-1" ID sum up to 65536,
as expected.

I'm not sure where the size of the unused range after the container UID
range came from, but it is not correct (the "Container UID" and this
reserved range combined would be larger than the "HIC SVNT LEONES" 2^31
to 2^32-2 range...). Fix it.

It is unfortunate that the first half of this table makes more sense in
decimal while the second half makes more sense in hex (which would also
make the size in 65536 chunks easy to obtain): I'm tempted to add a
"sizes in hex" column...

(cherry picked from commit 1599b6fbe2aec1431c026fdbdc510e704e9fe8dd)

33 hours agotest: avoid divide-by-zero coverity warning
Luca Boccassi [Fri, 17 Oct 2025 10:42:20 +0000 (11:42 +0100)] 
test: avoid divide-by-zero coverity warning

CID#1587762

(cherry picked from commit d0a066a1a4a391f629f7f52b5005103f8daf411f)

33 hours agomkosi: install new knot-keymgr in Fedora rawhide
Luca Boccassi [Fri, 17 Oct 2025 12:30:37 +0000 (13:30 +0100)] 
mkosi: install new knot-keymgr in Fedora rawhide

https://src.fedoraproject.org/rpms/knot/c/52aa1c6b27ca981abe9960c0a4161be7204be75e

TEST-75-RESOLVED.sh[116]: + keymgr . generate algorithm=ECDSAP256SHA256 ksk=yes zsk=yes
TEST-75-RESOLVED.sh[454]: /usr/lib/systemd/tests/testdata/units/TEST-75-RESOLVED.sh: line 153: keymgr: command not found

(cherry picked from commit dc567bc4060131dadc482929bd03ade72f6fb6d4)

33 hours agoman/systemd-systemd.conf: describe DefaultEnvironment= and ManagerEnvironment= better
Zbigniew Jędrzejewski-Szmek [Fri, 10 Oct 2025 16:28:09 +0000 (18:28 +0200)] 
man/systemd-systemd.conf: describe DefaultEnvironment= and ManagerEnvironment= better

The description of ME= said "see above", but it was actually above the other
one. So change the order. But while reading this, I found it very hard to
understand. So reword things, hopefully in a way that is easier to understand.
The current behaviour is rather complex and unintuitive, but this description
just tries to describe it truthfully.

(cherry picked from commit 938f7fea7c953e5f5e9e199a5fcd22ac84fd1240)

33 hours agoman/crypttab: avoid using jargon spelling
Zbigniew Jędrzejewski-Szmek [Thu, 9 Oct 2025 10:17:09 +0000 (12:17 +0200)] 
man/crypttab: avoid using jargon spelling

(cherry picked from commit 5a8a6d471e8786980304d96b6ce908ad8983a368)

2 weeks agoci: add bpftool workaround to coverity too
Luca Boccassi [Sat, 18 Oct 2025 13:23:59 +0000 (14:23 +0100)] 
ci: add bpftool workaround to coverity too

(cherry picked from commit d29f181cf02100c146fc8691a5515a708d06ddbf)

2 weeks agoci: fix workaround about bpftool for codeql
Yu Watanabe [Sat, 18 Oct 2025 01:39:13 +0000 (10:39 +0900)] 
ci: fix workaround about bpftool for codeql

Follow-up for e9fd2bbfffc5c2c7cd1ea0a288d5435fc15e387f.

(cherry picked from commit a6836cfa0bdf1bb1fcf05686c5af3f2b5ad97f6b)

2 weeks agoci: add bpftool workaround to codeql job too
Luca Boccassi [Fri, 17 Oct 2025 14:39:09 +0000 (15:39 +0100)] 
ci: add bpftool workaround to codeql job too

(cherry picked from commit e9fd2bbfffc5c2c7cd1ea0a288d5435fc15e387f)

2 weeks agoci: re-enable bpf-framework option for build and unit test jobs
Luca Boccassi [Fri, 17 Oct 2025 13:00:23 +0000 (14:00 +0100)] 
ci: re-enable bpf-framework option for build and unit test jobs

Use the same trickery we do in the package build and search for
the actual bpftool binary. For the CI job any one we find is
good enough.
When we switch all jobs to 26.04 we can drop all of this.

This reverts commit cc814110af7a453db898ea2990a0281616d5ceff.

(cherry picked from commit 3b11139c0db9dd0a37b0493a8d2ad5f531a92344)

2 weeks agoci: Disable bpf-framework option for build and unit test jobs
Daan De Meyer [Fri, 17 Oct 2025 09:53:48 +0000 (11:53 +0200)] 
ci: Disable bpf-framework option for build and unit test jobs

/usr/sbin/bpftool is completely broken inside containers on
Ubuntu which makes meson blow up so disable the bpf-framework
stuff to avoid the issue.

TODO: Drop when we move off Ubuntu Noble as this will be fixed
in the next Ubuntu LTS release.

(cherry picked from commit cc814110af7a453db898ea2990a0281616d5ceff)

2 weeks agocore/unit: fail earlier before spawning executor when we failed to realize cgroup
Yu Watanabe [Tue, 23 Sep 2025 20:29:22 +0000 (05:29 +0900)] 
core/unit: fail earlier before spawning executor when we failed to realize cgroup

Before 23ac08115af83e3a0a937fa207fc52511aba2ffa, even if we failed to
create the cgroup for a unit, a cgroup runtime object for the cgroup is
created with the cgroup path. Hence, the creation of cgroup is failed,
execution of the unit will fail in posix_spawn_wrapper() and logged
something like the following:
```
systemd[1]: testservice.service: Failed to create cgroup /testslice.slice/testservice.service: Cannot allocate memory
systemd[1]: testservice.service: Failed to spawn executor: No such file or directory
systemd[1]: testservice.service: Failed to spawn 'start' task: No such file or directory
systemd[1]: testservice.service: Failed with result 'resources'.
systemd[1]: Failed to start testservice.service.
```

However, after the commit, when we failed to create the cgroup, a cgroup
runtime object is not created, hence NULL will be assigned to
ExecParameters.cgroup_path in unit_set_exec_params().
Hence, the unit process will be invoked in the init.scope.
```
systemd[1]: testservice.service: Failed to create cgroup /testslice.slice/testservice.service: Cannot allocate memory
systemd[1]: Starting testservice.service...
cat[1094]: 0::/init.scope
systemd[1]: testservice.service: Deactivated successfully.
systemd[1]: Finished testservice.service.
```
where the test service calls 'cat /proc/self/cgroup'.

To fix the issue, let's fail earlier when we failed to create cgroup.

Follow-up for 23ac08115af83e3a0a937fa207fc52511aba2ffa (v258).

(cherry picked from commit 8b4ee3d68d2e70d9a396b74d155eab3b11763311)

3 weeks agomeson: bump version to 258.1 v258.1
Zbigniew Jędrzejewski-Szmek [Mon, 13 Oct 2025 15:01:55 +0000 (17:01 +0200)] 
meson: bump version to 258.1

3 weeks agohwdb: update to main@{2025-10-13}
Zbigniew Jędrzejewski-Szmek [Mon, 13 Oct 2025 10:28:13 +0000 (12:28 +0200)] 
hwdb: update to main@{2025-10-13}

git restore -s origin/main hwdb.d/ test/hwdb.d && git checkout hwdb.d/meson.build

This primarily reverts some changes made in the previous update.

3 weeks agosd-id128: Drop _sd_const_ from sd_id128_in_setv()
Daan De Meyer [Mon, 13 Oct 2025 08:43:16 +0000 (10:43 +0200)] 
sd-id128: Drop _sd_const_ from sd_id128_in_setv()

Both the const and pure attributes disallow modifying input arguments
but sd_id128_in_setv() clearly modifies its ap input argument by iterating
over it with va_arg() so drop the _sd_const_ attribute from
sd_id128_in_setv().

(cherry picked from commit 675fa49f69943b0f009c973ed3d1e90afc1d88b1)

3 weeks agotimer: don't run service immediately after restart of a timer
Lukas Nykryn [Tue, 9 Sep 2025 13:24:22 +0000 (15:24 +0200)] 
timer: don't run service immediately after restart of a timer

When a timer is restarted, don't reset the last_trigger field.
This prevents the timer from triggering immediately.

Fixes: #31231
(cherry picked from commit 3fc44a0f68412b649e16f12ff2f97a36c615457d)

3 weeks agotest: check the next elapse timer timestamp after deserialization
Frantisek Sumsal [Tue, 23 Sep 2025 19:04:12 +0000 (21:04 +0200)] 
test: check the next elapse timer timestamp after deserialization

When deserializing a serialized timer unit with RandomizedDelaySec= set,
systemd should use the last inactive exit timestamp instead of current
realtime to calculate the new next elapse, so the timer unit actually
runs in the given calendar window.

Provides coverage for:
  - https://github.com/systemd/systemd/issues/18678
  - https://github.com/systemd/systemd/pull/27752

(cherry picked from commit f4c3c107d9be4e922a080fc292ed3889c4e0f4a5)

3 weeks agotest: restarting elapsed timer shouldn't trigger the corresponding service
Frantisek Sumsal [Tue, 23 Sep 2025 15:42:01 +0000 (17:42 +0200)] 
test: restarting elapsed timer shouldn't trigger the corresponding service

Provides coverage for:
  - https://github.com/systemd/systemd/issues/31231
  - https://github.com/systemd/systemd/issues/35805

(cherry picked from commit 5730a400fd5ee82566fe03eb832121a0d4bc26b6)

3 weeks agotest: rename TEST-53-ISSUE-16347 to TEST-53-TIMER
Frantisek Sumsal [Tue, 23 Sep 2025 12:28:33 +0000 (14:28 +0200)] 
test: rename TEST-53-ISSUE-16347 to TEST-53-TIMER

And split the existing test into a separate subtest.

(cherry picked from commit 953c347fb6f293acbd6da009646bfc071b68ddd7)

3 weeks agosysext: do not attempt to unlock images interactively
Luca Boccassi [Tue, 26 Aug 2025 18:12:53 +0000 (19:12 +0100)] 
sysext: do not attempt to unlock images interactively

These images are not using a passphrase, they are using keys
or at most TPM-based sealing (not yet implemented, for contexts).

Do not use the interactive helper, as it will block and ask the
user for a password if it fails to find the signing cert, which
is not useful for this tool.

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

(cherry picked from commit 09f655ad4af59ef4ff8ebd02ca5421f8901cb16b)

3 weeks agomeson: fix link-udev-shared option
Luca Boccassi [Wed, 17 Sep 2025 15:13:37 +0000 (16:13 +0100)] 
meson: fix link-udev-shared option

This doesn't work anymore, setting it to false still makes
udev link to libsystemd-shared, as an argument was mistakenly
dropped.

Follow-up for 6350d2dbd97746440b9c8303ddc140ffda568732

(cherry picked from commit 9736f634c8b61343be966114ce1c9eddaf0fa742)

3 weeks agoFix path in docs for local pcrlock.d directory
Kai Wohlfahrt [Wed, 17 Sep 2025 21:53:59 +0000 (23:53 +0200)] 
Fix path in docs for local pcrlock.d directory

(cherry picked from commit 9ba0fd9293b3be88d64199119f257b13a21caf67)

3 weeks agomountfsd: uncomment CapabilityBoundingSet= line
Lennart Poettering [Sat, 23 Aug 2025 06:08:06 +0000 (08:08 +0200)] 
mountfsd: uncomment CapabilityBoundingSet= line

Since mountfsd was added in 702a52f4b5d49cce11e2adbc740deb3b644e2de0 the
caps bounding set line was commented. That's an accident. Fix that. (We
need to add a bunch of caps to the list).

(cherry picked from commit 818bd1dfa1e4ac222b1fc5d238807e49fd1d7939)

3 weeks agocore: fix status output suppression
Lennart Poettering [Fri, 19 Sep 2025 08:13:45 +0000 (10:13 +0200)] 
core: fix status output suppression

This fixes two things: first of all it ensures we take the override
status output field properly into account, instead of going directly to
the regular one.

Moreover, it ensures that we bypass auto for both notice + emergency,
since both have the same "impact", and, don't limit this for notice
only.

(cherry picked from commit 9ecc969855ce7d8e587ea2ea0b6c3120877a7887)

3 weeks agounit: line-break overly long parameter list + add assert()
Lennart Poettering [Fri, 19 Sep 2025 08:12:52 +0000 (10:12 +0200)] 
unit: line-break overly long parameter list + add assert()

(cherry picked from commit 8e9b722b4ad94d1739810ff2792b9c03ba5c850e)

3 weeks agojob: shorten code
Lennart Poettering [Fri, 19 Sep 2025 08:12:13 +0000 (10:12 +0200)] 
job: shorten code

(cherry picked from commit 84ba8721de9d70340747758f9d028a3f9c4e302e)

3 weeks agocore/manager: honor show_status_overridden in manager_watch_jobs_next_time()
Mike Yuan [Fri, 19 Sep 2025 17:35:08 +0000 (19:35 +0200)] 
core/manager: honor show_status_overridden in manager_watch_jobs_next_time()

Prompted by #39029

(cherry picked from commit 4f8c1de21317818b8968f065435a2afb7cadf645)

3 weeks agomachine: fix crash on update from older than v258
Yu Watanabe [Sun, 21 Sep 2025 15:45:14 +0000 (00:45 +0900)] 
machine: fix crash on update from older than v258

UID entry in the machine state file is introduced in v258,
hence when a host is upgraded to v258, the field does not exist in the
file, thus the variable 'uid' is NULL.

Follow-up for 276d20018623ef14956ce87975be48da5de63f29.
Fixes #39061.

(cherry picked from commit 43cea09f95e5a051432e040c823e945b8b327ed4)

3 weeks agocore/bpf-firewall: replace unnecessary unit_setup_cgroup_runtime() with unit_get_cgro...
Yu Watanabe [Tue, 23 Sep 2025 19:45:21 +0000 (04:45 +0900)] 
core/bpf-firewall: replace unnecessary unit_setup_cgroup_runtime() with unit_get_cgroup_runtime()

Except for the test, bpf_firewall_compile() is only called by the following:
  cgroup_context_apply() -> cgroup_apply_firewall() -> bpf_firewall_compile()
and in the early stage of cgroup_context_apply(), it checks if the cgroup
runtime exists. Hence, it is not necessary to try to allocate the
runtime in bpf_firewall_compile().

(cherry picked from commit e8a5cda4714fc6fe622a03cfca6c75888d63e354)

3 weeks agocore/cgroup: make sure deserialized accounting data is not voided
Mike Yuan [Thu, 25 Sep 2025 20:28:33 +0000 (22:28 +0200)] 
core/cgroup: make sure deserialized accounting data is not voided

Currently, cgroup_path is (de-)serialized after all the cached
accounting data. This is bogus though, since unit_set_cgroup_path()
destroys the CGroupRuntime object and starts afresh, discarding
all deserialized values. This matters especially for IP accounting,
whose BPF maps get recreated on reload/reexec and the previous values
are exclusively retrievable from deserialization. Let's hence swap things
around and serialize cgroup_path first, accounting data only afterwards.

(cherry picked from commit 055a5a236c6776fa281890aa17972c6ed3a1132e)

3 weeks agocore/cgroup: realign macro line continuation
Mike Yuan [Thu, 25 Sep 2025 20:33:19 +0000 (22:33 +0200)] 
core/cgroup: realign macro line continuation

(cherry picked from commit e99f741cdf714c900fc6cafc53d19701ed6b02a1)

3 weeks agopidfd-util: add missing trailing argument for ioctl(PIDFD_GET_*_NAMESPACE)
Yu Watanabe [Fri, 10 Oct 2025 06:14:07 +0000 (15:14 +0900)] 
pidfd-util: add missing trailing argument for ioctl(PIDFD_GET_*_NAMESPACE)

Otherwise, it always fails with EINVAL.

(cherry picked from commit 608fc3fa2c4902d84fd925b328b730d3b2dbff50)

3 weeks agonspawn: correct the option name `--private-users-ownership=` when it's not expected...
n0099 [Thu, 2 Oct 2025 08:44:28 +0000 (08:44 +0000)] 
nspawn: correct the option name `--private-users-ownership=` when it's not expected value

(cherry picked from commit 613f7f26aa7524b7f2c9a6246e4ecfbecb40c4fa)

3 weeks agoshared/bootspec: parse loader.conf options added in v258
Felix Pehla [Sat, 27 Sep 2025 19:58:21 +0000 (21:58 +0200)] 
shared/bootspec: parse loader.conf options added in v258

(cherry picked from commit aaa3e6880da71c2faefb619ea7a974dab6a8443d)

3 weeks agoshared/bootspec: parse 'uki' boot entry option
Felix Pehla [Sat, 27 Sep 2025 13:01:06 +0000 (15:01 +0200)] 
shared/bootspec: parse 'uki' boot entry option

Commit e2a3d562189c413de3262ec47cdc1e1b0b13d78b (as part of #36314)
makes sd-boot recognize a 'uki' stanza in a boot loader entry and
uapi-group/specifications@3f2bd8236d7f9ce6dedf8bda9cadffd0d363cb08 adds
it to the BLS, but bootctl and other components parsing said config do
not know about it, leading to the error message
`Unknown line 'uki', ignoring.` when attempting to parse the same entry.

This commit makes it get parsed the same way that that 'efi' is.

(cherry picked from commit 4a94a1b83f8857b906bc7924b3f853768b5499b5)

3 weeks agosystemctl.xml: fix line breaks in documentation anchor links
Managor [Sat, 27 Sep 2025 11:48:23 +0000 (14:48 +0300)] 
systemctl.xml: fix line breaks in documentation anchor links

This combines two commits:
(cherry picked from commit 9f4f7f0372688127adc27f82a75db58749eb6d6e)
+
(cherry picked from commit b0fe317d14c4e9a02ff661c2ccd37f093cfda396)

3 weeks agomeasure: silence warning on TCG protocol
Christian Hesse [Fri, 10 Oct 2025 15:46:18 +0000 (17:46 +0200)] 
measure: silence warning on TCG protocol

This pops up for some people, and adds a delay on boot.

The proper fix is in #38701, but technically it is a new feature. So
let's just silence the message in v258-stable.

3 weeks agonspawn: don't try to connect to D-Bus when it's not necessary (#39045)
Aleksandr Mezin [Mon, 22 Sep 2025 10:59:38 +0000 (13:59 +0300)] 
nspawn: don't try to connect to D-Bus when it's not necessary (#39045)

`runtime_bus` is only used if `!arg_keep_unit`.

`system_bus` is additionally used if `arg_register`.

So for `!arg_register && arg_keep_unit`, none of them should be
necessary, and nspawn should be able to work without any D-Bus
connections.

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

Follow-up for f2f26f1527529b1ea7dcb0dba85456ac98800627

(cherry picked from commit c3d5f5f165ce7ccf8d57c4272c39d83a08279db7)

3 weeks agologin: update ACL on static device nodes again
Yu Watanabe [Tue, 23 Sep 2025 01:17:47 +0000 (10:17 +0900)] 
login: update ACL on static device nodes again

In the commit c960ca2be1cfd183675df581f049a0c022c1c802, the logic of
updating ACL on device node was moved from logind to udevd, but at that
time, mistakenly removed the logic for static nodes.

Fixes a regression caused by c960ca2be1cfd183675df581f049a0c022c1c802 (v258).
Fixes #39043.

(cherry picked from commit 2c762d90cfe7d67f10af87986ed2e6f0005eabfb)

3 weeks agoudev: move devnode_acl() back to libshared
Yu Watanabe [Tue, 23 Sep 2025 00:56:09 +0000 (09:56 +0900)] 
udev: move devnode_acl() back to libshared

This effectively reverts 1abb592f2f886913492e4967cc96816c167177a9.
No functional change, preparation for the next commit.

(cherry picked from commit 41c4a69653f7ca48a449de172e73acd43eda81a4)

4 weeks agohwdb: update to main@{2025-10-10} 39272/head
Zbigniew Jędrzejewski-Szmek [Fri, 10 Oct 2025 08:24:53 +0000 (10:24 +0200)] 
hwdb: update to main@{2025-10-10}

git restore -s origin/main hwdb.d/ test/hwdb.d && git checkout hwdb.d/meson.build

4 weeks agoman: fix a missing word
Frantisek Sumsal [Wed, 8 Oct 2025 15:23:31 +0000 (17:23 +0200)] 
man: fix a missing word

Follow-up for 6d48c7cf736ced70c1c2fef1e1f03618911d04bc.

(cherry picked from commit 67111e1bd918f9e1b4b542d1e0fe84f1d571876e)

4 weeks agoman/factory-reset: fix typo in EFI variable name
Antonio Alvarez Feijoo [Wed, 8 Oct 2025 13:05:06 +0000 (15:05 +0200)] 
man/factory-reset: fix typo in EFI variable name

(cherry picked from commit 575087d68b0f5b7129484e50fd3d2b1a313d87c5)

4 weeks agolicensing: update address of FSF
Zbigniew Jędrzejewski-Szmek [Tue, 7 Oct 2025 11:04:47 +0000 (13:04 +0200)] 
licensing: update address of FSF

rpmlint complains about the old address, even though it totally
doesn't matter and nobody cares.

(cherry picked from commit 4a8c41f3eb83aa1524501d9dc1c56c9026579f18)

4 weeks agosysctl: add missing help entry for --strict
Yu Watanabe [Sun, 5 Oct 2025 17:20:21 +0000 (02:20 +0900)] 
sysctl: add missing help entry for --strict

Follow-up for e88748c17e58aad6818e64fd3071de011808165e.

(cherry picked from commit 95c71c8f6e2f689789eb9f882c605252a83d5827)

4 weeks agoNEWS: Document new uaccess udev rule priority requirement
Guido Günther [Sun, 5 Oct 2025 07:26:26 +0000 (09:26 +0200)] 
NEWS: Document new uaccess udev rule priority requirement

Closes: https://github.com/systemd/systemd/issues/39206
Signed-off-by: Guido Günther <agx@sigxcpu.org>
(cherry picked from commit 01703b776148929f42c74cdc4be9c515f4856d90)

4 weeks agomam: add sd_bus_track_handler_t signature to manpage (#39204)
jsks [Sun, 5 Oct 2025 10:00:22 +0000 (12:00 +0200)] 
mam: add sd_bus_track_handler_t signature to manpage (#39204)

This is consistent with how the other handler/callback types are
documented.

(cherry picked from commit fc890aedd3176e2c7fe465b268218aca30b006cd)

4 weeks agoman/sd-login: minor grammar updates
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2025 16:36:39 +0000 (18:36 +0200)] 
man/sd-login: minor grammar updates

(cherry picked from commit 60597825ef87e53cb4b530888fcfe78a2a090da0)

4 weeks agoman: fix advice regarding thread safety of libsystemd
Zbigniew Jędrzejewski-Szmek [Fri, 3 Oct 2025 11:17:32 +0000 (13:17 +0200)] 
man: fix advice regarding thread safety of libsystemd

The prohibition to move libsystemd objects between threads was added in
64a7ef8bc06b5dcfcd9f99ea10a43bde75c4370f ('man: be more explicit about thread
safety of sd_journal'). At the time, this was valid, because we were using the
mempool for allocation and it apparently didn't handle access from different
threads. Sadlly, the commit links to a bugzilla entry referenced in the commit
is not publicly visible anymore, so the details are murky. But we stopped using
the mempool in a5d8835c78112206bbf0812dd4cb471f803bfe88 ('mempool: only enable
mempool use when linked to libsystemd-shared.so'), with subsequent followup in
b01f31954f1c7c4601925173ae2638b572224e9a ('Turn mempool_enabled() into a weak
symbol'). The restriction added in the man page is not necessary since then.

The text in the man page was arguably incorrect in calling the code
"thread-agnostic". If the code does not support being touched from threads at
all and has global state to tied to the main thread, it is not "agnostic", but
just doesn't support threads.

(I'm looking into https://github.com/systemd/python-systemd/issues/143, and
with the current scheme, the python-systemd module and all python code using
libsystemd would be very hard to use. With the change to free-threaded python
in python3.13, i.e. the replacement of single Global Interpreter Lock by
locking on individual objects, this limitation would become even more
constraining.)

(cherry picked from commit 4a3620c55a83317dc397f840bffe445a2ab1c038)

4 weeks agoman: document --prompt-new-user which was added back in v256
Lennart Poettering [Fri, 26 Sep 2025 14:09:02 +0000 (16:09 +0200)] 
man: document --prompt-new-user which was added back in v256

(cherry picked from commit 6f496236bc3241a9aa191d9e084f566771286d3a)

4 weeks agobash-completion: update systemd-sysext, systemd-confext
Pascal Bachor [Fri, 26 Sep 2025 18:20:49 +0000 (20:20 +0200)] 
bash-completion: update systemd-sysext, systemd-confext

(cherry picked from commit 9b5f1a61121b5757f8b5b2f5a8afb29d1ddab172)

4 weeks agodocs(boot): fix typo in code block
Le_Futuriste [Fri, 26 Sep 2025 14:41:19 +0000 (16:41 +0200)] 
docs(boot): fix typo in code block

(cherry picked from commit 83b5dabb40e5f2533d38fa3e7da212287f717174)

4 weeks agoTEST-64-UDEV-STORAGE: do not use -f/--force option for wipefs
Yu Watanabe [Sun, 31 Aug 2025 00:30:22 +0000 (09:30 +0900)] 
TEST-64-UDEV-STORAGE: do not use -f/--force option for wipefs

When -f/--force is used, wipefs does not call ioctl(BLKRRPART), hence
the partitions will remain in sysfs. Let's not use the option.

This also makes it use 'udevadm lock' for safety.

(cherry picked from commit 0f8706915a5a8aae4791e09af12f81386ec9cc35)

4 weeks agopam_systemd: downgrade OSC sequence writing at close to LOG_DEBUG
Lennart Poettering [Fri, 26 Sep 2025 10:30:54 +0000 (12:30 +0200)] 
pam_systemd: downgrade OSC sequence writing at close to LOG_DEBUG

Fixes: #39135
(cherry picked from commit cd8a1a8ef7a4eade1d11e28ccbb2fcd8f39b3f04)

4 weeks agonetwork-generator: ip: do not fail on ntp value
Sebastian Gross [Fri, 26 Sep 2025 09:14:30 +0000 (11:14 +0200)] 
network-generator: ip: do not fail on ntp value

linux https://www.kernel.org/doc/html/latest/admin-guide/nfs/nfsroot.html
states `ntp0-ip` as parameter to `ip=` command line.

Until now systemd-network-generator would fail if ntp was provided with
-EINVAL due to trailing arguments.

Stay in line with kernel doc and handle ntp value properly.

(cherry picked from commit 582a1e187701b02ab3ed948dc452f1387848c788)

4 weeks agonetworkd: fia xRequiredOperationalStateForOnline serializtion
Anton Tiurin [Mon, 15 Sep 2025 19:32:39 +0000 (12:32 -0700)] 
networkd: fia xRequiredOperationalStateForOnline serializtion

In integration tests (for example TEST-85-NETWORK-NetworkctlTests)

LINK_OPERSTATE_RANGE_INVALID and required_for_online == -1 are serialized as
```
"RequiredForOnline": "true",
"RequiredOperationalStateForOnline": [null, null]
```
Such link should be reported as required_for_online=False and not
serialize nulls.

(cherry picked from commit 59d946ee6b3612ef2fd646055e39282b0e0189ff)

4 weeks agonetworkctl: change bitrate format from 'bps' to 'Bps'
Anton Tiurin [Tue, 16 Sep 2025 20:58:56 +0000 (21:58 +0100)] 
networkctl: change bitrate format from 'bps' to 'Bps'

(cherry picked from commit 9893859beb0de2d04d5e7c8f64412981a3f964a3)

4 weeks agoosc-context: fix typo: 8003 -> 3008
Yu Watanabe [Thu, 25 Sep 2025 17:16:17 +0000 (02:16 +0900)] 
osc-context: fix typo: 8003 -> 3008

Follow-up for dadbb34919abd3fefeb5b8ccc9794da9398a2503 (v258).

(cherry picked from commit 3b6288f6becf0e55da6de9ff55e824c2ada93f2c)

4 weeks agomachined: do not allow unprivileged users to shell into the root namespace
Luca Boccassi [Wed, 24 Sep 2025 14:42:51 +0000 (15:42 +0100)] 
machined: do not allow unprivileged users to shell into the root namespace

We intend to make self-registering machines an unprivileged operation,
but currently that would allow an unprivileged user to register a
process they own in the root namespace, and then login as any
user they like, including root, which is not ideal.

Forbid non-root from shelling into a machine that is running in
the root user namespace.

(cherry picked from commit c5e48e3a66b23313cd4931b9dc25a8f48cfb1035)

4 weeks agoresolve: undo change to return code of next_search_domain() (#39119)
Mantas Mikulėnas [Thu, 25 Sep 2025 19:52:18 +0000 (22:52 +0300)] 
resolve: undo change to return code of next_search_domain() (#39119)

This caused resolved to only consider the 1st search domain of every
interface and ignore the rest.

Fixes a regression caused by 81ae2237c1792943a1ec712ae2e630bcc592175b (v258).
Fixes #39118.

(cherry picked from commit 6cae201ca1b0bf4a136bdf1002b4bc7983f0ceee)

4 weeks agoman: Add missing parentheses
Daan De Meyer [Wed, 24 Sep 2025 14:30:02 +0000 (16:30 +0200)] 
man: Add missing parentheses

(cherry picked from commit 938442ac27d3ec2d076b59bf8bc1150a4fab9201)

4 weeks agomachine: fix wrong field name in varlink IDL
Yu Watanabe [Wed, 24 Sep 2025 12:46:51 +0000 (21:46 +0900)] 
machine: fix wrong field name in varlink IDL

Follow-up for d5feeb373cc13d96fa66967a6bdb7461df32c920 (v258).

(cherry picked from commit faa3cc29740e8523f40f9a7ddbafa7780451edd0)

4 weeks agoboot: check protocol version before assuming GetActiveBanks() exists
Lennart Poettering [Tue, 23 Sep 2025 11:42:02 +0000 (13:42 +0200)] 
boot: check protocol version before assuming GetActiveBanks() exists

Alternative to: #39034
Fixes: #38932
Follow-up to: 6eab4cd44c3c43698dcfc2c3bc8cd31ed610a812

(cherry picked from commit b388fa20c735add38080a746fd831273820c93ac)

4 weeks agomeasure: strip tpm 1.x remnants
Lennart Poettering [Tue, 23 Sep 2025 11:18:56 +0000 (13:18 +0200)] 
measure: strip tpm 1.x remnants

Let's never bother with old TPM 1.x structures, they are not mentioned
in the TCG for TPM2 spec at all. However, the spec does say we should
check the Size field of the relevant structs, before accessing them,
hence do that.

(cherry picked from commit 496489c2a70b1675af679c1d33cee035fe7c9aff)

4 weeks agofs-util: prefer glibc's fchmodat() if possible
Luca Boccassi [Tue, 23 Sep 2025 22:13:23 +0000 (23:13 +0100)] 
fs-util: prefer glibc's fchmodat() if possible

Since v2.39 glibc's fchmodat() will call into the kernel's fchmodat2()
if flags are passed:

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=65341f7bbea824d2ff9d37db15d8be162df42bd3;hp=c52c2c32db15aba8bbe1a0b4d3235f97d9c1a525

On older versions, if the flag is anything other than AT_SYMLINK_NOFOLLOW,
it returns EINVAL, so we can detect it and call the kernel syscall directly
ourselves.

Using the glibc wrappers when possible is prefereable so that programs
like fakeroot can intercept its calls and redirect them.

Follow-up for adecfb3bc0be0def49433277fcad5333893756cc

(cherry picked from commit 696b1263dc78858f96345a366933c66d53ae4899)

4 weeks agoFix sd_bus_can_send signature in manpage
Joshua Krusell [Tue, 23 Sep 2025 09:21:51 +0000 (11:21 +0200)] 
Fix sd_bus_can_send signature in manpage

(cherry picked from commit e216876fc6b12a9153fb94f089bab7b41b50c19b)

4 weeks agojournal: make JournalConfig.set_audit as enum
Yu Watanabe [Mon, 22 Sep 2025 06:22:48 +0000 (15:22 +0900)] 
journal: make JournalConfig.set_audit as enum

In systemd <= 257, each set_audit tristate value had special meaning,
- true: enable the kernel audit subsystem,
- false: disable the kernel audit subsystem,
- negative: keep the current kernel audit subsystem state.

And the default is true, rather than negative. So, users sometimes
explicitly pass an empty string to Audit= setting to keep the state.

But since f48cf2a96dfdc23fe30ba0f870125fe55cab64c7 (v258), the negative
value is mistakenly used as 'really unspecified' even if an empty string
is explicitly specified.

This makes negative values handled as unspecified as usual, and assign a new
positive value AUDIT_KEEP for when an empty string is explicitly specified.
Also, make the Audit= setting accept "keep" setting, and suggest to use "keep"
rather than an empty string.

Fixes a regression caused by f48cf2a96dfdc23fe30ba0f870125fe55cab64c7 (v258).
Fixes #39057.

(cherry picked from commit b5fdfedf729712b9824a5cb457a07d5699d2946c)

4 weeks agojournal: add missing initialization
Yu Watanabe [Mon, 22 Sep 2025 06:52:04 +0000 (15:52 +0900)] 
journal: add missing initialization

Otherwise, SplitMode= in journald.conf is always ignored.

Fixes a regression caused by f48cf2a96dfdc23fe30ba0f870125fe55cab64c7 (v258).
Fixes #39046.

(cherry picked from commit adacdfd9d657a649251e341423602ff44a65bee2)

4 weeks agotree-wide: Fix two curl warnings
Daan De Meyer [Fri, 19 Sep 2025 09:29:36 +0000 (11:29 +0200)] 
tree-wide: Fix two curl warnings

(cherry picked from commit 1403faeb152e24ef74230891cc6bf1875292324f)

4 weeks agovirt: revert to detect chroot by comparing with / rather than /proc/PID/root
Mike Yuan [Thu, 18 Sep 2025 23:16:19 +0000 (01:16 +0200)] 
virt: revert to detect chroot by comparing with / rather than /proc/PID/root

This partially reverts d6267b9b18a30c81dd3335230ef71af04e1ea330

So, arch-chroot currently uses a rather cursed setup:
it sets up a PID namespace, but mounts /proc/ from the outside
into the chroot tree, and then call chroot(2), essentially
making it somewhere between chroot(8) and a full-blown
container. Hence, the PID dirs in /proc/ reveal the outer world.
The offending commit switched chroot detection to compare
/proc/1/root and /proc/OUR_PID/root, exhibiting the faulty behavior
where the mentioned environment now gets deemed to be non-chroot.

Now, this is very much an issue in arch-chroot. However,
if /proc/ is to be properly associated with the pidns,
then we'd treat it as a container and no longer a chroot.
Also, the previous logic feels more readable and more
honestly reported errors in proc_mounted(). Hence I opted
for reverting the change here. Still note that the culprit
(once again :/) lies in the arch-chroot's pidns impl, not
systemd.

Fixes https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/issues/54

(cherry picked from commit 01184496a2b518f33c56b5803549f27fa8f226fe)

4 weeks agoTEST-81-GENERATORS: libmount disallows omitting fstype
Mike Yuan [Thu, 18 Sep 2025 18:21:29 +0000 (20:21 +0200)] 
TEST-81-GENERATORS: libmount disallows omitting fstype

It's not well-formed to begin with. And util-linux's mount(8)
is pretty much ubiquitously employed, hence it will be rejected
elsewhere too. Just stop pretending it is valid just because
glibc parser is sloppy.

(cherry picked from commit afba4d4387bb02370a58aeaf6ae537a591a5d9cd)

4 weeks agocreds-util: don't reference superblocks when decrypting creds
Lennart Poettering [Thu, 18 Sep 2025 06:44:02 +0000 (08:44 +0200)] 
creds-util: don't reference superblocks when decrypting creds

(cherry picked from commit 7d4b0df9f8955f5f36df86655c305ec2cdcd9a5e)