1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-11 20:58:27 +03:00

72811 Commits

Author SHA1 Message Date
Lennart Poettering
bb4525c8d8 update NEWS 2024-04-18 18:12:24 +02:00
Lennart Poettering
43a59b8b86 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.
2024-04-18 18:12:24 +02:00
Lennart Poettering
0ec4c098dd 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.
2024-04-18 18:12:23 +02:00
Lennart Poettering
d10d4a3701 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.
2024-04-18 18:12:23 +02:00
Lennart Poettering
cb835a2ed1 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!
2024-04-18 18:12:23 +02:00
Lennart Poettering
19d82e1bee tpm2-util: add comment explaining what tpm2_define_policy_nv_index() actually does 2024-04-18 18:12:23 +02:00
Lennart Poettering
371b594414 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
2024-04-18 18:12:23 +02:00
Lennart Poettering
d0f8da9815 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.
2024-04-18 18:12:23 +02:00
Lennart Poettering
98ef5f8419 tpm2: export tpm2_get_name()
We later want to use this from pcrlock.c, hence export it.
2024-04-18 18:12:23 +02:00
Lennart Poettering
9892b7238b 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.
2024-04-18 18:12:23 +02:00
Antonio Alvarez Feijoo
d72835f819 man/systemd-stub: fix typo 2024-04-18 18:10:50 +02:00
Luca Boccassi
61584182f5
Merge pull request #32328 from YHNdnzj/deserialize-objective
core: follow-ups for objective serialization
2024-04-18 17:07:32 +02:00
Lennart Poettering
51286123da
Merge pull request #32330 from poettering/status-invocation
systemctl: show invocation ID in unit status output
2024-04-18 15:47:20 +02:00
Daan De Meyer
7deaddd8a0
Merge pull request #32335 from DaanDeMeyer/fix
mkosi: undefine FORTIFY_SOURCE instead of setting it zero
2024-04-18 15:02:51 +02:00
Daan De Meyer
6c07705213 mkosi: undefine FORTIFY_SOURCE instead of setting it zero
Newer gcc complains if FORTIFY_SOURCE=0 is set so just undefine it
instead.
2024-04-18 14:35:07 +02:00
Mike Yuan
d336b8ee9c
core/manager: log about previous objective
Addresses https://github.com/systemd/systemd/pull/32320#discussion_r1569192295
2024-04-18 20:32:52 +08:00
Mike Yuan
0292afabee
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.
2024-04-18 20:32:20 +08:00
Mike Yuan
37ca2ccf33
core/manager: introduce ManagerObjective string table lookup 2024-04-18 20:32:20 +08:00
Mike Yuan
a48ad66f76
core/manager: also log soft-reboot count along with timespan 2024-04-18 20:25:42 +08:00
Mike Yuan
6985e3964d
core: switch j->unit->manager to j->manager 2024-04-18 20:25:39 +08:00
Daan De Meyer
104c64fae1 mkosi: Disable bash debugging in Arch build script 2024-04-18 14:21:31 +02:00
Daan De Meyer
332f669a6f
Merge pull request #32333 from DaanDeMeyer/mkosi
mkosi: Various improvements
2024-04-18 14:17:44 +02:00
Antonio Alvarez Feijoo
e2fe5c4b98 boot: fix assignment of ret_* variables in initrd_prepare() 2024-04-18 14:13:38 +02:00
Luca Boccassi
82efe05c01
Merge pull request #32326 from jonathan-conder/man_pam_loadkey
man: pam_system_loadkey additions and fixes
2024-04-18 14:10:40 +02:00
Max Staudt
8416dc8bca udev: permanent symlinks with USB revision for /dev/media*
As a follow-up in the style of:
  873be895ed ("udev: add USB revision in ID_PATH")
this patch adds a second symlink for media controllers, this time
including the USB revision.

This means that in addition to persistent symlinks like:
  pci-0000:04:00.3-usb-0:1:1.0-media-controller -> ../../media0

We now also get:
  pci-0000:04:00.3-usbv2-0:1:1.0-media-controller -> ../../media0

...which helps distinguish media devices plugged into different USB root
hubs provided by the same PCI card, at least as long as they are for
different USB revisions.

Fixes: 04f19d6735 ("udev: Add /dev/media/by-path symlinks for media controllers")
2024-04-18 14:09:42 +02:00
Luca Boccassi
ef5f7f9437 systemctl: add --clean= values to documentation and shell completion 2024-04-18 14:07:07 +02:00
Daan De Meyer
a432014b01 mkosi: Install debug packages when WITH_DEBUG=1 is enabled
When we're building debuginfo packages, the original binaries and
libraries are stripped so make sure we install the debuginfo
packages to make sure debugging in the container/VM still works.
2024-04-18 14:01:50 +02:00
Daan De Meyer
35c1ea4d69 mkosi: Setup --ffile-prefix-map= for opensuse as well
This doesn't actually work because the opensuse spec doesn't allow
adding extra build flags, but I'm working on fixing that, so let's
already set things up for later.
2024-04-18 14:01:44 +02:00
Daan De Meyer
15bf8bfb69 mkosi: Undefine FORTIFY_SOURCE before setting it again
Otherwise we get warnings from gcc.
2024-04-18 14:01:06 +02:00
Daan De Meyer
d2c0acaf70 mkosi: Install more packages
Let's install everything we can to get more coverage and make sure
all build outputs are available in mkosi containers or VMs.
2024-04-18 13:32:43 +02:00
Daan De Meyer
6911a9ea7f mkosi: Drop systemd-repart from package lists
This is just a Provides for systemd-udev.
2024-04-18 13:27:05 +02:00
Daan De Meyer
eadf555fd4 mkosi: Update to latest 2024-04-18 13:26:44 +02:00
Luca Boccassi
18d2641236 NEWS: mention GNOME Foundation in contributors list
Sponsored work on homed
2024-04-18 10:46:19 +01:00
Lennart Poettering
f1d345ed76 systemctl: show invocation ID in unit status output
I think we should put more emphasis on the invocation ID as a handle for
a specific runtime cycle of a unit. Let's start with actually showing it
to users.

See: #16035
2024-04-18 11:20:59 +02:00
Jonathan Conder
08ef6998e3 man: document other keyname options for pam_systemd_loadkey 2024-04-18 20:56:58 +12:00
Luca Boccassi
4d3d187493
Merge pull request #32324 from mrc0mmand/more-website-fixes
docs: use absolute links for our pages
2024-04-18 10:55:01 +02:00
Lennart Poettering
778abdbfa1 doc: fix .ssh credential examples
Let's create the .ssh dir with the right perms first.

Suggested by @gcb.

Fixes: #28172
2024-04-18 10:53:20 +02:00
Daan De Meyer
9fede461ca docs: Add note on packages produced by mkosi builds 2024-04-18 09:58:50 +02:00
Yu Watanabe
5e485e1aa2 udev: fix assignment of ret_truncated
Follow-ups for 089bef66316e5bdc91b9984148e5a6455449c1da.
2024-04-18 08:25:03 +02:00
Yu Watanabe
955d5012e0 blockdev-util: fix typo
Follow-up for 33ff155957327f51dde740a7a75f19122bff1ebc.
2024-04-18 13:08:14 +09:00
Yu Watanabe
f846002fa2
Merge pull request #32192 from yuwata/part-scan
blockdev-util: fix detection of partscan
2024-04-18 11:38:48 +09:00
Yu Watanabe
d2a0ef6073
Merge pull request #32249 from CodethinkLabs/vmspawn/predicatable_tap_names
vmspawn: generate predicatable TAP device names and MAC addresses
2024-04-18 10:26:07 +09:00
Yu Watanabe
33ff155957 blockdev-util: also read 'ext_range' sysattr to check if the partscan is enabled
The 'capability' sysattr was deprecated by
e81cd5a983 (v6.3).
2024-04-18 09:48:26 +09:00
Yu Watanabe
705c418f20 sd-device: introduce device_get_sysattr_unsigned_full() 2024-04-18 09:46:57 +09:00
Yu Watanabe
87fe0a6960
man: fix wrong version info (#31949)
Fixes #31920.
2024-04-18 09:45:51 +09:00
MaxHearnden
bccd7be328
systemctl: allow user to suppress output when no action scheduled (#32278) 2024-04-18 09:44:22 +09:00
Winterhuman
ad938537ef
journalctl: update help to say "priority range" (#32323)
Clarify that `-p, --priority=` always treats its option as a priority range, even when given
a single log level per the full man page description.

Co-authored-by: Mike Yuan <me@yhndnzj.com>
2024-04-18 09:43:28 +09:00
Yu Watanabe
258729a3b8
Merge pull request #32308 from yuwata/sd-ndisc-disable-timer-on-recv
sd-ndisc: disable one more timer event source
2024-04-18 09:28:16 +09:00
Yu Watanabe
52fb945cb7
Merge pull request #32318 from YHNdnzj/skip-leading-char
journal-gatewayd: use skip_leading_chars
2024-04-18 06:18:09 +09:00
Jonathan Conder
0bf317b620 man: add pam_gnome_keyring to auth section after pam_systemd_loadkey
This is required because pam_sm_open_session [1] only looks at
gkr_system_authtok, which is copied from the kernel keyring in
pam_sm_authenticate.

[1] https://gitlab.gnome.org/GNOME/gnome-keyring/-/blob/46.1/pam/gkr-pam-module.c?ref_type=tags
2024-04-18 08:32:15 +12:00