Commit Graph
79704 Commits
Author SHA1 Message Date
Martin Wilck 505c2f2137 libfido2-util: accept cached pin in fido2_generate_hmac_hash()
fido2_generate_hmac_hash() sets req->keyring to "fido2-pin" when
calling ask_password_auto(), suggesting that a key by this name
can be read from the kernel keyring. But the keyring is never
opened because the ASK_PASSWORD_ACCEPT_CACHED flag is not set.

Set ASK_PASSWORD_ACCEPT_CACHED to allow automated / scripted
setup of encrypted volumes with FIDO2. If the PIN turns out to
be invalid, clear ASK_PASSWORD_ACCEPT_CACHED to avoid retrying
and possible lockout.
2025-02-27 17:35:47 +01:00
Lennart Poettering 250118f3f0 sbsign: Add support for offline signing (#36485)
Add new options --prepare-offline-signing, --signed-data= and
--signed-data-signature= which allow for offline signing in a
similar manner to pesign.
2025-02-27 17:34:05 +01:00
Lennart Poettering cf20b5d1dc units: measure additional phases into PCR 11 when entering storage target mode or factory reset (#36543)
Let's "spoil" access to TPM secrets when we boot into these two modes.
This matters in particular for storagetm: if the host gets exploited
while booted into storage target mode any secrets kept by the TPM might
remain accessible otherwise. By measuring a new "phase" word into PCR 11
we "blow the fuse" however on this boot.
2025-02-27 15:29:48 +01:00
Daan De Meyer d9c7d47f99 Update TODO 2025-02-27 14:55:00 +01:00
Daan De Meyer 8c0098d486 sbsign: Add support for offline signing
Add new options --prepare-offline-signing, --signed-data= and
--signed-data-signature= which allow for offline signing in a
similar manner to pesign.
2025-02-27 13:47:07 +01:00
Daan De Meyer 6f3ef02067 sbsign: Split out functions and switch to lower level APIs
Preparation for adding offline signing support. Some additional
features and fixes are included as well:

- We make sure to add an empty SMIMECAP attribute instead of a populated
  one to mimick pesign more.
- We switch to PKCS7_dataFinal() instead of PKCS7_final() as all that the
  latter does is an unnecessary copy before calling PKCS7_dataFinal().
- We add support for passing in the signing time via $SOURCE_DATE_EPOCH.
2025-02-27 13:47:05 +01:00
Lennart Poettering bc9414832d man: clean up how we name our PEM files in examples (#36541)
Kinda a follow-up for 2cc58b6c8a
2025-02-27 13:27:42 +01:00
Lennart Poettering 6ee3bc046b units: measure "factory-reset" into PCR 11 when we request factory reset
Let's make sure that the moment where factory reset is requested is
visible in the TPM PCR state, so that access to secrets is terminated.

This is particulary interesting when the system is booted with
systemd.unit=factory-reset.target on the kernel command line, requesting
a factory reset on the following boot. The preparations done in
userspace should already lose access to the TPM in that case.
2025-02-27 13:20:23 +01:00
Lennart Poettering b493502475 units: measure the fact we enter storage target mode into TPM
storagetm mode means we we are network accessible. let's lock down
access to TPM secrets in this case: let's measure a pcr "phase" string
into PCR 11.

This is good as it means that if we are exploited in this state FDE
secrets protected by TPM are likely to remain protected, since the PCR
values wouldn't allow access.
2025-02-27 13:20:23 +01:00
Lennart Poettering 2f093d8364 man: follow our own naming rules more closely
In some examples we inserted "-initrd" after the "public-key" instead of
before when naming PEM files. Let's fix that, and stick to common
suffixes.
2025-02-27 10:08:50 +01:00
Lennart Poettering da468d61ee man: follow our certificate/public-key/private-key PEM file naming rules
In 2cc58b6c8a and related we established
rules on naming certs/public-keys/private-keys:

*-public-key.pem
*-private-key.pem
*-certificate.pem

Let's follow that naming in repart's man page too.
2025-02-27 10:08:39 +01:00
Daan De Meyer f0372d5883 sbsign: Copy source to dest later
Preparation for later commit.
2025-02-27 10:03:42 +01:00
Daan De Meyer d8877019fb keyutil: Use fopen_tmpfile_linkable() 2025-02-27 10:03:29 +01:00
Daan De Meyer 27e040f742 keyutil: Reword pkcs7 documentation string a little 2025-02-27 10:03:12 +01:00
Daan De Meyer d46b16aff2 openssl-util: Introduce pkcs7_new() 2025-02-27 09:52:38 +01:00
Daan De Meyer ba6a904442 sbsign: Fix wrong variable being passed to log_error_errno() 2025-02-27 09:49:03 +01:00
Daan De Meyer d9e41bfe02 exec-invoke: Fix unshare() error handling (#36537) 2025-02-27 09:16:07 +01:00
Daan De Meyer f215835cb8 exec-invoke: Fix invalid use of error variable
Follow up for 406f177501
2025-02-27 09:15:22 +01:00
Daan De Meyer c78b06b1d2 exec-invoke: Fix unshare() error handling
Follow up for cd58b5a135
2025-02-27 09:15:03 +01:00
Yu Watanabe 768cda38e6 storagetm: fix typo
Follow-up for 1761066b13.
2025-02-27 13:48:34 +09:00
Yu Watanabe 44dc0c8c51 test: fix typo
Follow-up for f01132aacf.
2025-02-27 13:42:09 +09:00
Yu Watanabe cf4b70aac4 docs: fix typo
Follow-ups for d5de148996.
2025-02-27 13:37:20 +09:00
Yu Watanabe 98fc082c31 man: fix typo
Follow-up for f8825c1364.
2025-02-27 13:37:20 +09:00
Yu Watanabe 71427850a3 journal-remote: fix typo
Follow-up for c259c9e253.
2025-02-27 13:37:20 +09:00
Yu Watanabe 4bfbf0fcdf network: fix typo
Follow-up for 6698795eda.
2025-02-27 13:37:20 +09:00
Jaroslav Škarvada 9d7b2daef0 hwdb: add GOLD WARRIOR SIM PhoenixRC 10411R
Fixes #36522
2025-02-27 12:40:08 +09:00
Daan De Meyer 461bd9277a meson: Add missing dbus_programs dependency on update-dbus-docs
All dbus programs have to be up-to-date for update-dbus-docs to
produce the expected output, so add the missing dependency.
2025-02-27 12:39:52 +09:00
Yu Watanabe 587124d587 pam_systemd/pam_systemd_home: various fixes (#36505) 2025-02-27 12:37:05 +09:00
Mike Yuan c337a1301f core/service: do not propagate reload for combined RELOADING=1 + READY=1 when notify-reload
Follow-up for 3bd28bf721

SERVICE_RELOAD_SIGNAL state can only be reached via explicit reload jobs,
and we have a clear distinction between that and plain RELOADING=1
notifications, the latter of which is issued by clients doing reload
outside of our job engine. I.e. upon SERVICE_RELOAD_SIGNAL + RELOADING=1
we don't propagate reload jobs again, since that's done during transaction
construction stage already. The handling of combined RELOADING=1 + READY=1
so far is bogus however, as it tries to propagate duplicate reload jobs.
Amend this by following the logic for standalone RELOADING=1.
2025-02-26 23:41:33 +00:00
Justinas Kairys ecf85d8389 po: Translated using Weblate (Lithuanian)
Currently translated at 69.6% (179 of 257 strings)

Co-authored-by: Justinas Kairys <j.kairys@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/lt/
Translation: systemd/main
2025-02-27 08:21:40 +09:00
Lennart Poettering 4ec864162d update TODO 2025-02-26 22:07:05 +01:00
Lennart Poettering 263ea62468 test: extend test case to validate per-area $XDG_RUNTIME_DIR 2025-02-26 22:07:05 +01:00
Lennart Poettering cfb7abc7fc pam_systemd: complement per-area $HOME management with per-area $XDG_RUNTIME_DIRECTORY mgmt
When a user logs into a non-default area we give them a private
$HOME for that area (that's what 'area' is supposed to be after all). We
so far left $XDG_RUNTIME_DIRECTORY as it was. Let's change that and
mirror the subdirectory logic there too.

Why? $XDG_RUNTIME_DIR is generally the place where AF_UNIX sockets are
bound that can be used to connect to per-user services. (in particular
all those which are behind D-Bus.) If we don't patch $XDG_RUNTIME_DIR
like this then this means all the backing services will use the main
area, which is problematic (since clients and services will disagree on
$HOME), and makes it impossible to support the area concept for
graphical logins properly.

This does not actually make graphical logins work, but it at least makes
them fail cleanly. That's because this patch alone won't make sure a
per-area service manager/dbus instance is invoked automatically. That
however can be added later, in a patch to logind.
2025-02-26 22:07:05 +01:00
Lennart Poettering e35b78f14f pam-systemd: rework update_environment()
Let's tweak update_environment() a bit: instead of being a NOP when no
value is specified, let's actively unset the specified environment
variable if it is set.

This shouldn't change much, since for the cases we call the function so
far the env vars in question should not be set before us in a way we'd
set them differently. However, this is nice preparation for later, as we
can make use of this for XDG_AREA which we might want to unset if we
consider the area dir invalid.
2025-02-26 18:29:19 +01:00
Lennart Poettering c9802426cf pam-systemd: modernize export_legacy_dbus_address() a bit
Let's log about unexpected access() failures among other things
2025-02-26 18:29:19 +01:00
Lennart Poettering 9a4f9e84c4 pam_systemd_home: tweak order in authentication stack
Let's move pam_systemd_home before pam_unix in the authentication hook.

Since a while we are exposing shadow entries for homed log entries via
NSS. This means that pam_unix now potentially has enough data for
authenticating a user on its own, without letting pam_systemd_home do
that. This is superficially OK, but also means that authentication will
always go via password, even if pkcs11/fido2 is registered.

Let's move this around, but be careful about it: let's list the precise
errors which we think are enough to terminating further PAM processing,
so that pam_unix comes into control in all cases where it's not clear
that pam_systemd_home owns the user record.

This previously wasn't visible to me, because on Fedora until authselect
1.5.1 (released earleir this year) the NSS shadow stuff was not enabled.

This does the same also for the "account" stack, except that the order
there already was as we want it.

Finally, shorten the account stack, by just requiring pam_unix.so and
dropping pam_permit.so, because it doesn't really serve much purpose
(and Fedora doesn't use it by default either.)
2025-02-26 18:12:08 +01:00
Lennart Poettering 5856e869bb pam_systemd_home: update comment
Follow-up for 563c5511ad, which turned
boolean parameters into flags.
2025-02-26 18:12:08 +01:00
Lennart Poettering c63c6413e7 fs-util: add some assert()s 2025-02-26 18:12:04 +01:00
Lennart Poettering 14871a6529 efivars: kill SystemdOptions efi var support
This has been depracted since v254 (2023). Let's kill it for
good now, it has been long enough with 2y. Noone has shown up who wants
to keep it. And given it doesn't work in SB world anyway, and is not
measured is quite problematic security wise.
2025-02-26 17:28:43 +01:00
Daan De Meyer 2dbc2d1d0f docs: Use mkosi -R instead of mkosi -t none (#36528)
mkosi now supports -R to rerun build scripts without rebuilding the
image so let's document that instead of the current hack to prevent
the rebuild by changing the output format.
2025-02-26 15:56:51 +01:00
Lennart Poettering 9287ec34d5 udev: make gcc static check shut up, regarding strncpy() 2025-02-26 15:43:15 +01:00
Lennart Poettering eee056443b udev: modernize udev-builtin-btrfs a bit
Let's in particular log an even if a device name is too long for the
btrfs ioctl structure, instead of truncating it (which could
theoretically reference a different device).
2025-02-26 15:06:06 +01:00
Lennart Poettering f36b0ec14b notify-recv: several followups, port pid1 over too (#36492) 2025-02-26 15:05:46 +01:00
Daan De Meyer 031a474c91 docs: Use mkosi -R instead of mkosi -t none
mkosi now supports -R to rerun build scripts without rebuilding the
image so let's document that instead of the current hack to prevent
the rebuild by changing the output format.
2025-02-26 14:58:53 +01:00
Daan De Meyer 6ccb14af88 mkosi: Update to latest 2025-02-26 14:58:39 +01:00
Mike Yuan c578bf6e17 Expose chassis asset tag in hostnamed (#36487)
Closes #36442
2025-02-26 14:28:26 +01:00
Antonio Alvarez Feijoo 5d2d0c055b import/pull-tar: fix flag set
There is a typo passing flags to `install_file()`, if `IMPORT_READ_ONLY` is set,
`IMPORT_SYNC` is never checked.
2025-02-26 13:06:31 +00:00
Mike Yuan 5d09689b5c core/manager: port to notify_recv_with_fds() 2025-02-26 13:27:39 +01:00
Mike Yuan 4a5b06c5d1 shared/async: introduce asynchronous_close_many() helper 2025-02-26 13:02:28 +01:00
Mike Yuan 74cd56d31b notify-recv: several followups
Follow-up for 7f6af95dab

- Allocate internal buf on the stack, memdup() only at the end.
  This ensures we're able to handle OOM gracefully, i.e.
  return -EAGAIN on OOM while still emptying socket buffer.
- Do not treat empty notify message as error.
- Raise log level since all callers log loudly anyway.
2025-02-26 13:02:23 +01:00