Yu Watanabe [Mon, 15 Apr 2024 05:55:18 +0000 (14:55 +0900)]
network: introduce network- and protocol-independent default for UseDomains=
Follow-up for
fb573007430ab0dbe45517b58837d2fa5cfa1a48.
Prompted by #32273.
Lennart Poettering [Fri, 19 Apr 2024 17:20:40 +0000 (19:20 +0200)]
timedate: handle gracefully if RTC lost time because of power loss
Apparently some RTC drivers return EINVAL in that case when we try to
read it. Handle that reasonably gracefully.
Fixes: #31854
Lennart Poettering [Fri, 19 Apr 2024 21:59:13 +0000 (23:59 +0200)]
Merge pull request #31872 from tfg13/main
stub+ukify: Add support for UKI .ucode section
Lennart Poettering [Fri, 19 Apr 2024 21:57:28 +0000 (23:57 +0200)]
Merge pull request #31889 from aplanas/fix_pcrlock_stdin
pcrlock: support measurement of big files
Luca Boccassi [Fri, 19 Apr 2024 19:14:21 +0000 (21:14 +0200)]
Merge pull request #32346 from yuwata/sd-radv-handle-header-param-gracefully
sd-radv: handle header param gracefully
Antonio Alvarez Feijoo [Fri, 19 Apr 2024 14:13:21 +0000 (16:13 +0200)]
cpio: fix assert
Antonio Alvarez Feijoo [Fri, 19 Apr 2024 09:29:31 +0000 (11:29 +0200)]
stub: get uname from image before loading addons
Otherwise uname is always NULL before calling `load_addons()`, so it's not being
checked if .uname matches between addons and UKI.
Fixes
68f85761e2eb1fd2243019980a64b174f07432c3
Luca Boccassi [Fri, 19 Apr 2024 18:35:42 +0000 (19:35 +0100)]
NEWS: note that portabled supports vpick too
Luca Boccassi [Fri, 19 Apr 2024 18:34:16 +0000 (20:34 +0200)]
Merge pull request #32142 from bluca/portable_vpick
portable: support vpick
Luca Boccassi [Fri, 19 Apr 2024 18:33:05 +0000 (20:33 +0200)]
Merge pull request #32251 from CodethinkLabs/vmspawn/docs_improvements
vmspawn docs improvements
Zbigniew Jędrzejewski-Szmek [Fri, 19 Apr 2024 16:49:11 +0000 (18:49 +0200)]
Merge pull request #32365 from poettering/gpt-auto-doc-fix
man: tweak gpt-auto-generator docs a bit
Lennart Poettering [Fri, 19 Apr 2024 16:36:33 +0000 (18:36 +0200)]
man: correct where we look for auxiliary partitions
We look for the root fs on the device of the booted ESP, and for the
other partitions on the device of the root fs. On EFI systems this
generally boils down to the same, but there are cases where this doesn't
hold, hence document this properly.
Fixes: #31199
Lennart Poettering [Fri, 19 Apr 2024 16:36:16 +0000 (18:36 +0200)]
man: add explicit column for gpt guid value in table
Lennart Poettering [Fri, 19 Apr 2024 16:34:43 +0000 (18:34 +0200)]
man: add separate column for flag value to table
Frantisek Sumsal [Fri, 19 Apr 2024 16:23:41 +0000 (18:23 +0200)]
labeler: merge "logind" label into "login"
Existing issues/PRs were migrated to the login label using:
$ gh search issues --repo systemd/systemd --label logind --limit=1000 --json number -q .[].number | \
xargs gh issue edit --add-label login --remove-label logind
Sam Leonard [Fri, 19 Apr 2024 15:31:33 +0000 (16:31 +0100)]
man: vmspawn - clarify behaviour of omitting --linux=/--initrd=
Sam Leonard [Fri, 19 Apr 2024 15:30:56 +0000 (16:30 +0100)]
man: vmspawn - clarify behaviour of omitting --vsock-cid=
Sam Leonard [Fri, 19 Apr 2024 15:26:06 +0000 (16:26 +0100)]
man: removely overly verbose wording from the vmspawn man page
Sam Leonard [Fri, 19 Apr 2024 13:52:01 +0000 (14:52 +0100)]
man: vmspawn - reference later example to show use of --private-users
Sam Leonard [Fri, 19 Apr 2024 13:51:09 +0000 (14:51 +0100)]
man: clarify behaviour when omitting both -i/-D in vmspawn
Sam Leonard [Fri, 12 Apr 2024 16:04:37 +0000 (17:04 +0100)]
man: fix entry for vmspawn's --ssh-key-type
Sam Leonard [Fri, 12 Apr 2024 16:03:00 +0000 (17:03 +0100)]
man: add ssh example for vmspawn
Sam Leonard [Fri, 12 Apr 2024 13:35:26 +0000 (14:35 +0100)]
man: add example --forward-journal= example for vmspawn
Sam Leonard [Fri, 12 Apr 2024 13:05:43 +0000 (14:05 +0100)]
man: add machinectl import-raw example for vmspawn
Alberto Planas [Tue, 2 Apr 2024 14:18:30 +0000 (16:18 +0200)]
pcrlock: add make_pcrlock_record_from_stream
To hash long files (like initrd) add the funcion
make_pcrlock_record_from_stream, that will read a long file (or stdin)
to generate the digests of multiple hashes, redading block by block.
Use this new function in verb_lock_raw and verb_lock_kernel_initrd.
Signed-off-by: Alberto Planas <aplanas@suse.com>
Daan De Meyer [Fri, 19 Apr 2024 11:41:49 +0000 (13:41 +0200)]
vmspawn: Fix shared memory check
We need the shared memory added if we're doing runtime mounts as well.
Lennart Poettering [Fri, 19 Apr 2024 13:25:43 +0000 (15:25 +0200)]
man: document the last remaining bits of the hostnamed D-Bus interface
Tobias Fleig [Tue, 2 Apr 2024 11:00:10 +0000 (04:00 -0700)]
ukify: Add support for .ucode UKI section
This commit teaches ukify how to build a .ucode section into UKIs. This
section is functionally an initrd, intended for microcode updates.
Daan De Meyer [Fri, 19 Apr 2024 11:25:31 +0000 (13:25 +0200)]
mkosi: Build command line into the image
This allows using systemd-vmspawn itself while still getting a decent
experience.
Tobias Fleig [Tue, 2 Apr 2024 10:56:22 +0000 (03:56 -0700)]
measure: Add .ucode UKI section support
This commit adds support for the new ".ucode" UKI section to
systemd-measure. It is functionally an initrd and is treated as such by
measure.
Tobias Fleig [Tue, 2 Apr 2024 10:54:30 +0000 (03:54 -0700)]
stub: Add support for .ucode UKI section
This commit adds support for loading, measuring and handling a ".ucode"
UKI section. This section is functionally an initrd, intended for
microcode updates. As such it will always be passed to the kernel first.
Luca Boccassi [Wed, 21 Feb 2024 20:00:29 +0000 (20:00 +0000)]
portable: support vpick
Resolve at attach/detach/inspect time, so that the image is pinned and requires
re-attaching on update, given files are extracted from it so just passing
img.v/ to RootImage= is not enough to get a portable image updated
Luca Boccassi [Mon, 15 Apr 2024 22:00:12 +0000 (23:00 +0100)]
vpick: add pick_filter_image_any filter that matches both dirs and images
Luca Boccassi [Fri, 19 Apr 2024 10:19:06 +0000 (12:19 +0200)]
Merge pull request #32349 from yuwata/sd-event-source-get-inotify-path
sd-event: introduce sd_event_source_get_inotify_path()
Luca Boccassi [Fri, 19 Apr 2024 09:59:08 +0000 (11:59 +0200)]
Merge pull request #32345 from yuwata/sd-radv-send
sd-radv: introduce sd_radv_send(), and reset timer on sending unsplicited RA
Luca Boccassi [Fri, 19 Apr 2024 09:20:44 +0000 (11:20 +0200)]
Merge pull request #31978 from nolange/fix_openssl_deprecations
Fix openssl deprecations
Yu Watanabe [Fri, 19 Apr 2024 04:19:00 +0000 (13:19 +0900)]
sd-event,sd-journal: fix error handling of inotify_add_watch_fd()
Fixes a bug in
97ef5391697c34ee1c763fa9bddcd20a29ff3159 and
858749f7312bd0adb5433075a92e1c35a2fb56ac.
Lennart Poettering [Fri, 19 Apr 2024 08:54:07 +0000 (10:54 +0200)]
update TODO
Daan De Meyer [Fri, 19 Apr 2024 06:30:53 +0000 (08:30 +0200)]
mkosi: Fix FORTIFY_SOURCE (again)
CentOS/Fedora use annobin which will complain if FORTIFY_SOURCE=0
is used so we disable those checks to avoid the warnings.
We also make sure that when we query the compilation flags so we can
add more, we set _fortify_level=0 and undefine _lto_flags so that we
don't get those flags in the result.
Yu Watanabe [Fri, 19 Apr 2024 04:55:35 +0000 (13:55 +0900)]
sd-event: introduce sd_event_source_get_inotify_path()
This may be useful when there are multiple inotify event sources exist.
Without this, users need to manage the event sources and paths.
Yu Watanabe [Fri, 19 Apr 2024 04:44:10 +0000 (13:44 +0900)]
man: drop spurious version info for error code
Follow-up for
87fe0a69606920dbdb11854be9223ddeef823fa1.
Yu Watanabe [Fri, 19 Apr 2024 04:35:04 +0000 (13:35 +0900)]
sd-event: rename argument for storing result
Yu Watanabe [Fri, 19 Apr 2024 03:36:48 +0000 (12:36 +0900)]
Merge pull request #32340 from YHNdnzj/wait-for-unit-cleanup
bus-wait-for-units: some cleanup
Yu Watanabe [Tue, 16 Apr 2024 10:00:15 +0000 (19:00 +0900)]
sd-radv: reset timer on sending unsolicited RA
Addresses https://github.com/systemd/systemd/pull/32267#discussion_r1567078807.
Yu Watanabe [Mon, 15 Apr 2024 02:53:51 +0000 (11:53 +0900)]
sd-radv: expose sd_radv_send()
To allow library users manually send RA.
Currently, this is not used, but will be used later.
Yu Watanabe [Fri, 19 Apr 2024 02:53:22 +0000 (11:53 +0900)]
Merge pull request #32290 from yuwata/network-conf-parser-cleanups
network,nspawn: several cleanups for conf-parsers
Yu Watanabe [Mon, 15 Apr 2024 03:04:23 +0000 (12:04 +0900)]
sd-radv: set router preference gracefully
Rather than refusing to set non-zero preference, when lifetime is zero,
let's handle that gracefully on send.
Yu Watanabe [Mon, 15 Apr 2024 02:57:07 +0000 (11:57 +0900)]
sd-radv: allow to modify RA header elements without stopping sd-radv
This also makes too large retransmit time handled gracefully,
as even if a too large value is specified, usec_to_be32_msec() in
radv_send_router() will handle it gracefully anyway.
Note, networkd still refuses such invalid values. Hence, this does not
change any effective behavior.
Mike Yuan [Wed, 17 Apr 2024 19:31:29 +0000 (03:31 +0800)]
bus-wait-for-units: simplify property_map_job_id
Mike Yuan [Wed, 17 Apr 2024 18:43:39 +0000 (02:43 +0800)]
bus-wait-for-units: drop 'current' field
This is not used anywhere.
Mike Yuan [Tue, 16 Apr 2024 12:02:33 +0000 (20:02 +0800)]
bus-wait-for-units: check for existing unit first, use hashmap_ensure_put
Mike Yuan [Tue, 16 Apr 2024 06:43:23 +0000 (14:43 +0800)]
bus-wait-for-units: make callback type end with "_t"
Mike Yuan [Tue, 16 Apr 2024 06:39:36 +0000 (14:39 +0800)]
bus-wait-for-units: drop ready_callback
This is never used, and given that bus_wait_for_units_run
returns BusWaitForUnits.state it's not really useful.
Mike Yuan [Tue, 16 Apr 2024 17:32:27 +0000 (01:32 +0800)]
systemctl-start-unit: Subscribe() is unnecessary if we RefUnit explicitly
Subscribe() enables full signal delivery on API bus. But aside from
that, if a unit/job is explicitly Ref()'d, manager also emits the
signal. See bus_foreach_bus() for details.
bus-wait-for-units refs every unit to wait for, so there's no need
to Subscribe() on top of that. In verb_clean_or_freeze() Subscribe()
is not called either.
Mike Yuan [Tue, 16 Apr 2024 07:08:14 +0000 (15:08 +0800)]
systemctl: use FOREACH_ARRAY and FOREACH_ELEMENT more
Mike Yuan [Tue, 16 Apr 2024 06:53:14 +0000 (14:53 +0800)]
core/dbus: modernize bus_foreach_bus
Mike Yuan [Fri, 19 Apr 2024 02:07:13 +0000 (10:07 +0800)]
core/unit: use UNIT_IS_INACTIVE_OR_FAILED at one more place
Luca Boccassi [Fri, 19 Apr 2024 00:04:35 +0000 (01:04 +0100)]
test: initialize _cleanup_ variables
Missed one in a previous PR.
Follow-up for
e5689f04dd3d57a4e680ab88c643fa971eb0afc2
Yu Watanabe [Tue, 16 Apr 2024 01:28:06 +0000 (10:28 +0900)]
conf-parser: move config_parse_timezone() to conf-parser.[ch]
Even though it is currently only used by networkd, the parser itself
is quite generic. Let's move it to the shared library.
Yu Watanabe [Tue, 16 Apr 2024 02:12:46 +0000 (11:12 +0900)]
nspawn: rename config_parse_timezone() -> config_parse_timezone_mode()
The parser does not parse timezone, but timezone mode. Let's rename the
parser to more specific name.
Yu Watanabe [Tue, 16 Apr 2024 02:10:04 +0000 (11:10 +0900)]
nspawn: align tables
Yu Watanabe [Tue, 16 Apr 2024 01:13:14 +0000 (10:13 +0900)]
network: introduce link_get_use_ntp()
No functional change, just refactoring.
Yu Watanabe [Tue, 16 Apr 2024 00:58:25 +0000 (09:58 +0900)]
network: move NTP related conf parsers to networkd-ntp.[ch]
No functional change, just refactoring.
Yu Watanabe [Mon, 15 Apr 2024 07:16:13 +0000 (16:16 +0900)]
network: introduce link_get_use_dns()
No functional change, just refactoring.
Yu Watanabe [Mon, 15 Apr 2024 06:47:12 +0000 (15:47 +0900)]
network: introduce link_get_use_domains()
No functional change, just refactoring.
Yu Watanabe [Mon, 15 Apr 2024 06:15:09 +0000 (15:15 +0900)]
network: move DNS related conf parsers to networkd-dns.[ch]
No functional change, just refactoring.
Yu Watanabe [Mon, 15 Apr 2024 05:47:44 +0000 (14:47 +0900)]
network: rename DHCPUseDomains -> UseDomains
As it is also used for NDisc.
Nick Rosbrook [Thu, 18 Apr 2024 16:01:42 +0000 (12:01 -0400)]
copy: ignore -EOPNOTSUPP from copy_file_range()
According to copy_file_range (2), errno will be set to EOPNOTSUPP when
the file system does not support copy_file_range(). Since there is
already fallback logic in place here for other kinds of errors, add
-EOPNOTSUPP to the list of ignored errors.
Luca Boccassi [Thu, 18 Apr 2024 21:45:06 +0000 (23:45 +0200)]
Merge pull request #32299 from yuwata/network-radv-ignore-rs-from-the-same-interface
network/radv: ignore RS message from the same interface
Luca Boccassi [Thu, 18 Apr 2024 21:24:42 +0000 (23:24 +0200)]
Merge pull request #32292 from yuwata/sd-radv-send-on-stop
sd-radv: set only basic information in RA message on stop
Lennart Poettering [Thu, 18 Apr 2024 19:11:27 +0000 (21:11 +0200)]
Merge pull request #31790 from poettering/pcrlock-policy-fix
Replace PolicyAuthValue by PolicySigned as access policy for pcrlock policy nvindex
Luca Boccassi [Thu, 18 Apr 2024 19:02:41 +0000 (21:02 +0200)]
Merge pull request #32121 from CodethinkLabs/basic-mkosi-integration-tests
Basic mkosi integration tests
Mike Yuan [Thu, 18 Apr 2024 17:40:33 +0000 (01:40 +0800)]
Merge pull request #32336 from teknoraver/foreach_element
Foreach element
Luca Boccassi [Thu, 18 Apr 2024 16:15:20 +0000 (18:15 +0200)]
Merge pull request #32144 from bluca/portable_clean
portablectl: add --clean parameter for detaching
Lennart Poettering [Thu, 18 Apr 2024 16:12:12 +0000 (18:12 +0200)]
ci: update tests to showcase new option a bit
Lennart Poettering [Wed, 17 Apr 2024 08:48:42 +0000 (10:48 +0200)]
update NEWS
Lennart Poettering [Wed, 17 Apr 2024 17:04:29 +0000 (19:04 +0200)]
pcrlock: rework --recovery-pin= to take three different arguments
This reworkds --recovery-pin= from a parameter that takes a boolean to
an enum supporting one of "hide", "show", "query".
If "hide" (default behaviour) we'll generate a recovery pin
automatically, but never show it, and thus just seal it and good.
If "show" we'll generate a recovery pin automatically, but display it in
the output, so the user can write it down.
If "query" we'll ask the user for a recovery pin, and not automatically
generate any.
For compatibility the old boolean behaviour is kept.
With this you can now do "systemd-pcrlock make-policy
--recovery-pin=show" to set up the first policy, write down the recovery
PIN. Later, if the PCR prediction didn't work out one day you can then
do "systemd-pcrlock make-policy --recovery-pin=query" and enter the
recovery key and write a new policy.
Lennart Poettering [Wed, 17 Apr 2024 17:02:18 +0000 (19:02 +0200)]
pcrlock: generate recovery PINs via make_recovery_key()
We already have infrastructure for generating nice recovery keys, for
the usual cryptenroll recovery keys. Let's reuse them here, as they are
nicer to read and type than the base64 encoded randomness we so far
used.
Previously valid recovery keys remain valid, in their original format.
For future enrollments we'll however have nicer, easier recovery keys to
deal with.
Lennart Poettering [Wed, 17 Apr 2024 08:17:20 +0000 (10:17 +0200)]
tpm2-util: now that we don't use PolicyAuthValue anymore, let's not set an authValue anymore for the policy nvindex
We have now switched from PolicyAuthValue to PolicySigned to control
access to the policy nvindex to. This means there's no point in setting
an authValue on the nvindex anymore, hence drop this.
Lennart Poettering [Tue, 16 Apr 2024 11:46:58 +0000 (13:46 +0200)]
pcrlock: switch access policy for nvindex to store policy in from PolicyAuthValue to PolicySigned (with an HMAC-SHA256 key)
So far the nvindex to store the pcrlock policy in was protected via a
PolicyAuthValue policy (i.e. with a simple PIN set on the nvindex).
That's a bad idea however, as it means an attacker can simply remove and
re-create the nvindex and the "name" of the nvindex does not change,
thus defeating the logic. (This is because the authValue is *not* part
of the "name" of an nvindex!).
Fix this by switching from PolicyAuthValue to PolicySigned with an
HMAC-SHA256 key. Behaviour is very similar: however, the PIN is now part
of of the access policy hash, which *is* part of the "name" of an
nvindex. Thus, if an attacker removes and recreates the nvindex it has
to provide the same PIN again or the "name" of the nvindex will change.
Mission accomplished.
I'd like to thank Chris Coulson for finding this issue (and helping me
address it). Thank you!
Lennart Poettering [Wed, 17 Apr 2024 08:10:56 +0000 (10:10 +0200)]
tpm2-util: add comment explaining what tpm2_define_policy_nv_index() actually does
Lennart Poettering [Tue, 16 Apr 2024 13:01:41 +0000 (15:01 +0200)]
tpm2-util: load external key into NULL hierarchy if private key is provided
If we load an external key into the TPM we must do so in the NULL
hierarchy. An external key after all is one that is not wrapped by any
hierarchy's seed.
See TPM2 spec, Part 3, Section 12.3.1
Lennart Poettering [Tue, 16 Apr 2024 11:52:30 +0000 (13:52 +0200)]
tpm2-util: rename tpm2_get_pin_auth() → tpm2_auth_value_from_pin()
Just some renaming. I found the old name a bit confusing since it sounds
as if this would get the pin from somewhere, but it really doesn't. It
just converts a PIN into an auth_value, and I think saying so explicitly
makes things easier to grok.
Lennart Poettering [Tue, 16 Apr 2024 11:45:00 +0000 (13:45 +0200)]
tpm2: export tpm2_get_name()
We later want to use this from pcrlock.c, hence export it.
Lennart Poettering [Tue, 16 Apr 2024 11:43:07 +0000 (13:43 +0200)]
tpm2-util: import two more symbols from tpm2-tss libraries
We want to make use of TPM_PolicySigned soon, hence import the necessary
symbols from tpm2-tss.
Antonio Alvarez Feijoo [Thu, 18 Apr 2024 14:43:25 +0000 (16:43 +0200)]
man/systemd-stub: fix typo
Matteo Croce [Thu, 18 Apr 2024 12:31:39 +0000 (14:31 +0200)]
use FOREACH_ELEMENT
Use FOREACH_ELEMENT where possible. Generated with this command,
and checked manually:
git grep -l 'FOREACH_ARRAY.*ELEMENTSOF' | \
xargs sed -ri 's/FOREACH_ARRAY\((.*), (.*), (ELEMENTSOF.*)\)/FOREACH_ELEMENT(\1, \2)/'
Matteo Croce [Thu, 18 Apr 2024 12:24:03 +0000 (14:24 +0200)]
introduce FOREACH_ELEMENT
Add a FOREACH_ELEMENT() macro which just passes ELEMENTSOF(v)
as third argument to FOREACH_ARRAY().
Richard Maw [Fri, 5 Apr 2024 16:19:59 +0000 (17:19 +0100)]
test: Add mkosi-based integration test runner
The first two tests are included to ensure parallel test execution is
demonstrable.
Richard Maw [Sat, 3 Feb 2024 14:56:42 +0000 (14:56 +0000)]
mkosi: Extend default device timeout to 20 seconds
A moderately heavily loaded system booting an image without a rootfs
may timeout before the root device appears.
20 seconds is enough for a VM with 2 CPUs and 2GB RAM.
Luca Boccassi [Thu, 18 Apr 2024 15:07:32 +0000 (17:07 +0200)]
Merge pull request #32328 from YHNdnzj/deserialize-objective
core: follow-ups for objective serialization
Lennart Poettering [Thu, 18 Apr 2024 13:47:20 +0000 (15:47 +0200)]
Merge pull request #32330 from poettering/status-invocation
systemctl: show invocation ID in unit status output
Daan De Meyer [Thu, 18 Apr 2024 13:02:51 +0000 (15:02 +0200)]
Merge pull request #32335 from DaanDeMeyer/fix
mkosi: undefine FORTIFY_SOURCE instead of setting it zero
Daan De Meyer [Thu, 18 Apr 2024 12:27:38 +0000 (14:27 +0200)]
mkosi: undefine FORTIFY_SOURCE instead of setting it zero
Newer gcc complains if FORTIFY_SOURCE=0 is set so just undefine it
instead.
Mike Yuan [Thu, 18 Apr 2024 00:59:10 +0000 (08:59 +0800)]
core/manager: log about previous objective
Addresses https://github.com/systemd/systemd/pull/32320#discussion_r1569192295
Mike Yuan [Thu, 18 Apr 2024 00:57:28 +0000 (08:57 +0800)]
core/manager-serialize: serialize objective string
Follow-up for
8c15bf36e117054cf54b4f0cca59615b7531a545
I just realized that we should not serialize the number
of internal enum, as that's subject to changes and such
changes would be hard to notice. Let's serialize strings
properly instead.
Mike Yuan [Thu, 18 Apr 2024 00:53:50 +0000 (08:53 +0800)]
core/manager: introduce ManagerObjective string table lookup
Mike Yuan [Thu, 18 Apr 2024 00:46:20 +0000 (08:46 +0800)]
core/manager: also log soft-reboot count along with timespan
Mike Yuan [Thu, 18 Apr 2024 00:43:48 +0000 (08:43 +0800)]
core: switch j->unit->manager to j->manager
Daan De Meyer [Thu, 18 Apr 2024 12:21:31 +0000 (14:21 +0200)]
mkosi: Disable bash debugging in Arch build script