Commit Graph

84143 Commits

Author SHA1 Message Date
Daan De Meyer
cc814110af 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.
2025-10-17 21:11:23 +09:00
Mike Yuan
28aa0a1f25 core/mount: properly handle REMOUNTING_* states in mount_stop() (#39269) 2025-10-16 20:50:03 +02:00
Matteo Croce
e1e16b4763 core: fix build error due to merge conflict in varlink-execute.h
During last refactor, an include wasn't changed and led to a build
error.

Follow-up for fdb2c0dd6f
2025-10-16 19:47:40 +01:00
Luca Boccassi
c92b14ec13 dissect: add support for verity-protected bare filesystems via mountfsd (#39325)
Needed to implement support for RootHashSignature=/RootVerity=/RootHash=
and friends when going through mountfsd, for example with user units,
so that system and user units provide the same features at the same
level
2025-10-16 19:43:45 +01:00
Zbigniew Jędrzejewski-Szmek
48aec295a8 test/parse_hwdb: wrap Or inside an And in a Group
I now get a warning like this with python3-pyparsing-3.1.2-8.fc42:

hwdb.d/parse_hwdb.py:208: UserWarning: warn_multiple_tokens_in_named_alternation:
  setting results name 'VALUE' on Or expression will return a list of all parsed
  tokens in an And alternative, in prior versions only the first token was returned;
  enclose contained argument in Group
('!' ^ (Optional('!') - Word(alphanums + '_')))('VALUE')
2025-10-16 18:09:37 +01:00
Daan De Meyer
06d73c5046 implement ExecContext for io.systemd.Unit.List (#38212) 2025-10-16 19:06:46 +02:00
Lennart Poettering
b0c6d129a5 two small varlink additions (#39323)
Split out of #39293, but make a ton of sense on their own.
2025-10-16 17:42:57 +02:00
Lennart Poettering
0aad728daa kmod-setup: don't load unix.ko as a module anymore
Building unix.ko as a module always has been a really bad idea, from day
1. Debian used to do this, but has long been fixed. Kernel developers
saw the light too, and removed support for it in 6.5
(97154bcf4d1b7cabefec8a72cff5fbb91d5afb7b). Let's hence drop support for
this here too, and delete some old cruft. AF_UNIX is simply our most
basic IPC system and supporting systems without it being around is just
not realistic.
2025-10-16 17:42:33 +02:00
Luca Boccassi
bc019f7c06 test: add coverage for image policy and bare filesystems with verity 2025-10-16 16:22:33 +01:00
Luca Boccassi
fad01f798d dissect: add support for verity-protected bare filesystems via mountfsd
Needed to implement support for RootHashSignature=/RootVerity=/RootHash=
and friends when going through mountfsd, for example with user units,
so that system and user units provide the same features at the same
level
2025-10-16 16:22:33 +01:00
Luca Boccassi
674b4b4f96 mountfsd: add support for verity-protected bare filesystems
Add optional varlink parameters to pass in verity data/roothash/sig
2025-10-16 16:22:33 +01:00
Luca Boccassi
26bf1b9e85 json: add json_dispatch_unhex_iovec helper 2025-10-16 16:22:33 +01:00
Govind Venugopal
48c64813ec varlink: omit empty parameters field in JSON messages (#38922)
When varlink parameters are empty, omit the "parameters" field entirely
rather than sending "parameters":{}. This reduces message size and
follows varlink specification which allows parameters to be omitted.

The implementation supports three equivalent representations for empty
parameters: field omission, JSON null, and empty object {}. All three
are accepted on input for backward compatibility.

Fixes: #38474
2025-10-16 17:06:17 +02:00
Daan De Meyer
f102bc3e5f tree-wide: Introduce sd-forward.h and shared-forward.h headers
Let's not leak details from src/shared and src/libsystemd into
src/basic, even though you can't actually do anything useful with
just forward declarations from src/shared.

The sd-forward.h header is put in src/libsystemd/sd-common as we
don't have a directory for shared internal headers for libsystemd
yet.

Let's also rename forward.h to basic-forward.h to keep things
self-explanatory.
2025-10-16 17:00:29 +02:00
Luca Boccassi
5e97d50e17 dissect: fix image policy check for bare dm-verity filesystem
The root_hash_sig pointer might be set, but to an empty iovec. Check
that the length is > 0 instead.

Follow-up for cd22d8562d
2025-10-16 15:50:45 +01:00
Luca Boccassi
39175477bd mkosi: provide detached verity signatures too for minimal images
Useful for manual testing in the VM
2025-10-16 15:50:45 +01:00
Luca Boccassi
ac9391c552 Support ExtensionImages=/MountImages= in user services via mountfsd and PrivateUsers=yes (#39341) 2025-10-16 15:49:46 +01:00
Lennart Poettering
78a135f567 varlink: move definition of varlink_hash_ops into common code
This is truly useful whenever we have to deal with multiple varlink
connections.
2025-10-16 16:24:29 +02:00
Lennart Poettering
73740ca2fc sd-varlink: add sd_varlink_is_connected() 2025-10-16 16:24:29 +02:00
Luca Boccassi
68b476a298 core: also enable PrivateUsers= for user services when using images via mountfsd
RootDirectory= and other options already implicitly enable PrivateUsers=
since 6ef721cbc7 if they are set in user
units, so that they can work out of the box.
Now with mountfsd support we can do the same for the images settings,
so enable them and document them.
2025-10-16 12:58:59 +01:00
Luca Boccassi
29e97643e7 Support ExtensionImages=/MountImages= in user services via mountfsd
Support for RootImage= was added by 046a1487db
but it was not wired in for ExtensionImages=/MountImages=
2025-10-16 12:58:59 +01:00
Luca Boccassi
1ebbb0b0f4 test: add coverage for RootImage= in user units
Follow-up for 046a1487db
2025-10-16 12:58:55 +01:00
Daan De Meyer
f875a8026e core: Don't use TTYPath= for PAM unless StandardInput=tty
Fixes #39334
2025-10-16 13:46:19 +02:00
Zbigniew Jędrzejewski-Szmek
6c80ab85f5 core/cgroup: two follow-ups for recent OOMKills PR (#39215)
Follow-ups for #38906.
2025-10-16 13:38:01 +02:00
Ivan Kruglov
55eccf3b0d core: add comments in varlink-io.systemd.Unit.c 2025-10-16 03:52:08 -07:00
Ivan Kruglov
fdb2c0dd6f core: ExecContext for io.systemd.Unit.List method 2025-10-16 03:52:08 -07:00
Ivan Kruglov
3064c04473 core: exec_log_level_max_with_exec_params() 2025-10-16 03:52:08 -07:00
Ivan Kruglov
fbfc439438 core: move cpuset_build_json() to varlink-common 2025-10-16 03:52:02 -07:00
Frantisek Sumsal
92631f1962 test: wait for signed.test's zone DS records to get pushed to the parent zone
It looks like the 4 second sleep might not be enough on some slower
machines (like the ARM GH Actions nodes) which can lead to the DS RRs
propagation to clash with the manual test zone edit, and the
signed.test zone then might end up not properly signed:

TEST-75-RESOLVED.sh[749]: + : '--- ZONE: signed.test (static DNSSEC) ---'
TEST-75-RESOLVED.sh[749]: + run_delv @ns1.unsigned.test signed.test
TEST-75-RESOLVED.sh[749]: + run delv -a /etc/bind.keys @ns1.unsigned.test signed.test
TEST-75-RESOLVED.sh[778]: + delv -a /etc/bind.keys @ns1.unsigned.test signed.test
TEST-75-RESOLVED.sh[779]: + tee /tmp/tmp.2KOIiyrgth
TEST-75-RESOLVED.sh[779]: ;; /etc/bind.keys:1: option 'managed-keys' is deprecated
TEST-75-RESOLVED.sh[779]: ;; validating signed.test/DS: no valid signature found
TEST-75-RESOLVED.sh[779]: ;; validating signed.test/A: no valid signature found
TEST-75-RESOLVED.sh[779]: ; unsigned answer
TEST-75-RESOLVED.sh[779]: signed.test.		86400	IN	A	10.0.0.10
TEST-75-RESOLVED.sh[779]: signed.test.		86400	IN	RRSIG	A 13 2 86400 20251028114356 20251014101356 39330 signed.test. oo3ca8WPusbBPRhzsEKw3bsBBqFtI8i4bckoMVNzt7lY+udGW6PlaSYj OjpQGgY9oglowVM9bteNtwJKHUbvtw==
TEST-75-RESOLVED.sh[749]: + grep -qF '; fully validated' /tmp/tmp.2KOIiyrgth
[FAILED] Failed to start TEST-75-RESOLVED.service - TEST-75-RESOLVED.

Let's explicitly wait for the DS records propagation to finish before we
start editing the test zone to avoid this.

I'm still not completely sure if this is the root cause, but it's the
best shot I currently have, so I'll let the CIs decide.
2025-10-16 11:51:03 +01:00
Antonio Alvarez Feijoo
b8ad88a407 meson: fix HAVE_LIBARCHIVE_* conditions
Follow-up for a7c8f92d1f
2025-10-16 11:48:53 +01:00
Ivan Kruglov
3de607b48b basic: secure_bits_to_strv() 2025-10-16 03:29:14 -07:00
Ivan Kruglov
115083886a nsflags: namespace_flags_to_strv() 2025-10-16 03:26:39 -07:00
Zbigniew Jędrzejewski-Szmek
f0562fc819 test: minor fixlets for TEST-50-DISSECT (#39328) 2025-10-16 12:25:41 +02:00
Daan De Meyer
73623f1984 core: Make sure we don't clobber return argument on failure
As documented in the coding style, let's make sure we follow it.
2025-10-16 11:06:43 +01:00
Daan De Meyer
e8a0463c16 test: fixes for debian unstable and TEST-50-DISSECT (#39331)
Test failed in a weird way, turns out we don't use pipefail and an
intermediate command was moved to a different package so it wasn't in
the minimal image anymore. Add it, and use pipefail so in the future
it's easier to spot.
2025-10-16 08:45:46 +02:00
Zbigniew Jędrzejewski-Szmek
1929f43199 test-tar-extract: add a binary wrapping tar_x() for manual testing
We'll probably want to turn this into a test in the integration tests.
2025-10-16 08:22:33 +02:00
Luca Boccassi
0ce88a9132 test: call bash with -o pipefail when piping commands in TEST-50-DISSECT
We want the tests to fail if one of the intermediate commands fails,
otherwise it is hard to spot failures
2025-10-15 22:58:19 +01:00
Luca Boccassi
2a5e68e27d test: install bsdextrautils in debian minimal img
'rev' moved to bsdextrautils and TEST-50-DISSECT uses it, so it now
fails:

[   83.534905] bash[3581]: +++ grep '^now' /proc/timer_list
[   83.535479] bash[3582]: +++ cut '-d ' -f3
[   83.535774] bash[3583]: +++ rev
[   83.535774] bash[3583]: bash: line 1: rev: command not found
2025-10-15 22:54:51 +01:00
Luca Boccassi
c581bc8ad8 test: sign extension images used by TEST-50-DISSECT 2025-10-15 19:39:21 +01:00
Luca Boccassi
dc88805d16 test: also test verity signatures on debian testing/unstable
debian testing/unstable do not set VERSION_ID, so if missing, assume
it's testing/unstable which are new enough
2025-10-15 19:39:21 +01:00
Ivan Kruglov
0033d937c7 json: helper macro JSON_BUILD_PAIR_YES_NO() 2025-10-15 09:14:10 -07:00
Ivan Kruglov
aacfa999dd json: helper macros JSON_BUILD_PAIR_CONDITION_*() 2025-10-15 09:14:10 -07:00
Zbigniew Jędrzejewski-Szmek
53ff5b361f core: Delete redundant log_parse_environment(), v2 (#39278)
Reworked version of #39175.
2025-10-15 17:50:59 +02:00
Luca Boccassi
e8d1a26d9c test: move checks around in TEST-50-DISSECT so that they can be used from multiple subtests
Also set it up so that unprivileged tests can be done
2025-10-15 15:29:14 +01:00
huyubiao
8f2c5dea63 core: delete redundant log_parse_environment()
Fixes https://github.com/systemd/systemd/issues/38895.

Fix the confusing behavior where when an incorrect configuration item such as
'ManagerEnvironment=SYSTEMD_LOG_LEVEL=' is set, the first daemon-reload uses
old environment variables while the second daemon-reload uses LogLevel=.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>

The difference in behaviour is that the operations that were done between the
first log_parse_environment() and the second one might not be logged now, e.g.
if the environment enabled debug logging. That is unfortunate, but parsing the
environment twice and not having the explicit configuration take effect until a
second daemon-reload is confusing. We will always have some window where the
configuration for logging does not apply, in particular this must be true when
parsing the logging configuration. To make that window smaller, move operations
that could log after the call to log_parse_environment() as far as possible.
2025-10-15 14:00:45 +02:00
Zbigniew Jędrzejewski-Szmek
938f7fea7c 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.
2025-10-15 14:00:40 +02:00
Luca Boccassi
de2276cdcd Revert "machine: restrict register-machine action again"
Now that we have landed several fixes, this should be safe to do
again, so allow logged in users to register machines without
authentication prompts

This reverts commit 65badde82e.
2025-10-15 12:02:34 +02:00
Luca Boccassi
9dd61cfbe7 Use verity sharing for user services and nspawn too (#39313)
https://github.com/systemd/systemd/pull/39168 made verity sharing
opt-in, and enabled it for system services.
Also enable it for user services for RootImage/etc, and for nspawn, for
the same reasons.
2025-10-15 11:01:57 +01:00
Govind Venugopal
3eb7b881bd network: add DHCP server domain name option support (#39260)
Implements DHCP option 15 (Domain Name) for systemd-networkd's DHCP
server, allowing administrators to configure the DNS default domain that
clients should use.

This addresses the feature request in issue #37077, where users needed
to manually configure domain names using
SendOption=15:string:example.com as a workaround.

This adds two new configuration options to the [DHCPServer] section:
- EmitDomain= (boolean): whether to send domain name to clients
- Domain= (string): the domain name to send (e.g., "example.com")

Example configuration:
  [DHCPServer] EmitDomain=yes Domain=example.com

This eliminates the need for manual workarounds using
SendOption=15:string:...

Fixes #37077
2025-10-15 11:20:41 +02:00
Lennart Poettering
4cae0e9a78 importd: change untar logic to be based on libarchive rather than shelling out to gnu tar (#39143)
Let's use libarchive consistently everywhere, both for tarring and
untarring.

Note that there's an existing test case that validates untarring. Now,
it will validate libarchive rather than gnu tar.

Split out of #38728
2025-10-15 11:12:23 +02:00