]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoupdate TODO 22519/head
Lennart Poettering [Tue, 15 Mar 2022 13:43:58 +0000 (14:43 +0100)] 
update TODO

3 years agotest: add test that verifies correct order of boot entries
Lennart Poettering [Mon, 7 Mar 2022 17:00:55 +0000 (18:00 +0100)] 
test: add test that verifies correct order of boot entries

3 years agokernel-install: automatically generate "sort-key" field
Lennart Poettering [Tue, 15 Feb 2022 13:27:01 +0000 (14:27 +0100)] 
kernel-install: automatically generate "sort-key" field

Let's order by IMAGE_ID=/ID= by default.

3 years agosd-boot: add comments highlighting type 1 vs. type 2
Lennart Poettering [Tue, 15 Feb 2022 13:26:50 +0000 (14:26 +0100)] 
sd-boot: add comments highlighting type 1 vs. type 2

3 years agosd-boot: make use of new "sort-key" boot loader spec field
Lennart Poettering [Tue, 15 Feb 2022 13:24:53 +0000 (14:24 +0100)] 
sd-boot: make use of new "sort-key" boot loader spec field

3 years agodocs: add new "sort-key" field to boot loader spec
Lennart Poettering [Tue, 15 Feb 2022 13:19:40 +0000 (14:19 +0100)] 
docs: add new "sort-key" field to boot loader spec

This allows snippet generators to explicitly order entries: any string
can be set as an entry's "sort key". If set, sd-boot will use it to sort
entries on display.

New logic is hence (ignore the boot counting logic)

  sort-key is set → primary sort key: sort-key (lexicographically increasing order)
                  → secondary sort key: machine-id (also increasing order)
                  → tertiary sort key: version (lexicographically decreasing order!)

  sort-key is not set → primary sort key: entry filename (aka id), lexicographically increasing order)

With this scheme we can order OSes by their names from A-Z but then put
within the same OS still the newest version first. This should clean up
the order to match expectations more.

Based on discussions here:

https://github.com/systemd/systemd/pull/22391#issuecomment-1040092633

3 years agoRevert "boot: Change boot entry sorting"
Lennart Poettering [Tue, 15 Feb 2022 09:25:37 +0000 (10:25 +0100)] 
Revert "boot: Change boot entry sorting"

This reverts commit 9818ec8ea56e14902ac8e548a0f366dbb259f051.

3 years agoMerge pull request #22784 from poettering/bootctl-fixlets
Lennart Poettering [Fri, 18 Mar 2022 10:53:08 +0000 (11:53 +0100)] 
Merge pull request #22784 from poettering/bootctl-fixlets

Trivial bootctl/kernel-install fixlets

3 years agosystemctl: fix operations on relative paths
Zbigniew Jędrzejewski-Szmek [Wed, 2 Mar 2022 14:29:45 +0000 (15:29 +0100)] 
systemctl: fix operations on relative paths

We should treat ./some.service and $PWD/some.service as equivalent. But we'd
try to send the relative paths over dbus, which can't work well:

$ sudo systemctl enable ./test2.service
Failed to look up unit file state: Invalid argument
$ sudo systemctl enable $PWD/test2.service
Created symlink /etc/systemd/system/multi-user.target.wants/test2.service → /home/zbyszek/src/systemd/test2.service.
Created symlink /etc/systemd/system/test2.service → /home/zbyszek/src/systemd/test2.service.

Now both are equivalent.

3 years agoshared/install-printf: drop now-unused install_path_printf()
Zbigniew Jędrzejewski-Szmek [Tue, 8 Mar 2022 10:49:19 +0000 (11:49 +0100)] 
shared/install-printf: drop now-unused install_path_printf()

3 years agoshared/install: do not print aliases longer than UNIT_NAME_MAX
Zbigniew Jędrzejewski-Szmek [Tue, 8 Mar 2022 10:47:23 +0000 (11:47 +0100)] 
shared/install: do not print aliases longer than UNIT_NAME_MAX

065364920281e1cf59cab989e17aff21790505c4 did the conversion to install_path_printf().
But IIUC, here we are just looking at a unit file name, not the full
path.

3 years agobasic/env-file: inline one variable declaration
Zbigniew Jędrzejewski-Szmek [Thu, 10 Mar 2022 17:29:03 +0000 (18:29 +0100)] 
basic/env-file: inline one variable declaration

3 years agosystemctl: remove unused parameter
Zbigniew Jędrzejewski-Szmek [Mon, 14 Mar 2022 10:42:57 +0000 (11:42 +0100)] 
systemctl: remove unused parameter

3 years agosystemctl: drop left-over parens
Zbigniew Jędrzejewski-Szmek [Thu, 10 Mar 2022 15:48:04 +0000 (16:48 +0100)] 
systemctl: drop left-over parens

3 years agoman/systemd.exec: tweak markup a bit
Zbigniew Jędrzejewski-Szmek [Wed, 9 Mar 2022 13:45:59 +0000 (14:45 +0100)] 
man/systemd.exec: tweak markup a bit

3 years agoshared/install: adjust comment formatting
Zbigniew Jędrzejewski-Szmek [Tue, 8 Mar 2022 15:43:43 +0000 (16:43 +0100)] 
shared/install: adjust comment formatting

3 years agotree-wide: use strv_contains() in more places
Zbigniew Jędrzejewski-Szmek [Mon, 7 Mar 2022 18:28:11 +0000 (19:28 +0100)] 
tree-wide: use strv_contains() in more places

3 years agoshared/install: drop unnecessary casts
Zbigniew Jędrzejewski-Szmek [Wed, 2 Mar 2022 16:19:56 +0000 (17:19 +0100)] 
shared/install: drop unnecessary casts

The compiler coerces to bool for us, no need to do it explicitly.

3 years agoshared/install: drop unnecessary parentheses
Zbigniew Jędrzejewski-Szmek [Wed, 2 Mar 2022 16:17:54 +0000 (17:17 +0100)] 
shared/install: drop unnecessary parentheses

3 years agoshell-completion: Add completion in bootctl
Nishal Kulkarni [Fri, 18 Mar 2022 06:59:36 +0000 (12:29 +0530)] 
shell-completion: Add completion in bootctl

Added new completion for `--make-machine-id-directory`
provideds 3 options(yes no auto)

Closes: #22308
3 years agoshared/install: consistently use 'lp' as the name for the LookupPaths instance
Zbigniew Jędrzejewski-Szmek [Wed, 2 Mar 2022 16:17:39 +0000 (17:17 +0100)] 
shared/install: consistently use 'lp' as the name for the LookupPaths instance

Most of the codebase does this. Here we were using 'p' or 'paths'
instead. Those names are very generic and not good for a "global-like"
object like the LookupPaths instance. And we also have 'path' variable,
and it's confusing to have 'path' and 'paths' in the same function that
are unrelated.

Also pass down LookupPaths* lower in the call stack, in preparation for
future changes.

3 years agoAdd tests and documentation for all remaining sandboxing in user manager
Luca Boccassi [Sat, 12 Mar 2022 21:16:32 +0000 (21:16 +0000)] 
Add tests and documentation for all remaining sandboxing in user manager

3 years agocore: insist on sandboxing if ExtensionImages/Directories are configured
Luca Boccassi [Thu, 17 Mar 2022 23:37:29 +0000 (23:37 +0000)] 
core: insist on sandboxing if ExtensionImages/Directories are configured

Same as other image mounting in the namespace

3 years agosd-device: shorten code a bit
Yu Watanabe [Tue, 8 Mar 2022 05:24:48 +0000 (14:24 +0900)] 
sd-device: shorten code a bit

3 years agosd-device-enumerator: fix typo: contolC -> controlC
Yu Watanabe [Thu, 10 Mar 2022 10:03:23 +0000 (19:03 +0900)] 
sd-device-enumerator: fix typo: contolC -> controlC

Also shorten code a bit.

3 years agosort-util: add missing parens
Yu Watanabe [Sat, 5 Mar 2022 00:43:20 +0000 (09:43 +0900)] 
sort-util: add missing parens

With this, we can call e.g.
```
typesafe_qsort(buf + m, n - m, comp);
```

3 years agobootctl: add comment, explaining when verb_install() is called 22784/head
Lennart Poettering [Thu, 17 Mar 2022 17:54:15 +0000 (18:54 +0100)] 
bootctl: add comment, explaining when verb_install() is called

3 years agobootctl: use faccessat() more
Lennart Poettering [Thu, 17 Mar 2022 17:53:39 +0000 (18:53 +0100)] 
bootctl: use faccessat() more

3 years agobootctl: fix typo
Lennart Poettering [Thu, 17 Mar 2022 17:44:14 +0000 (18:44 +0100)] 
bootctl: fix typo

3 years agokernel-install: drop spurious double empty line
Lennart Poettering [Thu, 17 Mar 2022 17:25:19 +0000 (18:25 +0100)] 
kernel-install: drop spurious double empty line

3 years agokernel-install: make clear which variables are supposed to be placed in install.conf...
Lennart Poettering [Thu, 17 Mar 2022 17:24:51 +0000 (18:24 +0100)] 
kernel-install: make clear which variables are supposed to be placed in install.conf in a comment

3 years agoMerge pull request #22754 from mrc0mmand/creds_dir_specifier
Lennart Poettering [Fri, 18 Mar 2022 08:23:01 +0000 (09:23 +0100)] 
Merge pull request #22754 from mrc0mmand/creds_dir_specifier

core: add %d specifier for the $CREDENTIALS_DIRECTORY

3 years agotree-wide: fix duplicated words
Michael Biebl [Thu, 17 Mar 2022 22:53:03 +0000 (23:53 +0100)] 
tree-wide: fix duplicated words

the the
in in
not not
we we

3 years agoMerge pull request #22752 from yuwata/udev-ctrl-manage-sender-pids
Yu Watanabe [Thu, 17 Mar 2022 22:38:35 +0000 (07:38 +0900)] 
Merge pull request #22752 from yuwata/udev-ctrl-manage-sender-pids

udev: enable Delegate=

3 years agoMerge pull request #22774 from poettering/nspawn-uidmap-fix
Luca Boccassi [Thu, 17 Mar 2022 21:59:29 +0000 (21:59 +0000)] 
Merge pull request #22774 from poettering/nspawn-uidmap-fix

nspawn: uidmap mount fix

3 years agohomed: permit inodes owned by UID_MAPPED_ROOT to be created in $HOME 22774/head
Lennart Poettering [Thu, 17 Mar 2022 14:01:11 +0000 (15:01 +0100)] 
homed: permit inodes owned by UID_MAPPED_ROOT to be created in $HOME

If people use nspawn in their $HOME we should allow this inodes owned by
this special UID to be created temporarily, so that UID mapped nspawn
containers just work.

3 years agonspawn: make sure host root can write to the uidmapped mounts we prepare for the...
Lennart Poettering [Thu, 17 Mar 2022 12:46:12 +0000 (13:46 +0100)] 
nspawn: make sure host root can write to the uidmapped mounts we prepare for the container payload

When using user namespaces in conjunction with uidmapped mounts, nspawn
so far set up two uidmappings:

1. One that is used for the uidmapped mount and that maps the UID range
   0…65535 on the backing fs to some high UID range X…X+65535 on the
   uidmapped fs. (Let's call this mapping the "mount mapping")

2. One that is used for the userns namespace the container payload
   processes run in, that maps X…X+65535 back to 0…65535. (Let's call
   this one the "process mapping").

These mappings hence are pretty much identical, one just moves things up
and one back down. (Reminder: we do all this so that the processes can
run under high UIDs while running off file systems that require no
recursive chown()ing, i.e. we want processes with high UID range but
files with low UID range.)

This creates one problem, i.e. issue #20989: if nspawn (which runs as
host root, i.e. host UID 0) wants to add inodes to the uidmapped mount
it can't do that, since host UID 0 is not defined in the mount mapping
(only the X…X+65536 range is, after all, and X > 0), and processes whose
UID is not mapped in a uidmapped fs cannot create inodes in it since
those would be owned by an unmapped UID, which then triggers
the famous EOVERFLOW error.

Let's fix this, by explicitly including an entry for the host UID 0 in
the mount mapping. Specifically, we'll extend the mount mapping to map
UID 2147483646 (which is INT32_MAX-1, see code for an explanation why I
picked this one) of the backing fs to UID 0 on the uidmapped fs. This
way nspawn can creates inode on the uidmapped as it likes (which will
then actually be owned by UID 2147483646 on the backing fs), and as it
always did. Note that we do *not* create a similar entry in the process
mapping. Thus any files created by nspawn that way (and not chown()ed to
something better) will appear as unmapped (i.e. as overflowuid/"nobody")
in the container payload. And that's good. Of course, the latter is
mostly theoretic, as nspawn should generally chown() the inodes it
creates to UID ranges that actually make sense for the container (and we
generally already do this correctly), but it#s good to know that we are
safe here, given we might accidentally forget to chown() some inodes we
create.

Net effect: the two mappings will not be identical anymore. The mount
mapping has one entry more, and the only reason it exists is so that
nspawn can access the uidmapped fs reasonably independently from any
process mapping.

Fixes: #20989
3 years agobase-filesystem: use uid_is_valid() at one more place
Lennart Poettering [Thu, 17 Mar 2022 11:03:03 +0000 (12:03 +0100)] 
base-filesystem: use uid_is_valid() at one more place

3 years agonspawn: if we refuse to operate on some directory, explain why
Lennart Poettering [Thu, 17 Mar 2022 09:31:55 +0000 (10:31 +0100)] 
nspawn: if we refuse to operate on some directory, explain why

(Also, some refactoring to use safer path_join())

3 years agonspawn: make more stuff const
Lennart Poettering [Thu, 17 Mar 2022 09:02:41 +0000 (10:02 +0100)] 
nspawn: make more stuff const

And if we make it const, we can also make it static.

3 years agonspawn: rebreak all comments in outer_child()
Lennart Poettering [Wed, 16 Mar 2022 17:42:51 +0000 (18:42 +0100)] 
nspawn: rebreak all comments in outer_child()

3 years agoChanged wording in systemd-debug-generator manpage
David [Thu, 17 Mar 2022 17:31:54 +0000 (17:31 +0000)] 
Changed wording in systemd-debug-generator manpage

3 years agocore: add %d specifier for the $CREDENTIALS_DIRECTORY 22754/head
Frantisek Sumsal [Thu, 17 Mar 2022 15:31:07 +0000 (16:31 +0100)] 
core: add %d specifier for the $CREDENTIALS_DIRECTORY

Resolves: #22549

3 years agotest: wait for loopback device being ready to manipulate
Yu Watanabe [Thu, 17 Mar 2022 11:32:50 +0000 (20:32 +0900)] 
test: wait for loopback device being ready to manipulate

Follow-up for 6626ea08f6db3c050b5e05fa760cf0e371862173.

3 years agoupdate TODO
Lennart Poettering [Thu, 17 Mar 2022 15:24:23 +0000 (16:24 +0100)] 
update TODO

3 years agocore: drop an unnecessary initialization
Frantisek Sumsal [Tue, 15 Mar 2022 20:05:58 +0000 (21:05 +0100)] 
core: drop an unnecessary initialization

3 years agoudev: run the main process, workers, and spawned commands in /udev subcgroup 22752/head
Yu Watanabe [Wed, 16 Mar 2022 11:46:49 +0000 (20:46 +0900)] 
udev: run the main process, workers, and spawned commands in /udev subcgroup

And enable cgroup delegation for udevd.
Then, processes invoked through ExecReload= are assigned .control
subcgroup, and they are not killed by cg_kill().

Fixes #16867 and #22686.

3 years agovarlink_error_invalid_parameter(...) always returns EINVAL
Vishal Chillara Srinivas [Thu, 17 Mar 2022 06:19:00 +0000 (11:49 +0530)] 
varlink_error_invalid_parameter(...) always returns EINVAL

varlink_error(...) expects a json object as the third parameter. Passing a string variant causes
parameter sanitization to fail, and it returns -EINVAL. Pass object variant instead.

3 years agorepart: use assert() when no state is changed
Yu Watanabe [Wed, 16 Mar 2022 16:44:31 +0000 (01:44 +0900)] 
repart: use assert() when no state is changed

3 years agocore: ExecContext::restrict_filesystems is set of string
Yu Watanabe [Wed, 16 Mar 2022 18:42:41 +0000 (03:42 +0900)] 
core: ExecContext::restrict_filesystems is set of string

3 years agoMerge pull request #22770 from yuwata/sd-radv-fixes
Yu Watanabe [Thu, 17 Mar 2022 11:09:41 +0000 (20:09 +0900)] 
Merge pull request #22770 from yuwata/sd-radv-fixes

sd-radv: several fixes

3 years agotimedate: use cleanup attribute at one more place
Yu Watanabe [Tue, 15 Mar 2022 07:14:07 +0000 (16:14 +0900)] 
timedate: use cleanup attribute at one more place

3 years agoRevert "udev: do not kill "udevadm control" process in the same cgroup"
Yu Watanabe [Tue, 15 Mar 2022 12:12:40 +0000 (21:12 +0900)] 
Revert "udev: do not kill "udevadm control" process in the same cgroup"

This reverts commit ccadf9ac0d6d206767294b3f96f41eb42b48d1b0.

The fix is not insufficient. See #22686.

3 years agosd-radv: fix indentation 22770/head
Yu Watanabe [Wed, 16 Mar 2022 12:18:57 +0000 (21:18 +0900)] 
sd-radv: fix indentation

3 years agosd-radv: do not use iterater outside of the loop
Yu Watanabe [Wed, 16 Mar 2022 12:16:54 +0000 (21:16 +0900)] 
sd-radv: do not use iterater outside of the loop

3 years agosd-radv: voidify sd_radv_remove_prefix()
Yu Watanabe [Wed, 16 Mar 2022 12:12:37 +0000 (21:12 +0900)] 
sd-radv: voidify sd_radv_remove_prefix()

If the prefix is only referenced by sd_radv, then the returned pointer
is already freed.

networkd does not uses the returned value. Let's voidify the function.

3 years agotpm2: enable parameter encryption
Grigori Goronzy [Sat, 26 Feb 2022 09:41:16 +0000 (10:41 +0100)] 
tpm2: enable parameter encryption

Use a salted, unbound HMAC session with the primary key used as tpmKey,
which mean that the random salt will be encrypted with the primary
key while in transit. Decrypt/encrypt flags are set on the new session
with AES in CFB mode. There is no fallback to XOR mode.

This provides confidentiality and replay protection, both when sealing
and unsealing. There is no protection against man in the middle
attacks since we have no way to authenticate the TPM at the moment.
The exception is unsealing with PIN, as an attacker will be unable
to generate the proper HMAC digest.

3 years agoMerge pull request #22768 from poettering/cgls-delegate-xattr
Anita Zhang [Wed, 16 Mar 2022 21:49:00 +0000 (14:49 -0700)] 
Merge pull request #22768 from poettering/cgls-delegate-xattr

make "delegate" xattr also available for unpriv programs

3 years agoMerge pull request #22761 from poettering/pcr-fix
Lennart Poettering [Wed, 16 Mar 2022 21:32:43 +0000 (22:32 +0100)] 
Merge pull request #22761 from poettering/pcr-fix

sd-boot: change kernel cmdline PCR from 8 to 12

3 years agoMerge pull request #22765 from medhefgo/test
Yu Watanabe [Wed, 16 Mar 2022 18:07:36 +0000 (03:07 +0900)] 
Merge pull request #22765 from medhefgo/test

test: Use TEST macros in more places

3 years agosd-boot: disable bitlocker reboot feature for now
Lennart Poettering [Wed, 16 Mar 2022 11:01:37 +0000 (12:01 +0100)] 
sd-boot: disable bitlocker reboot feature for now

Conceptually the feature is great and should exist, but in its current
form should be worked to be generic (i.e. not specific to
Windows/Bitlocker, but appliable to any boot entry), not be global (but
be a per-entry thing), not require a BootXXXX entry to exist, and not
check for the BitLocker signature (as TPMs are not just used for
BitLocker).

Since we want to get 251 released, mark it in the documentation, in NEWS
and in code as experimental and make clear it will be reworked in a
future release. Also, make it opt-in to make it less likely people come
to rely on it without reading up on it, and understanding that it will
likely change sooner or later.

Follow-up for: #22043
See: #22390

3 years agoMerge pull request #22563 from grigorig/cryptenroll-tpm2-pin
Lennart Poettering [Wed, 16 Mar 2022 17:04:28 +0000 (18:04 +0100)] 
Merge pull request #22563 from grigorig/cryptenroll-tpm2-pin

sd-cryptenroll TPM2 PIN protected unlock

3 years agoNEWS: add entry announcing PCR change 22761/head
Lennart Poettering [Wed, 16 Mar 2022 10:00:27 +0000 (11:00 +0100)] 
NEWS: add entry announcing PCR change

3 years agoman: only document new PCR 12
Lennart Poettering [Wed, 16 Mar 2022 09:50:34 +0000 (10:50 +0100)] 
man: only document new PCR 12

3 years agosd-boot: measure kernel cmdline into PCR 12 rather than 8
Lennart Poettering [Wed, 16 Mar 2022 09:51:03 +0000 (10:51 +0100)] 
sd-boot: measure kernel cmdline into PCR 12 rather than 8

Apparently Grub is measuring all kinds of garbage into PCR 8. Since people
apparently chainload sd-boot from grub, let's thus stay away from PCR 8,
and use PCR 12 instead for the kernel command line.

As discussed here: #22635

Fixes: #22635
3 years agoboot: use UINT32 as type for PCR indexes
Lennart Poettering [Wed, 16 Mar 2022 09:36:39 +0000 (10:36 +0100)] 
boot: use UINT32 as type for PCR indexes

Thisis what the TPM2/UEFI headers use, and most of our EFI codebase.
Let's also use the same type here in cpio.[ch]

3 years agoboot: drop const from EFI_PHYSICAL_ADDRESS parameter
Lennart Poettering [Wed, 16 Mar 2022 09:34:53 +0000 (10:34 +0100)] 
boot: drop const from EFI_PHYSICAL_ADDRESS parameter

It's not a pointer after all, but a numeric value. As such the const
applies to the value and not the target, but we genreally don#t do that
for value parameters. Hence drop the const.

3 years agocgroup: also set user.invocation_id in addition to trusted.invocation_id 22768/head
Lennart Poettering [Wed, 16 Mar 2022 15:47:07 +0000 (16:47 +0100)] 
cgroup: also set user.invocation_id in addition to trusted.invocation_id

Similar thinking as the preceeding commit.

(While we are at it, let's unify some code we use over and over again in
two helper functions)

3 years agodocs: document the user.delegate xattr
Lennart Poettering [Wed, 16 Mar 2022 15:31:24 +0000 (16:31 +0100)] 
docs: document the user.delegate xattr

3 years agocgroup: also indicate cgroup delegation state in user-accessible xattr
Lennart Poettering [Wed, 16 Mar 2022 13:58:57 +0000 (14:58 +0100)] 
cgroup: also indicate cgroup delegation state in user-accessible xattr

So far we set the "trusted.delegate" xattr on cgroups where delegation
is on. This duplicates this behaviour with the "user.delegate" xattr.
This has two benefits:

1. unprivileged clients can *read* the xattr. "systemd-cgls" can thus
   show delegated cgroups as such properly, even when invoked without
   privs

2. unprivileged systemd instances can set the xattr, i.e. when systemd
   --user delegates a cgroup to further payloads.

This weakens security a tiny bit, given that code that got a cgroup
delegated can manipulate the xattr, but I think that's OK, given they
have a higher trust level regarding cgroups anyway, if they got a
subtree delegated, and access controls on the cgroup itself are still
enforced. Moreover PID 1 as the cgroup manager only sets these xattrs,
never reads them — the xattr is primarily a way to tell payloads about
the delegation, and it's strictly this one way.

3 years agotest-journal-syslog: Add some valid priority cases 22765/head
Jan Janssen [Wed, 16 Mar 2022 10:05:13 +0000 (11:05 +0100)] 
test-journal-syslog: Add some valid priority cases

3 years agotest: Use C11 UTF-16 string literal
Jan Janssen [Mon, 14 Mar 2022 09:32:48 +0000 (10:32 +0100)] 
test: Use C11 UTF-16 string literal

3 years agotest: Use TEST macros in more places
Jan Janssen [Mon, 14 Mar 2022 09:37:27 +0000 (10:37 +0100)] 
test: Use TEST macros in more places

3 years agocgroup-show: split out delegation xattr check into its own function
Lennart Poettering [Wed, 16 Mar 2022 13:29:49 +0000 (14:29 +0100)] 
cgroup-show: split out delegation xattr check into its own function

Just some refactoring.

3 years agoupdate TODO
Lennart Poettering [Wed, 16 Mar 2022 10:33:27 +0000 (11:33 +0100)] 
update TODO

3 years agodocs: s/straight-forward/straightforward/
Lennart Poettering [Tue, 15 Mar 2022 16:04:36 +0000 (17:04 +0100)] 
docs: s/straight-forward/straightforward/

Inspired by https://github.com/systemd/systemd/pull/20156#discussion_r810878846

3 years agoMerge pull request #22746 from yuwata/home-cleanups
Luca Boccassi [Tue, 15 Mar 2022 22:44:58 +0000 (22:44 +0000)] 
Merge pull request #22746 from yuwata/home-cleanups

home: two cleanups

3 years agoimport: improve error message
Lennart Poettering [Tue, 15 Mar 2022 17:35:48 +0000 (18:35 +0100)] 
import: improve error message

As suggested: https://github.com/systemd/systemd/pull/20156#discussion_r810941489

3 years agoMerge pull request #22757 from DaanDeMeyer/bpf-error
Luca Boccassi [Tue, 15 Mar 2022 22:42:48 +0000 (22:42 +0000)] 
Merge pull request #22757 from DaanDeMeyer/bpf-error

BPF error logging improvements

3 years agocryptenroll: add tests for TPM2 unlocking 22563/head
Grigori Goronzy [Thu, 24 Feb 2022 00:28:29 +0000 (01:28 +0100)] 
cryptenroll: add tests for TPM2 unlocking

Add tests for enrolling and unlocking. Various cases are tested:

- Default PCR 7 policy w/o PIN, good and bad cases (wrong PCR)
- PCR 7 + PIN policy, good and bad cases (wrong PCR, wrong PIN)
- Non-default PCR 0+7 policy w/o PIN, good and bad cases (wrong PCR 0)

v2: rename test, fix tss2 library installation, fix CI failures
v3: fix ppc64, load module

3 years agocryptsetup: add manual TPM2 PIN configuration
Grigori Goronzy [Fri, 18 Feb 2022 20:13:41 +0000 (21:13 +0100)] 
cryptsetup: add manual TPM2 PIN configuration

Handle the case where TPM2 metadata is not available and explicitly
provided in crypttab. This adds a new "tpm2-pin" option to crypttab
options for this purpose.

3 years agocryptenroll: add TPM2 PIN documentation
Grigori Goronzy [Fri, 18 Feb 2022 11:51:00 +0000 (12:51 +0100)] 
cryptenroll: add TPM2 PIN documentation

3 years agocryptsetup: add libcryptsetup TPM2 PIN support
Grigori Goronzy [Fri, 18 Feb 2022 11:00:12 +0000 (12:00 +0100)] 
cryptsetup: add libcryptsetup TPM2 PIN support

This is unfinished: we don't have any way to actually query for PINs
interactively this way. It is similar to FIDO2 and PKCS#11 in this
regard.

Nonetheless, this code is capable of validating and dumping tokens, so
it is already useful as-is.

3 years agocryptsetup: add support for TPM2 pin
Grigori Goronzy [Fri, 18 Feb 2022 10:56:02 +0000 (11:56 +0100)] 
cryptsetup: add support for TPM2 pin

Extend cryptsetup for TPM2 pin entry, similar to FIDO2.

3 years agocryptenroll: add support for TPM2 pin
Grigori Goronzy [Fri, 18 Feb 2022 10:51:25 +0000 (11:51 +0100)] 
cryptenroll: add support for TPM2 pin

Add support for PIN enrollment with TPM2. A new "tpm2-pin" field is
introduced into metadata to signal that the policy needs to include a
PIN.

v2: fix tpm2_make_luks2_json in sd-repart

3 years agotpm2: support policies with PIN
Grigori Goronzy [Wed, 16 Feb 2022 21:13:42 +0000 (22:13 +0100)] 
tpm2: support policies with PIN

Modify TPM2 authentication policy to optionally include an authValue, i.e.
a password/PIN. We use the "PIN" terminology since it's used by other
systems such as Windows, even though the PIN is not necessarily numeric.

The pin is hashed via SHA256 to allow for arbitrary length PINs.

v2: fix tpm2_seal in sd-repart
v3: applied review feedback

3 years agohmac/sha256: move size define to sha256.h
Grigori Goronzy [Fri, 11 Mar 2022 23:51:21 +0000 (00:51 +0100)] 
hmac/sha256: move size define to sha256.h

3 years agobpf: Fix error handling 22757/head
Daan De Meyer [Tue, 15 Mar 2022 17:14:19 +0000 (17:14 +0000)] 
bpf: Fix error handling

The __open() functions actually set errno on failure so let's
update the error handling to account for that.

3 years agobpf: Log at debug when checking if restricting ifaces is supported
Daan De Meyer [Tue, 15 Mar 2022 17:12:06 +0000 (17:12 +0000)] 
bpf: Log at debug when checking if restricting ifaces is supported

Same change as 1a9e33aee36b4c353628068507ba1dd7d76b6e14 did for
socket-bind.

3 years agohome: use open_image_file() helper at one more place 22746/head
Yu Watanabe [Mon, 14 Mar 2022 07:01:23 +0000 (16:01 +0900)] 
home: use open_image_file() helper at one more place

3 years agoMerge pull request #22745 from yuwata/test-repart-fixes
Frantisek Sumsal [Tue, 15 Mar 2022 11:52:50 +0000 (11:52 +0000)] 
Merge pull request #22745 from yuwata/test-repart-fixes

test: fixes for TEST-58-REPART

3 years agoMerge pull request #22739 from mrc0mmand/list-boot-followup
Yu Watanabe [Tue, 15 Mar 2022 06:59:45 +0000 (15:59 +0900)] 
Merge pull request #22739 from mrc0mmand/list-boot-followup

A couple of follow-ups for #22721

3 years agohome: shorten code a bit and add missing assertions
Yu Watanabe [Sun, 13 Mar 2022 07:17:08 +0000 (16:17 +0900)] 
home: shorten code a bit and add missing assertions

This drops redundant call of fstat(), and reduces indentation.

3 years agotest: wait for loopback device being actually created 22745/head
Yu Watanabe [Mon, 14 Mar 2022 13:02:37 +0000 (22:02 +0900)] 
test: wait for loopback device being actually created

It seems there exists a short time period that we cannot see the
loopback device after `losetup` is finished:
```
testsuite-58.sh[367]: ++ losetup -b 1024 -P --show -f /tmp/testsuite-58-sector-1024.img
kernel: loop1: detected capacity change from 0 to 204800
testsuite-58.sh[285]: + LOOP=/dev/loop1
testsuite-58.sh[285]: + systemd-repart --pretty=yes --definitions=/tmp/testsuite-58-sector/ --seed=750b6cd5c4ae4012a15e7be3c29e6a47 --empty=require --dry-run=no /dev/loop1
testsuite-58.sh[368]: Device '/dev/loop1' has no dm-crypt/dm-verity device, no need to look for underlying block device.
testsuite-58.sh[368]: Failed to determine canonical path for '/dev/loop1': No such file or directory
testsuite-58.sh[368]: Failed to open file or determine backing device of /dev/loop1: No such file or directory
```

3 years agotest: format disk image through loopback device
Yu Watanabe [Sun, 13 Mar 2022 17:26:25 +0000 (02:26 +0900)] 
test: format disk image through loopback device

It seems that the change on the image file sometimes not propagated on
the loopback device immediately.

3 years agotest: use /var/tmp for storing disk images
Yu Watanabe [Sun, 13 Mar 2022 12:38:10 +0000 (21:38 +0900)] 
test: use /var/tmp for storing disk images

The Ubuntu CI on ppc64el seems to have a issue on tmpfs, and files
may not be fsynced. See c10caebb98803b812ebc4dd6cdeaab2ca17826d7.
For safety, let's use /var/tmp to store disk images.

3 years agoMerge pull request #22730 from GeorgesStavracas/gbsneto/multimedia-stream-deck
Luca Boccassi [Mon, 14 Mar 2022 23:40:51 +0000 (23:40 +0000)] 
Merge pull request #22730 from GeorgesStavracas/gbsneto/multimedia-stream-deck

Add AV production devices to hwdb

3 years agounits: fix factory-reset.target description
Vivien Didelot [Mon, 14 Mar 2022 20:34:57 +0000 (16:34 -0400)] 
units: fix factory-reset.target description

The current description for the factory reset target does not add any
value and doesn't respect the definition of the related property as
described in systemd.unit(5).

Starting the target currently results in the following log:

    [   11.139174] systemd[1]: Reached target Target that triggers factory reset. Does nothing by default..
    [  OK  ] Reached target Target that…set. Does nothing by default..

Simply update the target description to "Factory Reset".

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
3 years agojournal: make --reverse affect --list-boots 22739/head
Frantisek Sumsal [Mon, 14 Mar 2022 17:43:03 +0000 (18:43 +0100)] 
journal: make --reverse affect --list-boots

Fixes: #16274
3 years agojournal: use table_set_json_field_name() to override a column name
Frantisek Sumsal [Mon, 14 Mar 2022 17:26:53 +0000 (18:26 +0100)] 
journal: use table_set_json_field_name() to override a column name

Pointed out in: https://github.com/systemd/systemd/pull/22721#discussion_r826014227
Follow-up for: 5a1355d848a0f6564a04c6d8268e72bc93d173de