Commit Graph
7363 Commits
Author SHA1 Message Date
Dan Streetman f230572f56 tpm2: add tpm2_get_pin_auth()
Add function to calculate the hash digest for a provided pin, and also verify
that the final byte in the digest is not 0. This is required because the TPM
will always remove all trailing 0's from an auth value before using it.

Fixes: #27716
2023-07-16 01:18:03 +01:00
Luca Boccassi 9027aff9d4 Merge pull request #27867 from keszybz/vconsole-reload-again
Restore ordering between vconsole-setup and firstboot services
2023-07-14 23:06:18 +01:00
Luca Boccassi 224029fcaa Merge pull request #28097 from goenkam/maanya/dissect-tool-support-for-confext
systemd-confext: image-based systemd-wide config update including dm-verity support​
2023-07-14 23:01:26 +01:00
Dan Streetman 730d6ab930 tpm2: handle older tpm enrollments without a saved pcr bank
Older code did not save the pcr bank (i.e. pcr hash algorithm), and instead let
tpm2_unseal() find the best pcr bank to use. In commit
2cd9d57548 we changed tpm2_unseal() to no longer
handle an unset pcr bank. This adds back in the handling of an unset pcr_bank
so older sealed data should continue to work.
2023-07-14 22:55:51 +01:00
Frantisek Sumsal be492020ec tree-wide: a bunch of Coccinelle-suggested tweaks
rc2 edition
2023-07-14 22:49:01 +01:00
Yu Watanabe 8ced74d76b compare: fix typo 2023-07-15 05:11:30 +09:00
Maanya Goenka 484d26dac1 confext: add dissect tool support for confext images
Allow image wide systemd tool support for confext images by adding dissect
tool support for these images
2023-07-14 16:59:34 +00:00
Luca Boccassi 0865c465ca Merge pull request #26365 from dtardon/multiple-polkit-calls
Allow D-Bus methods to auth. for more than one polkit action
2023-07-14 14:13:53 +01:00
Daan De Meyer 6d4f612c70 Merge pull request #28376 from yuwata/json_append
Use json_append() and json_variant_append_array()
2023-07-14 10:07:48 +02:00
Mike Yuan 35df78cd88 fstab-util: add fstab_is_bind 2023-07-14 01:27:02 +08:00
David Tardon b1ebc20137 bus-polkit: avoid extra variable 2023-07-13 16:40:30 +02:00
David Tardon 2f50a4f38f bus-polkit: allow to auth. a bus call for multiple actions
In #20155, verify_shutdown_creds() needs to authenticate for both
org.freedesktop.login1.hibernate-multiple-sessions and
org.freedesktop.login1.hibernate-ignore-inhibit . Previously, the second
authentication attempt would fail with -ESTALE.

Fixes #20155.
2023-07-13 16:40:05 +02:00
David Tardon 959301cf9f bus-polkit: parse reply from polkit on receive
... and store just the result.
2023-07-13 16:29:17 +02:00
David Tardon c71901b247 bus-polkit: extract action into a separate struct
This is a preparation for later commits.
2023-07-13 16:29:17 +02:00
David Tardon 361c4ee82f bus-polkit: describe async. polkit verification 2023-07-13 16:29:16 +02:00
David Tardon 0df66e42fa bus-polkit: refactor a bit to avoid goto 2023-07-13 16:00:06 +02:00
David Tardon 8f7195ef3c bus-polkit: drop unused argument 2023-07-13 16:00:06 +02:00
David Tardon 10ee1413f6 bus-polkit: use automatic cleanup 2023-07-13 16:00:06 +02:00
Zbigniew Jędrzejewski-Szmek a8425c53eb core: adjust indentation
One of the two conditionals in the function had different indentation than the
other.
2023-07-13 10:56:52 +02:00
Yu Watanabe ddd6875d19 logs-show: use json_variant_append_array() 2023-07-13 17:06:47 +09:00
Yu Watanabe c22dcd67e1 tpm2-util: use json_variant_append_array() 2023-07-13 17:06:29 +09:00
Lennart Poettering d89457a145 loop-write: do strlen() implicitly if size is specified as SIZE_MAX
This reduces repetition in the function calls, since quite often we
write out strings with loop_write().

Noticed while reviewing #28077.
2023-07-13 09:59:28 +09:00
Daan De Meyer 608aa606cf Merge pull request #28365 from DaanDeMeyer/udevadm-query
Various fixes and improvements
2023-07-12 21:48:04 +02:00
Daan De Meyer a9e536a6bc logs-show: Rename json_data to JsonData and add typedef 2023-07-12 20:05:20 +02:00
Daan De Meyer ee9d31a608 json: free array in json_variant_unref_many()
This allows using it with CLEANUP_ARRAY(). For the 2 call sites
where we don't need to free the array, we do a regular for loop
calling json_variant_unref() instead.
2023-07-12 20:05:20 +02:00
Daan De Meyer a1af83728f device-util: Declare iterator variables inline 2023-07-12 20:05:18 +02:00
Lennart Poettering 8620854aa1 Merge pull request #28344 from YHNdnzj/compare-device-node
hibernate-resume: add & use devnode_same to compare device nodes
2023-07-12 17:59:28 +02:00
Yu Watanabe 627cdcc785 tree-wide: fix typos reported by Fossies Codespell report 2023-07-12 10:14:50 +09:00
Mike Yuan 2d5c53fc34 shared/device-nodes: add devnode_same 2023-07-11 18:01:49 +08:00
Yu Watanabe 26b682e816 seccomp: add arm_fadvise64_64 to system-service group
fadvise64 and fadvise64_64 are already in the group, but arm_ version
was not.

Fixes #28350.
2023-07-11 11:54:09 +02:00
Mike Yuan 898f4da326 shared/async: don't use WEXITED for waitpid()
Follow-up for c26d7837bb

waitpid() doesn't support WEXITED and returns -1 (EINVAL),
which results in the intermediate close process not getting
reaped.

Fixes https://github.com/systemd/systemd/issues/26744#issuecomment-1628240782
2023-07-11 12:08:09 +08:00
Mike Yuan f7b1d37c77 shared/async: prefix process name with sd- 2023-07-11 12:08:09 +08:00
Yu Watanabe 4b3b330a32 Merge pull request #28343 from poettering/daemon-reload-common
tree-wide: add common implementation of Reload() bus call to PID 1
2023-07-11 08:42:19 +09:00
Daan De Meyer 05dc415015 Merge pull request #28333 from DaanDeMeyer/tpm-support-dlopen
tpm2-util: Only assume system support if we can dlopen() the tpm libraries
2023-07-10 18:14:17 +02:00
Lennart Poettering a93993584d bus-unit-util: add common code for reloading PID 1
We have this very similar code in various places, and it#s not entirely
obvious (since we want a prolonged timeout for the reload), hence unify
this at one place.
2023-07-10 16:39:16 +02:00
Daan De Meyer 3393104984 tpm2-util: Check for dlopen() when calculating tpm2 support 2023-07-10 14:26:51 +02:00
Xeonacid ca15fc4820 seccomp: add riscv_hwprobe to @default
This syscall is for probing hardware capabilities from userspace and should do no harm.
Added in https://github.com/torvalds/linux/commit/ea3de9ce8aa280c5175c835bd3e94a3a9b814b74
2023-07-09 02:26:51 +08:00
Luca Boccassi b2deaaf01b Merge pull request #27584 from rphibel/add-restartquick-option
service: add new RestartMode option
2023-07-06 20:37:31 +01:00
Luca Boccassi 25cae3e7bb Merge pull request #20425 from Blarse/passwdqc-pr
Add passwdqc support
2023-07-06 20:36:04 +01:00
Luca Boccassi f00022eb86 Merge pull request #28242 from berrange/cond-sec-cvm
Detect and expose the confidential virtualization technology in various places
2023-07-06 19:14:26 +01:00
Richard Phibel e568fea9fc service: add new RestartMode option
When this option is set to direct, the service restarts without entering a failed
state. Dependent units are not notified of transitory failure.

This is useful for the following use case:

We have a target with Requires=my-service, After=my-service.
my-service.service is a oneshot service and has Restart=on-failure in
its definition.

my-service.service can get stuck for various reasons and time out, in
which case it is restarted. Currently, when it fails the first time, the
target fails, even though my-service is restarted.

The behavior we're looking for is that until my-service is not restarted
anymore, the target stays pending waiting for my-service.service to
start successfully or fail without being restarted anymore.
2023-07-06 14:33:52 +02:00
Daniel P. Berrangé 95d043b159 unit: add "cvm" option for ConditionSecurity
The "cvm" flag indicates whether the OS is running inside a confidential
virtual machine.

Related: https://github.com/systemd/systemd/issues/27604
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-07-06 12:20:04 +01:00
Egor IgnatovandDmitry V. Levin 1d8aae4327 shared: add libpasswdqc support
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Resolves: #15055
2023-07-06 10:59:41 +00:00
Joerg Behrmann 5bc9ea070f treewide: fix "an" before consonant U sounds
The article "a" goes before consonant sounds and "an" goes before vowel
sounds. This commit changes an to a for UKI, UDP, UTF-8, URL, UUID, U-Label, UI
and USB, since they start with the sound /ˌjuː/.
2023-07-06 11:59:41 +01:00
Egor IgnatovandDmitry V. Levin d34b1823ca shared: add password quality check abstraction layer to support both pwquality and passwdqc
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
2023-07-06 10:59:41 +00:00
Dmitry V. Levin bc0ef0e2c0 pwquality: add old password argument to quality_check_password
This would allow to use quality_check_password() in
user_record_quality_check_password() which still uses
sym_pwquality_check() directly.
2023-07-06 10:59:41 +00:00
Dmitry V. Levin 0351d560a2 pwquality: do not log password suggestions
As logging password suggestions might leak sensitive information,
print it instead.

Suggested-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2023-07-06 10:59:41 +00:00
Dmitry V. Levin 7fc3f9c032 pwquality: fix quality_check_password return value
quality_check_password() used to return the same value 0 in two
different cases: when pwq_allocate_context() failed with a
ERRNO_IS_NOT_SUPPORTED() code, and when pwquality_check() rejected the
password.  As result, users of quality_check_password() used to report
password weakness also in case when the underlying library was not
available.

Fix this by changing quality_check_password() to forward the
ERRNO_IS_NOT_SUPPORTED() code to its callers, and change the callers
to handle this case gracefully.
2023-07-06 10:59:41 +00:00
Dmitry V. Levin 29dd2e253c pwquality: fix use of ERRNO_IS_NOT_SUPPORTED
Given that ERRNO_IS_*() also match positive values, call
ERRNO_IS_NOT_SUPPORTED() only if the value returned by
pwq_allocate_context() is negative.
2023-07-06 10:59:41 +00:00
Antonio Alvarez Feijoo 0a3d108f46 tpm2-util: remove unnecessary semicolon 2023-07-06 10:44:23 +01:00