Commit Graph
85796 Commits
Author SHA1 Message Date
Mike Yuan 2f7fdef55e install-file: add a generalized parser for $SOURCE_DATE_EPOCH 2026-01-20 15:54:55 +01:00
Yu Watanabe e6a25c2fc7 stat-util: make proc_mounted() not update errno
Typically, proc_mounted() is used in error handling. Hence, it is better
to make it not update the original errno.

Currently, there are two places that returns wrong error code:
- pidref_get_capability() in src/basic/capability-util.c
```c
        _cleanup_fclose_ FILE *f = fopen(path, "re");
        if (!f) {
                if (errno == ENOENT && proc_mounted() == 0)
                        return -ENOSYS;

                return -errno;
        }
```
- fdset_new_fill() in src/shared/fdset.c
```c
        d = opendir("/proc/self/fd");
        if (!d) {
                if (errno == ENOENT && proc_mounted() == 0)
                        return -ENOSYS;

                return -errno;
        }
```

Rather than fixing them, let's make proc_mounted() not update errno,
otherwise we may make a similar failure in a future.
2026-01-20 22:37:04 +09:00
Mike Yuan e41d7de091 core/dbus-execute: fix memleak on Mount/ExtensionImages parse failure (#40398) 2026-01-20 03:10:34 +01:00
Mike Yuan ae039016f4 bless-boot-generator: skip if current system is entered via soft-reboot
Fixes #40386
2026-01-20 11:09:27 +09:00
Yu Watanabe 9503cc3b6d resolve: include current DNS server in JSON again (#40396)
Fixes a regression caused by c6b6ac63ea.
2026-01-20 09:41:51 +09:00
Mike Yuan f0f66976e7 core/dbus-execute: use strextendf_with_separator() where appropriate 2026-01-19 23:30:58 +01:00
Mike Yuan 00f459f30f core/dbus-execute: fix memleak on Mount/ExtensionImages parse failure
Define mount_image_free_many() in our usual fashion for use in
CLEANUP_ARRAY and ensure proper cleanup on error paths.
2026-01-19 23:22:32 +01:00
safforddr 331fef07d8 tpm2: allow use of recoverable sealing keys
In some use cases it is desirable to use a recoverable (ie duplicatable)
sealing key. Currently objects have the attribute TPMA_OBJECT_FIXEDTPM
and TPMA_OBJECT_FIXEDPARENT hard coded, which will not work with a
recoverable sealing key. This patch sets the object's attributes from
the sealing key's attributes, so that both types of sealing keys will work.
2026-01-19 22:00:45 +01:00
Lennart Poettering 9316e02c9d Introduce 'fixate-volume-key' option to repart/cryptsetup to pin the exact LUKS volume key hash (#40343)
Add an option to generate the expected volume key hash for LUKS volumes
by systemd-repart
and put it to crypttab, make systemd-cryptsetup check it upon attaching.
The format of the hash
matches what's currently being measured to TPM2 PCR with
tpm2-measure-pcr=.

Closes #40123
2026-01-19 21:59:47 +01:00
Lennart Poettering 3a0ddbe338 core: follow-ups for changes to MountOptions (#40395)
Follow-up for #39449
2026-01-19 21:59:19 +01:00
Lennart Poettering 799392286e sd-varlink: ensure that "any" actually means "any but null"
The new "any" type was implemented by accident that it actually meant
"any but null" – unless marked as "any?" in which case it actually meant
truly any, including null. The spec change in
https://github.com/varlink/varlink.github.io/pull/43 otoh suggested that
"any" really means anything, and "any?" apparently too.

I think the implementation in code makes more sense than the spec change
however, hence let's add some checks/tests to ensure the behaviour of
the code is made explicitly and cared for.

I will prep a spec change to make the spec follow the code on this too.

Follow-up for: #39918
2026-01-19 21:29:38 +01:00
Nick Rosbrook e06ee11150 test: check that currentServer field is set in resolvectl JSON status 2026-01-19 13:48:07 -05:00
Nick Rosbrook d990b426b9 resolve: include current DNS server in JSON again
The current_dns_server_json object in dns_configuration_json_append() is
always NULL, because the logic to dump the current DNS server to JSON
was removed by mistake in a re-factoring commit. Add that logic back.

Fixes c6b6ac63ea ("resolve: drop unnecessary preparation of empty arrays").
2026-01-19 13:29:52 -05:00
Yu Watanabe 8a5fb3627a vmspawn: use indexed loop
Previously, the index is obtained from the pointer offset. The
pointer offset is expressed by ptrdiff_t and may be different from
ssize_t.

Let's avoid to use FOREACH_ARRAY() but use an indexed loop.
This also renames `mount` to `m` to avoid conflict with `mount()`.

Fixes #40380.
2026-01-20 02:26:35 +09:00
Vitaly Kuznetsov 398acccb2a TEST-58-REPART: Add a test for fixate_folume_key
The test checks that the expected hash is correctly recorded to the
generated crypttab and also checks that systemd-cryptsetup handles
the option correctly.
2026-01-19 17:50:25 +01:00
Vitaly Kuznetsov 4754289ddf repart: Add fixate_volume_key crypttab option generation
Add an option to capture the expected LUKS volume key hash and
record it to the generated crypttab.
2026-01-19 17:50:25 +01:00
Vitaly Kuznetsov 69fab29ec4 cryptsetup: Add fixate-volume-key option to pin the expected volume key hash
The expected hash (SHA265 HMAC signature) uses the exact same algorithm which
is used to calculate sha256 PCR bank digest when 'tpm2-measure-pcr=' is used.
2026-01-19 17:49:39 +01:00
Mike Yuan e1388041c0 core/dbus-util: several cleanups for bus_read_mount_options()
* Make sure ret_options is initialized on success.
* Return empty mount options as-is rather than NULL-ing it -
  dbus property parser for RootImageOptions relies on it
  for resetting options for a specific partition designator.
* Format partition:options properly with strextendf, currently
  multiple ":" will be emitted.
* Allow separator to be unset if in_out_format_str is not
  needed.
2026-01-19 17:49:29 +01:00
Mike Yuan 079be1e71b core/varlink-execute: skip empty mount options
This keeps things in line with bus_append_mount_options().
2026-01-19 17:35:38 +01:00
Mike Yuan 831eb5453a core/dbus-execute: constify MountOptions 2026-01-19 17:35:37 +01:00
Mike Yuan bdfa039404 dissect-image: use consistent log level 2026-01-19 17:35:37 +01:00
Yu Watanabe 3d2284c7db journal/audit: do not use strjoina() for arbitrary length of received string
Otherwise, when a long message is received, the assertion in strjoina()
may be triggered.

Fixes oss-fuzz#476768320 (https://issues.oss-fuzz.com/issues/476768320).
Fixes #40388.
2026-01-20 01:29:32 +09:00
Luca Boccassi 2ba15493af portable: pin attached image via image-policy (#40152)
When attaching images generate a policy in the portable drop-in that
matches the partition types and content found while dissecting, so that
it can no longer be changed later without a reattach
2026-01-19 16:24:44 +00:00
Yu Watanabe 1580907953 audit-type: include alloc-util.h for newa() (#40389)
The macro audit_type_name_alloca() needs newa() which is defined in
alloc-util.h.
2026-01-19 16:31:39 +01:00
Yu Watanabe b7dd507cae tree-wide: use consistent format of short comment for constant argument
Follow-ups for recent changes after 93378148d4.
2026-01-20 00:22:15 +09:00
Luca Boccassi d059615492 portable: pin attached image via image-policy
When attaching images generate a policy in the portable drop-in
that matches the partition types and content found while dissecting,
so that it can no longer be changed later without a reattach.
2026-01-19 15:54:12 +01:00
Luca Boccassi 2258c93270 image-policy: add helper to create policy from dissected image
Pin policies to exactly what was found while dissecting
2026-01-19 15:47:15 +01:00
Luca Boccassi f639fb4b77 image-policy: add image_policy_union helper
Similar to image_policy_intersect but is the union of all used policies
instead
2026-01-19 15:47:15 +01:00
Yu Watanabe 67040ea2bc More legacy kernel support removal; follow-ups for XAT_FDROOT (#40384) 2026-01-19 23:10:17 +09:00
zefr0x 985a6fa44b busctl: handle --limit-messages option under the wait verb
Main focus was to not introduce breaking change or duplicated argument.
The `--limit-messages=` option that is used under the `monitor` verb is
reused here. However, both `wait` and `monitor` have contradicting
default behaviors, so it's not the cleanest thing to do.

There was some post-commit discussion about the API in #33961, but the
final name adopted in #34928 wasn't that flexible either to fit nicely
here in the `wait` verbe.

Additionally, there wasn't consideration in #34555 for having uniform
behavrious, so we ended with `wait` verb and `--limit-messages=` option,
rather than `receive` verb with default of continuously receving signals
withtout exit so `--limit-messages=` make more sence and be expectable.
2026-01-19 22:41:33 +09:00
Vitaly Kuznetsov f99f843f24 tpm2-util: make tpm2_pcr_extend_bytes() declaration match its implementation
tpm2_pcr_extend_bytes() has differences in parameter names between the
declaration and the implementation, in particular, 'event' in the header is
named 'event_type' in the implementation.
2026-01-19 13:52:33 +01:00
Mike Yuan 1a0df07843 core/cgroup: obsolete DefaultMemoryMin/Low=
Now that our kernel baseline is v5.7 and memory_recursiveprot
is universally enabled, remove userspace workarounds.
2026-01-19 13:33:28 +01:00
Mike Yuan d57fdbb5e2 core/cgroup: do not consider cgroup_context_has_io_config() if only IOAccounting=yes
This makes things in line with unit_has_memory_config(),
and suppresses pointless application of IO configs.
2026-01-19 13:33:28 +01:00
Mike Yuan 8292b859f3 core/cgroup: drop trusted.survive_final_kill_signal fallback for kernel < 5.7 2026-01-19 13:33:28 +01:00
Mike Yuan 6fd7c5ecdf core/namespace: remove availability checks for procfs hidepid=/subset= opts 2026-01-19 13:33:27 +01:00
Mike Yuan 5f90e4e4bc stat-util: O_NOCTTY is nop with O_PATH 2026-01-19 13:33:27 +01:00
Mike Yuan b0906b1216 stat-util: do not use RET_NERRNO for our own function
Follow-up for 95abe4beff
2026-01-19 13:33:27 +01:00
Mike Yuan 02bf2b7cdf fs-util: optimize xopenat(XAT_FDROOT, ...) a bit
Follow-up for ef582ab201

* Open / with O_PATH
* Shortcut to fd_reopen() directly if path is empty
2026-01-19 13:33:27 +01:00
Mike Yuan 9b906ae48e fs-util: group access_fd() with access_nofollow() 2026-01-19 13:33:27 +01:00
Mike Yuan 52bf232e82 fs-util: drop fallback for kernels without AT_EMPTY_PATH support (< 5.8) 2026-01-19 13:33:26 +01:00
Mike Yuan 6753bd8a2f mountpoint-util: assume MS_NOSYMFOLLOW is available
Since our kernel baseline is v5.10 now.
2026-01-19 13:33:26 +01:00
Mike Yuan 58fb46ecd5 firewall-util: drop fallback for kernel < 5.8 2026-01-19 12:51:56 +01:00
Mike Yuan 42b09813f4 netlink-util: remove support for kernel < 5.5 2026-01-19 12:51:56 +01:00
Mike Yuan 742308caba nspawn: drop compat glue for kernel < 3.14 2026-01-19 12:51:55 +01:00
Mike Yuan 254445e927 README: kcmp() is unnecessary if we have F_DUPFD_QUERY (v6.10) 2026-01-19 12:51:55 +01:00
Mike Yuan 77b4a411ac README: CONFIG_DEVPTS_MULTIPLE_INSTANCES has been dropped in v4.7 2026-01-19 12:51:55 +01:00
Vitaly Kuznetsov 15b1c334df repart: Generate fstab and crypttab late
The immediate need for the change is to allow to capture the expected
LUKS volume key hash and record it to the generated crypttab but it
also seems to make sense to not generate crypttab/fstab before we know
that partition creation succeeded as fstab/crypttab entries are bogus
otherwise.
2026-01-19 11:29:00 +01:00
Mike Yuan a3507f6628 mkosi/opensuse: remove resolved TODO
Follow-up for ff9c4ace70
2026-01-19 03:06:30 +01:00
Mike Yuan 537045ec2f recurse-dir: remove stale comment
Follow-up for 6393b847f4
2026-01-19 03:06:30 +01:00
Mike Yuan 30f3a7ad51 TODO: remove completed entries 2026-01-19 03:04:54 +01:00