Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2024 13:56:54 +0000 (14:56 +0100)]
docs/TPM2_PCR_MEASUREMENTS: drop quotes from around section titles
The section headers used quotes as if the strings were some constants. But
AFAICT, those are just normal plain-text titles. Also lowercase them, because
this is almost like a table and it's easier to read without capitalization.
Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2024 13:45:43 +0000 (14:45 +0100)]
tree-wide: use Device*T*ree spelling
We used both, in fact "Devicetree" was more common. But we have a general rule
that we capitalize all words in names and also we have a DeviceTree=
configuration setting, which we cannot change. If we use two different
spelllings, this will make it harder for people to use the correct one in
config files. So use the "DeviceTree" spelling everywhere.
Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2024 13:40:21 +0000 (14:40 +0100)]
man/systemd-stub: rework the description of sections
The text added for .dtbauto/.hwids was very hard to grok. This rewords it to be
proper English. No semantic changes are intended.
When updating this, I noticed that the interaction of multi-profile UKIs and
dtb autoselection is very unclear, a FIXME is added.
Yu Watanabe [Wed, 6 Nov 2024 10:06:13 +0000 (19:06 +0900)]
Yu Watanabe [Wed, 6 Nov 2024 10:05:12 +0000 (19:05 +0900)]
Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2024 09:17:56 +0000 (10:17 +0100)]
man/systemd-measure: add forgotten "="
Both syntaxes work, but let's use one syntax for consistency.
Fixup for
0641ce809a27cc1bc358924c26770f19d1213ec1.
Zbigniew Jędrzejewski-Szmek [Tue, 5 Nov 2024 17:03:03 +0000 (18:03 +0100)]
man/systemd-measure: update to new ukify syntax, non-root operation
It's been a while, but systemd-measure doesn't need root, and
ukify has a more modern syntax.
Yu Watanabe [Wed, 6 Nov 2024 08:57:56 +0000 (17:57 +0900)]
network: reconfigure interface more gracefully (#35035)
split-out of #34989.
Lennart Poettering [Wed, 6 Nov 2024 08:29:04 +0000 (09:29 +0100)]
UKI: Introduce `.dtbauto` sections (#34855)
Split out from #34158
Andres Beltran [Tue, 5 Nov 2024 19:52:35 +0000 (19:52 +0000)]
namespace-util: make idmapping not supported if syscalls return EPERM
Lennart Poettering [Wed, 6 Nov 2024 08:26:57 +0000 (09:26 +0100)]
Various man page updates (#35032)
Fixes: #34996
Fixes: #15032
Fixes: #32751
Fixes: #33130
Fixes: #34735
Fixes: #34840
Fixes: #34949
Zbigniew Jędrzejewski-Szmek [Wed, 6 Nov 2024 07:39:24 +0000 (08:39 +0100)]
mount-util: introduce path_is_network_fs_harder() and use it in networkd (#35040)
Closes #32426.
Lennart Poettering [Tue, 5 Nov 2024 13:47:32 +0000 (14:47 +0100)]
man: convert multiple left-over "See Also" sections to <simplelist>
These were forgotten during the initial conversion, probably because
most of them consisted only of a single entry.
Fix that.
Lennart Poettering [Tue, 5 Nov 2024 13:20:01 +0000 (14:20 +0100)]
man: link up D-Bus API docs from daemon man pages
Let's systematically make sure that we link up the D-Bus interfaces from
the daemon man pages once in prose and once in short form at the bottom
("See Also"), for all daemons.
Also, add reverse links at the bottom of the D-Bus API docs.
Fixes: #34996
Lennart Poettering [Tue, 5 Nov 2024 13:08:16 +0000 (14:08 +0100)]
man: point people from sd-bus man page to busctl
Lennart Poettering [Tue, 5 Nov 2024 13:07:31 +0000 (14:07 +0100)]
man: add brief entrypoint man page for sd-varlink
We have this in a similar fashion for the other APIs libsystemd
provides. Add the same for sd-varlink. There isn't too much on it for
now, but at least it's a start.
Also link it up everywhere.
Lennart Poettering [Tue, 5 Nov 2024 12:51:00 +0000 (13:51 +0100)]
man: tone down claims on processes having exited already in ExecStop=
Processes can easily survive the first kill operation we execute, hence
we shouldn't make strong claims about them having exited already. Let's
just say "likely" hence.
Fixes: #15032
Lennart Poettering [Tue, 5 Nov 2024 12:36:19 +0000 (13:36 +0100)]
man: document that .path units don't care for hidden files
Fixes: #32751
Lennart Poettering [Tue, 5 Nov 2024 12:33:53 +0000 (13:33 +0100)]
man: document that PrivateTmp= is unaffected by ProtectSystem=strict
Fixes: #33130
Lennart Poettering [Tue, 5 Nov 2024 12:27:23 +0000 (13:27 +0100)]
man: highlight the privilege issues around the LogControl1 more
Let's emphasize the privilege thing with a <caution> section.
Let's also point out that other D-Bus libraries are less restrictive
than sd-bus by default regarding permission access.
Fixes: #34735
anonymix007 [Tue, 22 Oct 2024 12:07:15 +0000 (15:07 +0300)]
man: Document stub behaviour for .hwids and .dtbauto sections
anonymix007 [Tue, 22 Oct 2024 11:41:55 +0000 (14:41 +0300)]
stub: Handle .dtbauto sections
anonymix007 [Tue, 22 Oct 2024 11:40:57 +0000 (14:40 +0300)]
measure: Introduce .dtbauto support
anonymix007 [Tue, 22 Oct 2024 11:38:00 +0000 (14:38 +0300)]
uki: add new .dtbauto PE section type
.dtbauto section contains DT blobs, just like .dtb, the difference is
that multiple .dtbauto sections are allowed to be in a UKI and only one
is selected automatically
Temporarily drop an assert_cc() check in systemd-measure to make it compilable before the next commit
anonymix007 [Wed, 4 Sep 2024 11:40:18 +0000 (14:40 +0300)]
measure: introduce support for a .hwids section
anonymix007 [Wed, 4 Sep 2024 09:49:29 +0000 (12:49 +0300)]
boot: Add .dtbauto section matching in PE section discovery against HWIDs and FW-provided DT
Lennart Poettering [Tue, 5 Nov 2024 12:15:36 +0000 (13:15 +0100)]
man: don't claim SELinuxContext= only worked in the system service manager
Fixes: #34840
Lennart Poettering [Tue, 5 Nov 2024 12:12:20 +0000 (13:12 +0100)]
man: document the timeout applied to /usr/lib/systemd/system-shutdown/ drop-in binaries
Fixes: #34949
Luca Boccassi [Tue, 5 Nov 2024 18:15:36 +0000 (18:15 +0000)]
test: delete /swapfile after swapoff
[ 23.608342] TEST-55-OOMD.sh[689]: + btrfs filesystem mkswapfile -s 64M /swapfile
[ 23.651930] TEST-55-OOMD.sh[704]: ERROR: cannot create new swapfile: File exists
Ronan Pigott [Mon, 4 Nov 2024 23:12:00 +0000 (16:12 -0700)]
network: handle ENODATA better with DNR
It is normal for DHCP leases not to have DNR options. We need to be less
verbose and more forgiving in these cases. Also, if either DHCP does not
have DNR options, make sure to still consider any DHCPv6/RA options.
Fixes:
c7c9e3c7c016 (network: adjust log message about DNR)
Yu Watanabe [Tue, 5 Nov 2024 19:42:16 +0000 (04:42 +0900)]
network: use path_is_network_fs_harder()
Closes #32426.
Yu Watanabe [Tue, 5 Nov 2024 19:37:55 +0000 (04:37 +0900)]
mount-util: introduce path_is_network_fs_harder()
It also detects e.g. glusterfs or mounts with "_netdev" option.
Zbigniew Jędrzejewski-Szmek [Tue, 5 Nov 2024 17:47:54 +0000 (18:47 +0100)]
tree-wide: time-out → timeout
For justification, see
3f9a0a522f2029e9295ea5e9984259022be88413.
anonymix007 [Sat, 31 Aug 2024 18:49:10 +0000 (21:49 +0300)]
boot: Add HWID calculation from SMBIOS strings and matching against a built-in list
anonymix007 [Tue, 5 Nov 2024 19:17:21 +0000 (22:17 +0300)]
boot: Add firmware_devicetree_exists()
Diogo Ivo [Wed, 4 Sep 2024 10:00:05 +0000 (13:00 +0300)]
boot: add matching against FW-provided Devicetree blob
Add support for matching the DT contained in a .dtb section of the
UKI image against the FW provided FDT or arbitrary compatible.
Luca Boccassi [Tue, 5 Nov 2024 18:42:28 +0000 (18:42 +0000)]
Add PrivatePIDs= (continued) (#34940)
Yu Watanabe [Tue, 5 Nov 2024 02:41:31 +0000 (11:41 +0900)]
network: introduce LINK_RECONFIGURE_CLEANLY flag
And use it when explicit reconfiguration is requested by Reconfigure() DBus method
or networkd certainly detects that connected network is changed.
Otherwise do not use the flag especially when we come back from sleep mode.
Yu Watanabe [Tue, 5 Nov 2024 02:39:31 +0000 (11:39 +0900)]
network: keep dynamic configurations as possible as we can on reconfigure
E.g. when a .network file is updated, but DHCP setting is unchanged, it
is not necessary to drop acquired DHCP lease.
So, let's not stop DHCP client and friends in link_reconfigure_impl(),
but stop them later when we know they are not necessary anymore.
Still DHCP clients and friends are stopped and leases are dropped when
the explicit reconfiguration is requested
Yu Watanabe [Tue, 5 Nov 2024 02:32:33 +0000 (11:32 +0900)]
network: merge link_foreignize_config() and link_drop_foreign_config()
When a reconfiguration of an interface is triggered, previously we
call link_foreignize_config(), which sets all static configurations as
foreign, then later call link_drop_foreign_config(), which drops
unnecessary foreign configurations.
This commit merges these two steps into one, link_drop_unmanaged_config(),
which drops unnecessary static and foreign configurations.
Also, this renames link_drop_managed_configs() to
link_drop_static_config(), as it only drops static configurations.
Note that dynamically aquired configurations are dropped by
link_stop_engines().
Yu Watanabe [Mon, 4 Nov 2024 19:04:33 +0000 (04:04 +0900)]
network: several cleanups for link_reconfigure()
Effectively no functional changes, just refactoring and preparation for
later changes.
- convert boolean flag 'force' to LinkReconfigurationFlag enum,
- merge link_reconfigure() and reconfigure_handler_on_bus_method_reload() as
link_reconfigure_full(),
- Rename ReconfigureData -> LinkReconfigurationData,
- make Reconfigure() DBus message wait for reconfiguration being
started before sending reply.
Yu Watanabe [Sun, 3 Nov 2024 01:18:27 +0000 (10:18 +0900)]
network: split out link_enter_unmanaged() from link_reconfigure_impl()
No functional change, just refactoring.
Yu Watanabe [Tue, 5 Nov 2024 16:52:36 +0000 (01:52 +0900)]
Translations update from Fedora Weblate (#35031)
Weblate Translation Memory [Tue, 5 Nov 2024 13:50:15 +0000 (14:50 +0100)]
po: Translated using Weblate (German)
Currently translated at 90.9% (230 of 253 strings)
po: Translated using Weblate (German)
Currently translated at 89.3% (226 of 253 strings)
po: Translated using Weblate (German)
Currently translated at 88.9% (225 of 253 strings)
po: Translated using Weblate (German)
Currently translated at 88.1% (223 of 253 strings)
Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/de/
Translation: systemd/main
Ettore Atalan [Tue, 5 Nov 2024 13:50:15 +0000 (14:50 +0100)]
po: Translated using Weblate (German)
Currently translated at 90.9% (230 of 253 strings)
po: Translated using Weblate (German)
Currently translated at 89.3% (226 of 253 strings)
po: Translated using Weblate (German)
Currently translated at 88.9% (225 of 253 strings)
po: Translated using Weblate (German)
Currently translated at 88.1% (223 of 253 strings)
Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/de/
Translation: systemd/main
Lennart Poettering [Tue, 5 Nov 2024 10:54:14 +0000 (11:54 +0100)]
run: handle gracefully if we can't find binary client-side due to perms
Fixes: #35022
Daan De Meyer [Thu, 29 Aug 2024 15:10:46 +0000 (17:10 +0200)]
core: Introduce PrivatePIDs=
This new setting allows unsharing the pid namespace in a unit. Because
you have to fork to get a process into a pid namespace, we fork in
systemd-executor to get into the new pid namespace. The parent then
sends the pid of the child process back to the manager and exits while
the child process continues on with the rest of exec_invoke() and then
executes the actual payload.
Communicating the child pid is done via a new pidref socket pair that is
set up on manager startup.
We unshare the PID namespace right before the mount namespace so we
mount procfs correctly. Note PrivatePIDs=yes always implies MountAPIVFS=yes
to mount procfs.
When running unprivileged in a user session, user namespace is set up first
to allow for PID namespace to be unshared. However, when running in
privileged mode, we unshare the user namespace last to ensure the user
namespace does not own the PID namespace and cannot break out of the sandbox.
Note we disallow Type=forking services from using PrivatePIDs=yes since the
init proess inside the PID namespace must not exit for other processes in
the namespace to exist.
Note Daan De Meyer did the original work for this commit with Ryan Wilson
addressing follow-ups.
Co-authored-by: Daan De Meyer <daan.j.demeyer@gmail.com>
anonymix007 [Thu, 10 Oct 2024 15:35:02 +0000 (18:35 +0300)]
fundamental: Add HWID calculation
anonymix007 [Wed, 16 Oct 2024 14:59:08 +0000 (17:59 +0300)]
boot: Add xnew0
Same as xnew but initialized with zeros
Zbigniew Jędrzejewski-Szmek [Sun, 3 Nov 2024 11:58:12 +0000 (12:58 +0100)]
resolved: log error messages for openssl/gnutls context creation
In https://bugzilla.redhat.com/show_bug.cgi?id=
2322937 we're getting
an error message:
Okt 29 22:21:03 fedora systemd-resolved[29311]: Could not create manager: Cannot allocate memory
I expect that this actually comes from dnstls_manager_init(), the
openssl version. But without real logs it's hard to know for sure.
Use EIO instead of ENOMEM, because the problem is unlikely to be actually
related to memory.
Ronan Pigott [Tue, 5 Nov 2024 03:45:27 +0000 (20:45 -0700)]
network: limit the total number of Encrypted DNS options processed
We need a sensible limit on the number of Encrypted DNS options allowed
so that the set of resolvers per link does not grow without bound.
Fixes:
0c90d1d2f243 ("ndisc: Parse RFC9463 encrypted DNS (DNR) option")
Luca Boccassi [Tue, 5 Nov 2024 00:56:28 +0000 (00:56 +0000)]
sd-daemon: some tweaks (#35011)
Luca Boccassi [Mon, 4 Nov 2024 21:46:19 +0000 (21:46 +0000)]
ci: add coverage for builds without sd-boot (#35016)
This should catch compilation issues such as:
https://github.com/systemd/systemd/pull/35014
Luca Boccassi [Mon, 4 Nov 2024 19:43:02 +0000 (19:43 +0000)]
ci: add coverage for builds without sd-boot
This should catch compilation issues such as:
https://github.com/systemd/systemd/pull/35014
Luca Boccassi [Mon, 4 Nov 2024 20:26:34 +0000 (20:26 +0000)]
test: set nullglob to avoid failure when building without sd-boot
2024-11-04T20:13:17.3258095Z + for loader in build/src/boot/efi/*{.efi,.efi.stub}
2024-11-04T20:13:17.3258275Z ++ sbverify --list 'build/src/boot/efi/*.efi'
2024-11-04T20:13:17.3258525Z + [[ Error reading file build/src/boot/efi/*.efi: No such file or directory
2024-11-04T20:13:17.3258952Z Can't open image build/src/boot/efi/*.efi != \N\o\ \s\i\g\n\a\t\u\r\e\ \t\a\b\l\e\ \p\r\e\s\e\n\t ]]
Luca Boccassi [Mon, 4 Nov 2024 20:22:01 +0000 (20:22 +0000)]
test: fix tool name in comment
Yu Watanabe [Mon, 4 Nov 2024 19:16:44 +0000 (04:16 +0900)]
network: sevearal random trivial cleanups (#34994)
split-out of #34989.
Daan De Meyer [Mon, 4 Nov 2024 11:21:21 +0000 (12:21 +0100)]
tmpfiles: Implement L? to only create symlinks if source exists
This allows a single tmpfiles snippet with lines to symlink directories
from /usr/share/factory to be shared across many different configurations
while making sure symlinks only get created if the source actually exists.
Yu Watanabe [Fri, 1 Nov 2024 14:47:59 +0000 (23:47 +0900)]
network/dhcp4: keep DHCP address and routes on stop even when SendDecline=yes
KeepConfiguration=dhcp or dhcp-on-stop already violate RFC. It is not
necessary to honor the RFC about sending decline message on stop.
Yu Watanabe [Sat, 2 Nov 2024 09:32:02 +0000 (18:32 +0900)]
network: expose log_route_debug() and log_address_debug()
They will be used in another file in a later commit.
Yu Watanabe [Sat, 2 Nov 2024 09:26:43 +0000 (18:26 +0900)]
network: add more debugging logs
This also fixes the position of the logging "Enumeration completed.",
and downgrade its log level.
Yu Watanabe [Fri, 1 Nov 2024 21:31:25 +0000 (06:31 +0900)]
network: check if interface is initialized after enumeration completed
We enumerate interfaces at first, then enumerate other configurations
like addresses and so on. If we are running on a container, previously
we started to configure the enumerated interfaces before enumerating other
configurations.
Let's configure interfaces after all configurations are enumerated.
Yu Watanabe [Fri, 1 Nov 2024 21:23:55 +0000 (06:23 +0900)]
network: check earlier if we are running in test mode
Yu Watanabe [Fri, 1 Nov 2024 21:05:23 +0000 (06:05 +0900)]
network: introduce network_config_source_from_string()
It is currently unused, but will be used later.
Preparation for later commits.
Yu Watanabe [Fri, 1 Nov 2024 21:02:21 +0000 (06:02 +0900)]
network/json: add missing entries for route properties
Yu Watanabe [Fri, 1 Nov 2024 21:00:29 +0000 (06:00 +0900)]
network: remove unexpected netlink socket from service manager
Yu Watanabe [Fri, 1 Nov 2024 20:57:46 +0000 (05:57 +0900)]
daemon-util: expose notify_push_fd()
It will be used in a later commit.
Yu Watanabe [Fri, 1 Nov 2024 16:01:30 +0000 (01:01 +0900)]
network/address: slightly optimize link_address_is_dynamic()
Yu Watanabe [Fri, 1 Nov 2024 14:07:07 +0000 (23:07 +0900)]
network: realign string table
Daan De Meyer [Fri, 13 Sep 2024 10:46:29 +0000 (12:46 +0200)]
exec-invoke: Add debug logging for setup_private_users()
Franck Bui [Mon, 4 Nov 2024 15:07:45 +0000 (16:07 +0100)]
efi-loader: add missing stub for efi_stub_get_device_part_uuid()
Lennart Poettering [Mon, 4 Nov 2024 14:19:51 +0000 (15:19 +0100)]
json: add json_dispatch_ifindex() helper (#34982)
Inspired by: #34640
Daan De Meyer [Sun, 3 Nov 2024 20:45:29 +0000 (21:45 +0100)]
pcrlock: Pad pe hash to a multiple of 8 bytes
All other tools (sbsigntools, osslsigncode, sbctl, goblin) do this
as well so let's follow suite.
Luca Boccassi [Mon, 4 Nov 2024 12:12:31 +0000 (12:12 +0000)]
network: refuse new requests on stop (#35004)
split-out of #34989..
Luca Boccassi [Mon, 4 Nov 2024 12:08:27 +0000 (12:08 +0000)]
network: cleanups for IPv4LL (#34995)
split-out of #34989.
Colin Foster [Fri, 1 Nov 2024 20:39:11 +0000 (15:39 -0500)]
test-dhcp-client: utilize log_info instead of printf
log_info appears to be the preferred method to convey information from
tests. Convert all the printfs to log_info to follow this standard.
Lennart Poettering [Mon, 4 Nov 2024 11:42:40 +0000 (12:42 +0100)]
update NEWS
Lennart Poettering [Mon, 4 Nov 2024 10:18:29 +0000 (11:18 +0100)]
sd-daemon: add fd array size safety check to sd_notify_with_fds()
The previous commit removed the UINT_MAX check for the fd array. Let's
now re-add one, but at a better place, and with a more useful limit. As
it turns out the kernel does not allow passing more than 253 fds at the
same time, hence use that as limit. And do so immediately before
calculating the control buffer size, so that we catch multiplication
overflows.
Lennart Poettering [Fri, 1 Nov 2024 17:12:30 +0000 (18:12 +0100)]
tree-wide: port things over to new json_dispatch_ifindex()
Lennart Poettering [Fri, 1 Nov 2024 17:01:08 +0000 (18:01 +0100)]
json-util: generalize json_dispatch_ifindex()
Let's move the helper from nss-resolve.c to generic code, as it's going
to be useful in #34640.
Also, let's tighten the rules, and refuse negative ifindexes, because
they are invalid.
Lennart Poettering [Mon, 4 Nov 2024 10:01:23 +0000 (11:01 +0100)]
sd-daemon: count array elements in size_t
We fucked that up in the original sd_listen() calls, and then we fixed
that on the newer flavours. But pour internal common implementation
should of course use the full range size_t, as it should be.
This then allows us to drop a redundant range check.
Lennart Poettering [Mon, 4 Nov 2024 10:01:07 +0000 (11:01 +0100)]
sd-daemon: drop some redundant 'else'
Lennart Poettering [Mon, 4 Nov 2024 09:46:37 +0000 (10:46 +0100)]
sd-daemon: clean up env var unsetting
This cleans up the handling of the "unset_environment" parameter to
sd_listen() and related calls: the man pages claim we operate on it on
error too. Hence, actually do so in strictly all error paths. Previously
we'd miss out on some, because wrapper functions mishandled them.
This was addressed before in
362dcfc5db0271cd6b3a564c528cabf0ac0e7993
but some codepaths were missed. Complete the work now.
This establishes a common pattern: a function to unset the relevant env
vars, that is called from a goto section at the botom on both success
and failure.
Lennart Poettering [Mon, 4 Nov 2024 09:45:26 +0000 (10:45 +0100)]
update TODO
Martin Wilck [Wed, 30 Oct 2024 15:57:39 +0000 (16:57 +0100)]
udev-builtin-path_id: SAS wide ports must have num_phys > 1
Some kernel SAS drivers (e.g. smartpqi) expose ports with num_phys = 0. udev
shouldn't treat these ports as wide ports. SAS wide ports always have
num_phys > 1. See comments for sas_port_add_phy() in the kernel sources.
Sample data from a smartpqi system to illustrate the issue below.
Here the phy device is attached to port 0:0, which has no end devices attached
and the SAS end device (where sda is attached) is associated with SAS
port 0:1, which has no associated phy device. Thus num_phys for port-0:1 is 0.
This is arguably wrong, but it's how smartpqi has always set up its devices in
sysfs.
/sys/class/sas_phy/phy-0:0 -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/phy-0:0/sas_phy/phy-0:0
/sys/devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:0/phy-0:0 -> ../phy-0:0
/sys/devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/phy-0:0/port -> ../port-0:0
/sys/class/sas_device/end_device-0:1 -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:1/end_device-0:1/sas_device/end_device-0:1
/sys/class/block/sda -> ../../devices/pci0000:46/0000:46:02.0/0000:47:00.0/host0/scsi_host/host0/port-0:1/end_device-0:1/target0:0:0/0:0:0:0/block/sda
Signed-off-by: Martin Wilck <mwilck@suse.com>
Daan De Meyer [Sun, 3 Nov 2024 11:54:20 +0000 (12:54 +0100)]
openssl-util: Query engine/provider pin via ask-password (#34948)
In mkosi, we want to support signing via a hardware token. We already
support this in systemd-repart and systemd-measure. However, if the
hardware token is protected by a pin, the pin is asked as many as 20
times when building an image as the pin is not cached and thus requested
again for every operation.
Let's introduce a custom openssl ui when we use engines and providers
and plug systemd-ask-password into the process. With
systemd-ask-password, the pin can be cached in the kernel keyring,
allowing us to reuse it without querying the user again every time to
enter the pin.
We use the private key URI as the keyring identifier so that the cached
pin can be shared across multiple tools.
Daan De Meyer [Thu, 31 Oct 2024 22:33:36 +0000 (23:33 +0100)]
bootctl: Add --secure-boot-auto-enroll
When specified, bootctl install will also set up secure boot
auto-enrollment. For now, We sign all variables using the same
certificate and key pair.
Daan De Meyer [Wed, 30 Oct 2024 14:47:58 +0000 (15:47 +0100)]
openssl-util: Query engine/provider pin via ask-password
In mkosi, we want to support signing via a hardware token. We already
support this in systemd-repart and systemd-measure. However, if the
hardware token is protected by a pin, the pin is asked as many as 20
times when building an image as the pin is not cached and thus requested
again for every operation.
Let's introduce a custom openssl ui when we use engines and providers
and plug systemd-ask-password into the process. With systemd-ask-password,
the pin can be cached in the kernel keyring, allowing us to reuse it without
querying the user again every time to enter the pin.
We use the private key URI as the keyring identifier so that the cached pin
can be shared across multiple tools.
Note that if the private key is pin protected, openssl will prompt both when
loading the private key using the pkcs11 engine and when actually signing the
roothash. To make sure our custom UI is used when signing the roothash, we have
to also configure it with ENGINE_ctrl() which takes a non-owning pointer to
the UI_METHOD object and its userdata object which we have to keep alive so we
introduce a new AskPasswordUserInterface struct which we use to keep both objects
alive together with the EVP_PKEY object.
Because the AskPasswordRequest struct stores non-owning pointers to its fields,
we change repart to store the private key URI as a global variable again instead
of the EVP_PKEY object so that we can use the private key argument as the keyring
field of the AskPasswordRequest instance without running into lifetime issues.
Yu Watanabe [Sat, 2 Nov 2024 20:07:55 +0000 (05:07 +0900)]
network: free DHCP client and friends in link_free()
No functional change, at least now. Preparation for later commits.
But we are planning to extend KeepConfiguration= and also keep
addresses and so on assigned by other dynamic configuration protocol
like DHCPv6 or NDisc.
However, when link_free_engines() is called here, acquired addresses so
on by NDisc will be removed, even if link_stop_engines() handles
restarting networkd or KeepConfiguration= gracefully.
So, let's not free engines here, but free them later in link_free().
It is not necessary to be called here anyway.
Yu Watanabe [Sat, 2 Nov 2024 19:56:32 +0000 (04:56 +0900)]
network: refuse further requests when manager is in MANAGER_STOPPED
In that case, requests will never be processed anyway. But further more,
we cannot call link_ref() at that stage. Otherwise, we trigger assertion.
Daan De Meyer [Thu, 31 Oct 2024 12:54:33 +0000 (13:54 +0100)]
efivars: Remove STRINGIFY() helper macros
The names of these conflict with macros from efi.h that we'll move
to efi-fundamental.h in a later commit. Let's avoid the conflict by
getting rid of these helpers. Arguably this also improves readability
by clearly indicating we're passing arbitrary strings and not constants
to the macros when we invoke them.
Daan De Meyer [Wed, 30 Oct 2024 22:45:38 +0000 (23:45 +0100)]
ask-password: Add $SYSTEMD_ASK_PASSWORD_KEYRING_TYPE
Currently ask_password_auto() will always try to store the password into
the user keyring. Let's make this configurable so that we can configure
ask_password_auto() into the session keyring. This is required when working
with user namespaces, as the user keyring is namespaced by user namespaces
which makes it impossible to share cached keys across user namespaces by using
the user namespace while this is possible with the session keyring.
Daan De Meyer [Fri, 1 Nov 2024 11:45:29 +0000 (12:45 +0100)]
ask-password: Drop "default" for SYSTEMD_ASK_PASSWORD_KEYRING_TIMEOUT_SEC
Users can simply unset the environment variable to achieve the same effect.
Daan De Meyer [Fri, 1 Nov 2024 12:48:58 +0000 (13:48 +0100)]
ask-password: Use default timeout if SYSTEMD_ASK_PASSWORD_KEYRING_TIMEOUT_SEC is unset
Follow-up for
d9f4dad986dcebd51bdaeb8ba3d2c00cdc0d701e
Daan De Meyer [Sat, 2 Nov 2024 21:13:31 +0000 (22:13 +0100)]
mkosi: Add extra tools tree packages required to run integration tests
With https://github.com/systemd/mkosi/pull/3164, we'll be able to run
arbitrary commands in the mkosi sandbox, which has /usr from the tools
tree if one is configured. Let's add the required packages to be able to
run meson to setup the integration tests. This allows running the integration
tests without having to install meson or other build dependencies on the
host system.
"""
mkosi sandbox meson setup build
mkosi sandbox meson compile -C build mkosi
mkosi sandbox env SYSTEMD_INTEGRATION_TESTS=1 meson test -C build ...
"""
dependabot[bot] [Sat, 2 Nov 2024 21:18:57 +0000 (21:18 +0000)]
build(deps): bump systemd/mkosi
Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from
2a35f9958bc6b82d95d1eac02dc245e9bb068765 to
8976a0abb19221e65300222f2d33067970cca0f1.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Commits](https://github.com/systemd/mkosi/compare/
2a35f9958bc6b82d95d1eac02dc245e9bb068765...
8976a0abb19221e65300222f2d33067970cca0f1)
---
updated-dependencies:
- dependency-name: systemd/mkosi
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Daan De Meyer [Sat, 2 Nov 2024 21:12:27 +0000 (22:12 +0100)]
Two integration test fixes (#34984)
Daan De Meyer [Fri, 1 Nov 2024 20:27:52 +0000 (21:27 +0100)]
TEST-64-UDEV-STORAGE: Don't hardcode device name in long-sysfs-path test
There's no guarantee our device will be named /dev/vda, so give it
a serial so we can query for its devname inside the test.
Daan De Meyer [Fri, 1 Nov 2024 20:27:08 +0000 (21:27 +0100)]
TEST-17-UDEV: Don't hardcode root device name
There's no guarantee the root device will be /dev/sda, so let's use
bootctl to get the actual path instead of harcoding it.
Ronan Pigott [Sat, 2 Nov 2024 02:44:18 +0000 (19:44 -0700)]
pam: quiet a spurious debug message
This singular debug message gets printed even if debug is not enabled.
Quiet this message when debug is not enabled for consistency.