]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoupdate TODO 23170/head
Lennart Poettering [Fri, 8 Apr 2022 16:43:50 +0000 (18:43 +0200)] 
update TODO

3 years agotest: test new credential features
Lennart Poettering [Fri, 22 Apr 2022 19:44:26 +0000 (21:44 +0200)] 
test: test new credential features

3 years agodoc: add new markdown docs for credentials
Lennart Poettering [Fri, 22 Apr 2022 13:43:11 +0000 (15:43 +0200)] 
doc: add new markdown docs for credentials

3 years agoman: document the new credentials features
Lennart Poettering [Fri, 22 Apr 2022 13:41:53 +0000 (15:41 +0200)] 
man: document the new credentials features

3 years agocreds-tool: properly search for both encrypted + unencrypted creds
Lennart Poettering [Thu, 21 Apr 2022 14:20:37 +0000 (16:20 +0200)] 
creds-tool: properly search for both encrypted + unencrypted creds

Also, properly hook up things with the new fixed paths for system
credentials.

3 years agopid1: search for creds in LoadCredential=/LoadCredentialEncrypted=
Lennart Poettering [Thu, 21 Apr 2022 13:32:21 +0000 (15:32 +0200)] 
pid1: search for creds in LoadCredential=/LoadCredentialEncrypted=

This adds support for searching for credentials more comprehensively.

Specifically, unless an absolute source path is specified we'll now
search for the credentials in the system credentials first, and then in
/etc/credstore/, /run/credstore/, and /usr/lib/credstore, making these
dirs hence the recommended place for credentials to leave in the system.

For LoadCredentialEncrypted= we'll also look into
/etc/credstore.encrypted/, /run/credstore.encrypted/, …. These dirs are
hence suitable for credentials whose provenience isn't trusted (e.g.
UEFI creds from systemd-stub), and thus require to be authenticated
before use.

3 years agopid1: import creds from sd-stub + qemu + kernel cmdline
Lennart Poettering [Thu, 7 Apr 2022 22:18:55 +0000 (00:18 +0200)] 
pid1: import creds from sd-stub + qemu + kernel cmdline

Let's beef up our system credential game a bit, and explicitly import
creds from sd-stub, from qemu fw_cfg and the kernel cmdline and expose
them in the same way as those passed in from nspawn.

Specifically, this will imprt such credentials to
/run/credentials/@system (if the source can be trusted, as in the
qemu/kernel cmdline case) and /run/credentials/@encrypted (otherwise,
such as sd-stub provided ones).

Once imported we'll set the $CREDENTIALS_PATH env var for PID 1, like it
would be done by a container manager for the payload. (Conversely, we'll
also creat a symlink from /run/credentials/@system to whatever is set in
$CREDENTIALS_PATH in case we are invoked by a container manager, thus
providing a fixed path where system credentials are found).

3 years agopid1: load 'qemu_fw_cfg' kmod super early, so that we can import credentials from it
Lennart Poettering [Thu, 14 Apr 2022 15:52:55 +0000 (17:52 +0200)] 
pid1: load 'qemu_fw_cfg' kmod super early, so that we can import credentials from it

In one of the next commits we want to add support for importing system
credentials from qemu_fw_cfg, very early during boot. (So that we can
use the credentials therein for generators and even earlier). But that
means udev won#t load these modules for us, we have to load them
manually first.

3 years agoMerge pull request #23200 from keszybz/oomd-docs
Zbigniew Jędrzejewski-Szmek [Thu, 28 Apr 2022 15:46:03 +0000 (17:46 +0200)] 
Merge pull request #23200 from keszybz/oomd-docs

Extend the documentation for oomd a bit

3 years agoupdate TODO
Lennart Poettering [Tue, 26 Apr 2022 08:53:47 +0000 (10:53 +0200)] 
update TODO

3 years agoNEWS: updates for 251-rc2
Lennart Poettering [Thu, 28 Apr 2022 15:16:03 +0000 (17:16 +0200)] 
NEWS: updates for 251-rc2

3 years agooomd: "descendent" → "descendant" 23200/head
Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2022 20:08:02 +0000 (22:08 +0200)] 
oomd: "descendent" → "descendant"

The latter is the common spelling apparently.

3 years agoman: direct users to systemd-oomd if they read about OOMPolicy
Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2022 20:05:41 +0000 (22:05 +0200)] 
man: direct users to systemd-oomd if they read about OOMPolicy

OOMPolicy remains valid, but let's push users for the userspace solution.

3 years agoman: beef up the description of systemd-oomd.service
Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2022 20:04:31 +0000 (22:04 +0200)] 
man: beef up the description of systemd-oomd.service

The gist of the description is moved from systemd.resource-control
to systemd-oomd man page. Cross-references to OOMPolicy, memory.oom.group,
oomctl, ManagedOOMSwap and ManagedOOMMemoryPressure are added in all
places.

The descriptions are also more down-to-earth: instead of talking
about "taking action" let's just say "kill". We *might* add configuration
for different actions in the future, but we're not there yet, so let's
just describe what we do now.

3 years agoMerge pull request #23204 from bluca/install_tag
Zbigniew Jędrzejewski-Szmek [Thu, 28 Apr 2022 07:38:29 +0000 (09:38 +0200)] 
Merge pull request #23204 from bluca/install_tag

meson: add install_tag and build alias for systemd-boot, libsystemd and libudev

3 years agohwdb: add keyboard mapping for HP ProBook 11G2
Yu Watanabe [Wed, 27 Apr 2022 08:32:21 +0000 (17:32 +0900)] 
hwdb: add keyboard mapping for HP ProBook 11G2

Closes #23108.

3 years agomeson: add systemd-boot and systemd-stub build target aliases 23204/head
Luca Boccassi [Wed, 27 Apr 2022 21:00:48 +0000 (22:00 +0100)] 
meson: add systemd-boot and systemd-stub build target aliases

Allows to quickly build systemd-boot by itself without having to
reference the full path of the build target:

$ ninja -C foo systemd-stub
ninja: Entering directory `foo'
[21/21] Generating src/boot/efi/linuxx64.efi.stub with a custom command
$ ninja -C foo systemd-boot
ninja: Entering directory `foo'
[10/10] Generating src/boot/efi/systemd-bootx64.efi with a custom command

3 years agomeson: add install_tag to sd-boot, libsystemd and libudev
Luca Boccassi [Wed, 27 Apr 2022 09:54:14 +0000 (10:54 +0100)] 
meson: add install_tag to sd-boot, libsystemd and libudev

Allows to 'meson install --tags systemd-boot --no-rebuild' to install only the EFI
binaries, skipping the rest, for a very quick build:

$ ninja src/boot/efi/linuxx64.efi.stub
[21/21] Generating src/boot/efi/linuxx64.efi.stub with a custom command
$ ninja src/boot/efi/systemd-bootx64.efi
[10/10] Generating src/boot/efi/systemd-bootx64.efi with a custom command
$ DESTDIR=/tmp/foo meson install --tags systemd-boot --no-rebuild
Installing src/boot/efi/systemd-bootx64.efi to /tmp/foo/usr/lib/systemd/boot/efi

Requires Meson 0.60 to be used, prints a warning for unknown keyword
in earlier versions, but there's no failure

https://mesonbuild.com/Installing.html#installation-tags

3 years agoMerge pull request #23206 from yuwata/meson-compression
Luca Boccassi [Wed, 27 Apr 2022 17:27:47 +0000 (18:27 +0100)] 
Merge pull request #23206 from yuwata/meson-compression

meson: follow-ups about compression method

3 years agoMerge pull request #23119 from yuwata/test-sd-device-exclude-bdi
Zbigniew Jędrzejewski-Szmek [Wed, 27 Apr 2022 14:56:53 +0000 (16:56 +0200)] 
Merge pull request #23119 from yuwata/test-sd-device-exclude-bdi

test: exclude "bdi" subsystem

3 years agomeson: also use COMPRESSION_NONE for default compression 23206/head
Yu Watanabe [Wed, 27 Apr 2022 11:49:17 +0000 (20:49 +0900)] 
meson: also use COMPRESSION_NONE for default compression

3 years agomeson: show default compression method in summary
Yu Watanabe [Wed, 27 Apr 2022 11:47:38 +0000 (20:47 +0900)] 
meson: show default compression method in summary

3 years agoMerge pull request #23131 from poettering/shared-compress
Zbigniew Jędrzejewski-Szmek [Wed, 27 Apr 2022 08:47:54 +0000 (10:47 +0200)] 
Merge pull request #23131 from poettering/shared-compress

move compress.[ch] → src/basic/

3 years agotest: exclude "bdi" subsystem and loop block devices 23119/head
Yu Watanabe [Tue, 19 Apr 2022 12:16:53 +0000 (21:16 +0900)] 
test: exclude "bdi" subsystem and loop block devices

On several CI environments, it seems that some loop block devices and
corresponding bdi devices are sometimes removed during the test is
running. Let's exclude them.

Fixes #22970.

3 years agosd-device-enumerator: introduce sd_device_enumerator_add_nomatch_sysname()
Yu Watanabe [Mon, 25 Apr 2022 02:20:11 +0000 (11:20 +0900)] 
sd-device-enumerator: introduce sd_device_enumerator_add_nomatch_sysname()

3 years agosd-device-enumerator: use set_fnmatch()
Yu Watanabe [Mon, 25 Apr 2022 02:19:56 +0000 (11:19 +0900)] 
sd-device-enumerator: use set_fnmatch()

3 years agoset: introduce set_fnmatch()
Yu Watanabe [Mon, 25 Apr 2022 02:07:54 +0000 (11:07 +0900)] 
set: introduce set_fnmatch()

3 years agoMerge pull request #23161 from yuwata/nss-ipv6-disabled
Lennart Poettering [Tue, 26 Apr 2022 20:52:09 +0000 (22:52 +0200)] 
Merge pull request #23161 from yuwata/nss-ipv6-disabled

nss: do not return IPv6 address when IPv6 is disabled

3 years agojournal-verify: tighten check for compression of non-objects 23131/head
Lennart Poettering [Wed, 20 Apr 2022 14:08:36 +0000 (16:08 +0200)] 
journal-verify: tighten check for compression of non-objects

3 years agocompress: make Compression a regular non-sparse enum
Lennart Poettering [Wed, 20 Apr 2022 14:06:14 +0000 (16:06 +0200)] 
compress: make Compression a regular non-sparse enum

Given we have two different types for the journal object flags and the
Compression enum, let's make the latter a regular non-sparse enum, and
thus remove some surprises. We have to convert anyway between the two,
and already do via COMPRESSION_FROM_OBJECT().

3 years agobasic: move compress.[ch] → src/basic/
Lennart Poettering [Wed, 20 Apr 2022 13:35:28 +0000 (15:35 +0200)] 
basic: move compress.[ch] → src/basic/

The compression helpers are used both in journal code and in coredump
code, and there's a good chance we'll use them later for other stuff.

Let's hence move them into src/basic/, to make them a proper internal
API we can use from everywhere where that's desirable. (pstore might be
a candidate, for example)

No real code changes, just some moving around, build system
rearrangements, and stripping of journal-def.h inclusion.

3 years agopo: update italian translations
Daniele Medri [Tue, 26 Apr 2022 14:22:27 +0000 (16:22 +0200)] 
po: update italian translations

3 years agoci: unpin CFLite
Evgeny Vereshchagin [Fri, 22 Apr 2022 21:06:39 +0000 (21:06 +0000)] 
ci: unpin CFLite

The idea was to catch CFLite regressions but since the action itself
pulls the latest docker images it can't be pinned properly and issues
like https://github.com/google/clusterfuzzlite/issues/91 are going to
pop up anyway. Let's unpin it by analogy with CIFuzz and hope it doesn't
break very often.

3 years agooomd: actually fail if configuration is bad
Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2022 06:54:39 +0000 (08:54 +0200)] 
oomd: actually fail if configuration is bad

Follow-up for a858355e4a7168625ec1b9e5d17fdb6a11dfecb8.

3 years agoMerge pull request #23160 from keszybz/compress-defines
Zbigniew Jędrzejewski-Szmek [Mon, 25 Apr 2022 08:57:51 +0000 (10:57 +0200)] 
Merge pull request #23160 from keszybz/compress-defines

meson: simplify setting of default compression

3 years agotest: use cp for journal copying when systemd-journal-remote non-existent
wangyuhang [Sun, 24 Apr 2022 07:31:33 +0000 (15:31 +0800)] 
test: use cp  for journal copying when systemd-journal-remote non-existent

3 years agotree-wide: Fix typo
Yu Watanabe [Mon, 25 Apr 2022 01:06:08 +0000 (10:06 +0900)] 
tree-wide: Fix typo

3 years agotree-wide: Simplify variable declarations behind #ifdef
Jan Janssen [Sat, 23 Apr 2022 13:53:29 +0000 (15:53 +0200)] 
tree-wide: Simplify variable declarations behind #ifdef

3 years agoloopback-setup: tweak message if loopback device is already set up
Lennart Poettering [Fri, 22 Apr 2022 19:41:17 +0000 (21:41 +0200)] 
loopback-setup: tweak message if loopback device is already set up

3 years agotest: extend the "hashed" unit names coverage a bit
Frantisek Sumsal [Fri, 22 Apr 2022 16:03:14 +0000 (18:03 +0200)] 
test: extend the "hashed" unit names coverage a bit

Follow-up to #22759.

3 years agoudevadm: wait: check if specified path not exist on --remove
Yu Watanabe [Fri, 22 Apr 2022 18:01:25 +0000 (03:01 +0900)] 
udevadm: wait: check if specified path not exist on --remove

Even if the corresponding device node or syspath are already removed,
the specified symlink to the device node may still exist.

Fixes #23166.

3 years agotest: do not accept IPv6 local address if IPv6 is disabled 23161/head
Yu Watanabe [Fri, 22 Apr 2022 01:31:55 +0000 (10:31 +0900)] 
test: do not accept IPv6 local address if IPv6 is disabled

3 years agonss-myhostname: do not return IPv6 local address if IPv6 is disabled
Yu Watanabe [Fri, 22 Apr 2022 01:31:22 +0000 (10:31 +0900)] 
nss-myhostname: do not return IPv6 local address if IPv6 is disabled

3 years agocryptenroll,homectl: Introduce --fido2-credential-algorithm option
MkfsSion [Sun, 17 Apr 2022 07:42:49 +0000 (15:42 +0800)] 
cryptenroll,homectl: Introduce --fido2-credential-algorithm option

* Some authenticators(like Yubikey) support credential algorithm other than ES256
* Introduce a new option so users can make use of it

3 years agohwdb: Fix rotation for HP Pro Tablet 408 G1
Lance [Fri, 22 Apr 2022 11:22:34 +0000 (04:22 -0700)] 
hwdb: Fix rotation for HP Pro Tablet 408 G1

3 years agohwdb: Remap micmute to f20 for ASUS WMI hotkeys
Benjamin Berg [Fri, 22 Apr 2022 13:59:34 +0000 (15:59 +0200)] 
hwdb: Remap micmute to f20 for ASUS WMI hotkeys

For micmute userspace handles both micmute and f20, as Xorg cannot
handle the high keycode that the micmute key has. As such, adding the
remapping means that the key will work on Xorg clients and not just when
using wayland.

3 years agodocs: suggest to erase /var/lib/systemd/credential.secret when preparing golden images
Lennart Poettering [Fri, 22 Apr 2022 13:00:48 +0000 (15:00 +0200)] 
docs: suggest to erase /var/lib/systemd/credential.secret when preparing golden images

3 years agoupdate TODO
Lennart Poettering [Fri, 22 Apr 2022 13:00:30 +0000 (15:00 +0200)] 
update TODO

3 years agoMerge pull request #23157 from poettering/execute-refactor-fix
Lennart Poettering [Fri, 22 Apr 2022 13:51:41 +0000 (15:51 +0200)] 
Merge pull request #23157 from poettering/execute-refactor-fix

execute: refactor credential passing code, and fix two bugs

3 years agomeson: use a single constant for default compression setting 23160/head
Zbigniew Jędrzejewski-Szmek [Fri, 22 Apr 2022 11:10:07 +0000 (13:10 +0200)] 
meson: use a single constant for default compression setting

Suggested by Daniele Nicolodi:
https://github.com/systemd/systemd/pull/23160#discussion_r855853716

This is possible only if the macro is never used in #if, but only in C code.
This means that all places that use #if have to be refactored into C, but we
reduce the duplication a bit, and C is nicer to read than preprocessor
conditionals.

3 years agomeson: simplify setting of default compression
Zbigniew Jędrzejewski-Szmek [Thu, 21 Apr 2022 22:24:01 +0000 (00:24 +0200)] 
meson: simplify setting of default compression

Follow-up for da13d2ca0731b413841663052f2cc6832a855334. Instead of having
separate definitions of the bitmask flags, just define DEFAULT_COMPRESSION_FOO=0|1
directly.

(It *should* be possible to do this more simply, but the problem is that
anything that is used in #if cannot refer to C constants or enums. This is the
simplest I could come up with that preserves the property that we don't use #ifdef.)

The return value from compress_blob() is changed to propagate the error instead
of always returning -EOPNOTSUPP. The callers don't care about the specific error
value. compress_blob_*() are changed to return the compression method on success, so
that compress_blob() can be simplified. compress_stream_*() and compress_stream() are
changed in the same way for consistency, even though the callers do not currently use
this information (outside of tests).

3 years agotest: also test nspawn system→service inheritance of creds 23157/head
Lennart Poettering [Fri, 22 Apr 2022 09:31:00 +0000 (11:31 +0200)] 
test: also test nspawn system→service inheritance of creds

3 years agotest: make sure that SetCredential=/LoadCredential fallback won#t regress
Lennart Poettering [Thu, 21 Apr 2022 15:35:38 +0000 (17:35 +0200)] 
test: make sure that SetCredential=/LoadCredential fallback won#t regress

3 years agoexecute: add more debug logging
Lennart Poettering [Thu, 14 Apr 2022 16:08:36 +0000 (18:08 +0200)] 
execute: add more debug logging

3 years agoexecute: restore ability that SetCredential= can act as fallback for LoadCredential=
Lennart Poettering [Thu, 14 Apr 2022 16:01:28 +0000 (18:01 +0200)] 
execute: restore ability that SetCredential= can act as fallback for LoadCredential=

If SetCredential= and LoadCredentials= are combined for the same
credential name, then the former shall act as fallback for the latter in
case the source file does not exist. That's documented, but didn't work.
Let's fix that.

3 years agoexecute: restore ability to propagate creds from further up (i.e. container manager...
Lennart Poettering [Wed, 13 Apr 2022 21:35:15 +0000 (23:35 +0200)] 
execute: restore ability to propagate creds from further up (i.e.  container manager and such)

This was broken in 3989bdc1ad7cca4d75c06cdf601fea2cb37ba337 let's
restore the functionality.

Basically, we want that if a relative name is specified as source to
load from we take it relative to the credentials dir the service manager
itself got passed.

3 years agoexecute: share error path between reg file/dir credential loading
Lennart Poettering [Wed, 13 Apr 2022 21:07:26 +0000 (23:07 +0200)] 
execute: share error path between reg file/dir credential loading

3 years agoexecute: correct comments
Lennart Poettering [Wed, 13 Apr 2022 21:05:38 +0000 (23:05 +0200)] 
execute: correct comments

This is not done first, but second.

Also, while we are at it, explain why faccessat() is OK here.

3 years agoexecute: sort directory entries when loading credentials recursively
Lennart Poettering [Wed, 13 Apr 2022 21:03:22 +0000 (23:03 +0200)] 
execute: sort directory entries when loading credentials recursively

Given that the recusive credential loading allows two ways to load the
same credentials, it's important to define a clear order so that it is
always the same one that wins.

i.e. if you use LoadCredential=foobar:/tmp/xyz and there are two files
/tmp/xyz/abc/cde and /tmp/xyz/abc_cde these would both result in a
credential foobar_abc_cde being set, hence it is important to make clear
which one shall win, and that it is always the same one.

3 years agoexecute: drop 'seen_creds' set
Lennart Poettering [Wed, 13 Apr 2022 21:01:16 +0000 (23:01 +0200)] 
execute: drop 'seen_creds' set

When checking whether we already loaded a credential before, let's just
use faccessat() in the credential dir we are populating. First of all,
we already do it exactly that way when appliying SetCredential= settings
later. Secondly, this is not performance relevant, and by using
faccessat() things simply become a lot simpler.

3 years agoexecute: simplify 'load_creds_args' struct a bit
Lennart Poettering [Wed, 13 Apr 2022 20:51:13 +0000 (22:51 +0200)] 
execute: simplify 'load_creds_args' struct a bit

Given we only need a single field off the ExecLoadCredential structure
we don't have to link it as a whole, but just copy that one bit over
directly, simplifying the struct a bit.

3 years agoexecute: let recurse_dir() concate the cred name for us
Lennart Poettering [Wed, 13 Apr 2022 20:48:30 +0000 (22:48 +0200)] 
execute: let recurse_dir() concate the cred name for us

recurse_dir() allows specifiying a freely choosable initial path to
which to append the subdirs as it descends into the tree. If we pass the
configured id there, recurse_dir() will suffix the subdir to that for
us, so that we don't have to do that manually anymore in the callback,
simplifying things a bit.

3 years agoexecute: passing NULL as second argument for recurse_dir() is equivalent to ""
Lennart Poettering [Wed, 13 Apr 2022 16:51:02 +0000 (18:51 +0200)] 
execute: passing NULL as second argument for recurse_dir() is equivalent to ""

3 years agoexecute: debug log if a generated recursive cred name is too long
Lennart Poettering [Wed, 13 Apr 2022 16:51:56 +0000 (18:51 +0200)] 
execute: debug log if a generated recursive cred name is too long

3 years agoexecute: rework load_credential() not to take an ExecLoadCredential object we must...
Lennart Poettering [Wed, 13 Apr 2022 16:43:02 +0000 (18:43 +0200)] 
execute: rework load_credential() not to take an ExecLoadCredential object we must synthesize

Let's just simplify the logic and pass the fields we need as regular
arguments, even if that means the function now has a lot. It's otherwise
really weird that we have to fake a local ExecLoadCredential from the
real one.

3 years agoexecute: drop double empty line
Lennart Poettering [Wed, 13 Apr 2022 16:52:10 +0000 (18:52 +0200)] 
execute: drop double empty line

3 years agoexecute: use ASSERT_PTR where appropriate
Lennart Poettering [Wed, 13 Apr 2022 16:51:47 +0000 (18:51 +0200)] 
execute: use ASSERT_PTR where appropriate

3 years agoupdate TODO
Lennart Poettering [Thu, 21 Apr 2022 08:37:12 +0000 (10:37 +0200)] 
update TODO

3 years agotpm2-util: if we run in a container, ignore /sys/class/tpmrm/* contents
Lennart Poettering [Thu, 21 Apr 2022 09:24:37 +0000 (11:24 +0200)] 
tpm2-util: if we run in a container, ignore /sys/class/tpmrm/* contents

3 years agohwdb: add resolutions for the Vaio FE14 touchpad (#23136)
davijosw [Fri, 22 Apr 2022 01:41:37 +0000 (22:41 -0300)] 
hwdb: add resolutions for the Vaio FE14 touchpad (#23136)

3 years agokernel-install: Skip execution if $KERNEL_INSTALL_BYPASS=1
Daan De Meyer [Thu, 21 Apr 2022 12:47:23 +0000 (14:47 +0200)] 
kernel-install: Skip execution if $KERNEL_INSTALL_BYPASS=1

3 years agomkosi: Update to latest commit
Daan De Meyer [Wed, 20 Apr 2022 17:10:22 +0000 (19:10 +0200)] 
mkosi: Update to latest commit

We recently added caching for the dependencies we build from source
in mkosi's github action which speeds up builds by +-10 minutes. Let's
update to the latest commit so we benefit from this in systemd's mkosi
CI as well.

3 years agooss-fuzz: turn off fuzz-introspector
Evgeny Vereshchagin [Thu, 21 Apr 2022 18:00:43 +0000 (18:00 +0000)] 
oss-fuzz: turn off fuzz-introspector

fuzz-introspector passes -fuse-ld=gold and -flto using CFLAGS/LDFLAGS and due to
https://github.com/mesonbuild/meson/issues/6377#issuecomment-575977919 and
https://github.com/mesonbuild/meson/issues/6377 it doesn't mix well with meson.
It's possible to build systemd with duct tape there using something like
https://github.com/google/oss-fuzz/pull/7583#issuecomment-1104011067 but
apparently even with gold and lto some parts of systemd are missing from
reports (presumably due to https://github.com/google/oss-fuzz/issues/7598).
Let's just fail here for now to make it clear that fuzz-introspector isn't supported.

3 years agoman: make clear that encrypted credentials are also authenticated
Lennart Poettering [Thu, 21 Apr 2022 13:36:03 +0000 (15:36 +0200)] 
man: make clear that encrypted credentials are also authenticated

We use authenticated encryption, and that deserves mention. This in
particular relevant as the fact they are authenticated makes the
credentials useful as initrd parameterization items.

3 years agohostnamed: update to use new style sd-bus macros
Sonali Srivastava [Thu, 21 Apr 2022 11:07:13 +0000 (16:37 +0530)] 
hostnamed: update to use new style sd-bus macros

3 years agobus-unit-util: make sure we can set LoadCredentials= property with a single string
Lennart Poettering [Thu, 14 Apr 2022 15:57:33 +0000 (17:57 +0200)] 
bus-unit-util: make sure we can set LoadCredentials= property with a single string

LoadCredentials= in unit files supports a syntax passing a single string
only (in which case the credentials are propagated down from the host).
but systemd-run's --property= setting doesn't allow that yet. Fix that.

3 years agoMerge pull request #23148 from poettering/creds-util-mini-tweaks
Lennart Poettering [Thu, 21 Apr 2022 13:07:45 +0000 (15:07 +0200)] 
Merge pull request #23148 from poettering/creds-util-mini-tweaks

creds-util: two minor tweaks

3 years agohwdb 60-keyboard Add HP/Compaq KBR0133
Matthew Blythe [Thu, 21 Apr 2022 06:50:13 +0000 (00:50 -0600)] 
hwdb 60-keyboard Add HP/Compaq KBR0133

3 years agocreds-util: upgrade message about TPM2 not working 23148/head
Lennart Poettering [Thu, 14 Apr 2022 21:19:02 +0000 (23:19 +0200)] 
creds-util: upgrade message about TPM2 not working

3 years agocreds-util: also warn about unencrypted creds host key if we are creating it
Lennart Poettering [Thu, 14 Apr 2022 21:18:49 +0000 (23:18 +0200)] 
creds-util: also warn about unencrypted creds host key if we are creating it

Previously we'd only warn when we consume it, but it's even more
relevant to warn if we save it to an unencrypted storage location.

3 years agomain: voidify call to kmod_setup()
Lennart Poettering [Thu, 21 Apr 2022 08:37:12 +0000 (10:37 +0200)] 
main: voidify call to kmod_setup()

3 years agosd-bus: switch to a manual overflow check in sd_bus_track_add_name()
Lennart Poettering [Wed, 20 Apr 2022 20:30:22 +0000 (22:30 +0200)] 
sd-bus: switch to a manual overflow check in sd_bus_track_add_name()

This is generally used in a directly client controllable way, hence we
should handle ref count overflow gracefully, instead of hitting an
assert().

As discussed:

https://github.com/systemd/systemd/pull/23099#discussion_r854341850

3 years agomacro: upgrade ref counting overflow check assert() → assert_se()
Lennart Poettering [Wed, 20 Apr 2022 20:10:43 +0000 (22:10 +0200)] 
macro: upgrade ref counting overflow check assert() → assert_se()

The overflow check for ref counting should not be subject to NDEBUG,
hence upgrade assert() → assert_se(). (The check for zero is an
immediate bug in our code, and should be impossible to trigger, hence
it's fine if the check is optimized away if people are crazy enough to
set NDEBUG, so that can stay assert())

https://github.com/systemd/systemd/pull/23099#discussion_r854341850

3 years agoupdate TODO
Lennart Poettering [Wed, 20 Apr 2022 21:19:57 +0000 (23:19 +0200)] 
update TODO

3 years agoMerge pull request #23122 from poettering/creds-has-tpm2
Lennart Poettering [Wed, 20 Apr 2022 21:18:02 +0000 (23:18 +0200)] 
Merge pull request #23122 from poettering/creds-has-tpm2

tpm2: beef up tpm2 support checks

3 years agoman: update TPM2 PCR documentation
Lennart Poettering [Thu, 14 Apr 2022 12:38:52 +0000 (14:38 +0200)] 
man: update TPM2 PCR documentation

The assignments were partly simply incorrectly documented, partly changed
with 4d32507f5186a89e98093659fbbe386787a97b9f and partly missing.
Moreover kernel 5.17 now measures all initrds to PCR 9 on its own
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f046fff8bc4c4d8f8a478022e76e40b818f692df)

Let's correct all this and bring it up-to-date.

And while we are at it extend the docs about this in systemd-stub, with
a new table that indicates which OS resource is protected by which PCR.

3 years agoMerge pull request #23084 from poettering/creds-no-tpm2-fallback
Yu Watanabe [Wed, 20 Apr 2022 19:11:19 +0000 (04:11 +0900)] 
Merge pull request #23084 from poettering/creds-no-tpm2-fallback

creds: add semi-automatic fallback support for initrd credentials on systems lacking TPM2

3 years agoMerge pull request #23099 from yuwata/sd-bus-track-fixlets
Lennart Poettering [Wed, 20 Apr 2022 16:23:05 +0000 (18:23 +0200)] 
Merge pull request #23099 from yuwata/sd-bus-track-fixlets

sd-bus: fix counter

3 years agoupdate TODO 23084/head
Lennart Poettering [Thu, 14 Apr 2022 14:20:45 +0000 (16:20 +0200)] 
update TODO

3 years agocreds-util: permit credentials encrypted/signed by fixed zero length keys as fallback...
Lennart Poettering [Thu, 14 Apr 2022 12:46:40 +0000 (14:46 +0200)] 
creds-util: permit credentials encrypted/signed by fixed zero length keys as fallback for systems lacking TPM2

This is supposed to be useful when generating credentials for immutable
initrd environments, where it is is relevant to support credentials even
on systems lacking a TPM2 chip.

With this, if `systemd-creds encrypt --with-key=auto-initrd` is used a
credential will be encrypted/signed with the TPM2 if it is available and
recognized by the firmware. Otherwise it will be encrypted/signed with
the fixed empty key, thus providing no confidentiality or authenticity.

The idea is that distributions use this mode to generically create
credentials that are as locked down as possible on the specific
platform.

3 years agocreds-util: add an explicit 128bit ID for identifying "automatic" key determination
Lennart Poettering [Thu, 14 Apr 2022 13:37:54 +0000 (15:37 +0200)] 
creds-util: add an explicit 128bit ID for identifying "automatic" key determination

Previously, when encrypting creds you could pick which key to use for
this via a 128bit ID identifying the key type, and use an all zero ID
for rquesting automatic mode.

Let's change this to use an explicitly picked 128bit ID for automatic
mode, i.e. something other than all zeros. This is in preparation for
adding one further automatic mode with slightly different semantics.

no change in behaviour.

Note that the new 128bit id is never written to disk but only used
internally to indicate a specific case.

3 years agocreds-util: refuse unexpected key types explicitly
Lennart Poettering [Thu, 14 Apr 2022 13:26:02 +0000 (15:26 +0200)] 
creds-util: refuse unexpected key types explicitly

3 years agoMerge pull request #23124 from yuwata/fixes-for-post-merge-review
Daan De Meyer [Wed, 20 Apr 2022 15:15:40 +0000 (17:15 +0200)] 
Merge pull request #23124 from yuwata/fixes-for-post-merge-review

Fixes for post merge review

3 years agoman: document new has-tpm2 verb 23122/head
Lennart Poettering [Tue, 19 Apr 2022 13:08:23 +0000 (15:08 +0200)] 
man: document new has-tpm2 verb

3 years agocreds-tool: add new "has-tpm2" verb
Lennart Poettering [Tue, 19 Apr 2022 12:47:02 +0000 (14:47 +0200)] 
creds-tool: add new "has-tpm2" verb

Sometimes it's useful from shell scripts to check if we have a working
TPM2 chip around. For example, when putting together encrypted
credentials for the initrd (after all: it might be wise to place the
root pw in a credential for the initrd to consume, but do so only if we
can lock it to the TPM2, and not otherwise, so that we risk nothing).

Hence, let's add a new "systemd-creds has-tpm2" verb: it returns zero if we
have a working TPM2 (which means: supported by kernel + firmware + us),
or non-zero otherwise. Also show which parts are available.

Use-case: in future the 'kernel-install' script should use this when
deciding whether to augment kernels with security sensitive credentials.

3 years agobootctl: use new tpm2_support() helper to show TPM2 info
Lennart Poettering [Tue, 19 Apr 2022 12:45:20 +0000 (14:45 +0200)] 
bootctl: use new tpm2_support() helper to show TPM2 info

Let's improve the output regarding TPM2 support in "bootctl": let's show
whether we have local driver support and/or firmware support, and
colorize it.

(For now, don't show if we natively support TPM2, since the tool is
mostly bout boot time stuff, where it dosn't really matter much what we
do in userspace)

3 years agocondition: rework ConditionSecurity=tpm2 check on top of tpm2_support()
Lennart Poettering [Tue, 19 Apr 2022 12:44:26 +0000 (14:44 +0200)] 
condition: rework ConditionSecurity=tpm2 check on top of tpm2_support()

No change in behaviour. Let's just use our new helper here.

3 years agotpm2-util: add helper that checks for the various facets of TPM2 support
Lennart Poettering [Tue, 19 Apr 2022 12:42:27 +0000 (14:42 +0200)] 
tpm2-util: add helper that checks for the various facets of TPM2 support

So far we were a bit sloppy regarding checks for TPM2 support. Let's
make things more precise and introduce a single helper that checks for
three axis of TPM2 support: whether we have a loaded kernel driver,
whether the firmware used it, and whether we ourselves are compiled for
it.

This only adds the helper. Follow-up patches will use it at various
places.

3 years agoupdate TODO
Lennart Poettering [Wed, 20 Apr 2022 13:32:10 +0000 (15:32 +0200)] 
update TODO

3 years agoupdate TODO
Lennart Poettering [Wed, 20 Apr 2022 12:49:43 +0000 (14:49 +0200)] 
update TODO