]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years ago[sd-stub] Add support for aarch64 booting via pe-entry point 20983/head
Max Resch [Mon, 11 Oct 2021 13:15:30 +0000 (15:15 +0200)] 
[sd-stub] Add support for aarch64 booting via pe-entry point

2 years agomove mfree to macro-fundamentals.h
Max Resch [Mon, 11 Oct 2021 23:26:00 +0000 (01:26 +0200)] 
move mfree to macro-fundamentals.h

2 years agocore: remove refcount for bpf program
alexlzhu [Wed, 18 Aug 2021 23:01:05 +0000 (16:01 -0700)] 
core: remove refcount for bpf program

Currently ref count of bpf-program is kept in user space. However, the
kernel already implements its own ref count. Thus the ref count we keep for
bpf-program is redundant.

This PR removes ref count for bpf program as part of a task to simplify
bpf-program and remove redundancies, which will make the switch to
code-compiled BPF programs easier.

Part of #19270

2 years agonetwork: dhcp6-pd: also assign addresses in IA_PD prefixes on uplink interface
Yu Watanabe [Sun, 10 Oct 2021 14:16:09 +0000 (23:16 +0900)] 
network: dhcp6-pd: also assign addresses in IA_PD prefixes on uplink interface

Closes #20808.

2 years agoMerge pull request #20853 from yuwata/network-radv-set-default-timeouts
Zbigniew Jędrzejewski-Szmek [Tue, 12 Oct 2021 08:49:03 +0000 (10:49 +0200)] 
Merge pull request #20853 from yuwata/network-radv-set-default-timeouts

network: RADV: set default timeouts

2 years agosd-boot: Move security and console control protocol to missing_efi.h
Jan Janssen [Thu, 30 Sep 2021 09:12:21 +0000 (11:12 +0200)] 
sd-boot: Move security and console control protocol to missing_efi.h

This also fixes a broken #ifdefs in the header itself.

2 years agosd-boot: Use _cleanup_ in more places
Jan Janssen [Mon, 27 Sep 2021 11:07:16 +0000 (13:07 +0200)] 
sd-boot: Use _cleanup_ in more places

2 years agosd-boot: Remove unnecessary TPM conditionalization
Jan Janssen [Mon, 27 Sep 2021 10:29:00 +0000 (12:29 +0200)] 
sd-boot: Remove unnecessary TPM conditionalization

This is already done in measure.h.

2 years agosd-boot: Use backup LBA location from first GPT header
Jan Janssen [Mon, 27 Sep 2021 10:20:15 +0000 (12:20 +0200)] 
sd-boot: Use backup LBA location from first GPT header

If a disk were dd'd to a lager block device, the last block on it
is not necessarily the backup header.

2 years agosd-boot: Split up xbootldr_open()
Jan Janssen [Mon, 27 Sep 2021 08:54:29 +0000 (10:54 +0200)] 
sd-boot: Split up xbootldr_open()

2 years agosd-boot: Fix xbootldr detection
Jan Janssen [Mon, 27 Sep 2021 08:14:53 +0000 (10:14 +0200)] 
sd-boot: Fix xbootldr detection

The broken crc32 calculation was a copy pasta error introduced in
87167331c902e89bea626c311f0d751ffbc95d73 and luckily has never been
shipped yet.

2 years agosd-boot: Move xbootldr code into its own file
Jan Janssen [Mon, 27 Sep 2021 08:02:50 +0000 (10:02 +0200)] 
sd-boot: Move xbootldr code into its own file

2 years agosd-boot: Invert if in disk_get_part_uuid()
Jan Janssen [Fri, 24 Sep 2021 08:24:38 +0000 (10:24 +0200)] 
sd-boot: Invert if in disk_get_part_uuid()

2 years agoMerge pull request #20985 from yuwata/test-bus-node-enumerator
Yu Watanabe [Tue, 12 Oct 2021 06:20:47 +0000 (15:20 +0900)] 
Merge pull request #20985 from yuwata/test-bus-node-enumerator

test: add more tests for sd-bus node enumerator

2 years agotest: use assert_se() instead of assert()
Yu Watanabe [Mon, 11 Oct 2021 17:39:11 +0000 (02:39 +0900)] 
test: use assert_se() instead of assert()

2 years agoci: use the system llvm-11 package on Focal
Frantisek Sumsal [Mon, 11 Oct 2021 19:12:42 +0000 (21:12 +0200)] 
ci: use the system llvm-11 package on Focal

ATTOW llvm-11 got into focal-updates, which conflicts with llvm-11
provided by the apt.llvm.org repositories. Let's use the system
llvm package if available in such cases to avoid that.

2 years agoMerge pull request #20968 from poettering/homed-pin
Lennart Poettering [Mon, 11 Oct 2021 21:11:03 +0000 (23:11 +0200)] 
Merge pull request #20968 from poettering/homed-pin

homed: pin+lock homes while logged in + keep trying to unmount on logging out + optionally drop caches on logging out

2 years agoMerge pull request #20776 from medhefgo/boot-timeout
Lennart Poettering [Mon, 11 Oct 2021 21:05:37 +0000 (23:05 +0200)] 
Merge pull request #20776 from medhefgo/boot-timeout

sd-boot: Allow disabling timeout

2 years agotest: shorten code a bit 20985/head
Yu Watanabe [Mon, 11 Oct 2021 18:04:06 +0000 (03:04 +0900)] 
test: shorten code a bit

2 years agonetwork: radv: extends lifetime for DNS servers or domains propagated from uplink 20853/head
Yu Watanabe [Tue, 28 Sep 2021 02:45:24 +0000 (11:45 +0900)] 
network: radv: extends lifetime for DNS servers or domains propagated from uplink

Previously, the lifetime was 30 minutes. But it is not necessary to set
to such short time compared with prefix or route prefix lifetime.
Note that the propagated DNS servers and domains are all 'static',
that is, configured in a .network file, and not provided dynamically.
So, it should be safe to use longer lifetime.

2 years agonetwork: radv: set non-zero lifetime for DNS servers and domains by default
Yu Watanabe [Tue, 28 Sep 2021 02:44:27 +0000 (11:44 +0900)] 
network: radv: set non-zero lifetime for DNS servers and domains by default

Closes #20850.

2 years agonetwork: radv: verify [IPv6Prefix] and [IPv6RoutePrefix] sections
Yu Watanabe [Mon, 27 Sep 2021 13:01:14 +0000 (22:01 +0900)] 
network: radv: verify [IPv6Prefix] and [IPv6RoutePrefix] sections

2 years agonetwork: radv: mask unnecessary part of specified addresses
Yu Watanabe [Mon, 27 Sep 2021 13:00:00 +0000 (22:00 +0900)] 
network: radv: mask unnecessary part of specified addresses

2 years agonetwork: radv: make conf parsers not set values into sd_radv_prefix/sd_radv_route_prefix
Yu Watanabe [Mon, 27 Sep 2021 12:07:27 +0000 (21:07 +0900)] 
network: radv: make conf parsers not set values into sd_radv_prefix/sd_radv_route_prefix

Preparation for later commits.

2 years agosd-radv: rename sd_radv_prefix_set_route_prefix() -> sd_radv_route_prefix_set_prefix()
Yu Watanabe [Mon, 27 Sep 2021 12:05:07 +0000 (21:05 +0900)] 
sd-radv: rename sd_radv_prefix_set_route_prefix() -> sd_radv_route_prefix_set_prefix()

2 years agotest: add more node enumerator tests
Yu Watanabe [Mon, 11 Oct 2021 18:02:41 +0000 (03:02 +0900)] 
test: add more node enumerator tests

2 years agoMerge pull request #20981 from poettering/glibc-less-internal
Yu Watanabe [Mon, 11 Oct 2021 17:10:49 +0000 (02:10 +0900)] 
Merge pull request #20981 from poettering/glibc-less-internal

various clean-ups: use less glibc internal symbols, modernize some other stuff

2 years agoMerge pull request #20965 from poettering/getdents
Yu Watanabe [Mon, 11 Oct 2021 17:03:12 +0000 (02:03 +0900)] 
Merge pull request #20965 from poettering/getdents

recurse-dir: use getdents64()

2 years agoMerge pull request #20970 from poettering/token-timeout
Lennart Poettering [Mon, 11 Oct 2021 14:28:58 +0000 (16:28 +0200)] 
Merge pull request #20970 from poettering/token-timeout

cryptsetup: add a timeout for waiting for FIDO2/PKCS#11/TPM2 devices

2 years agoupdate TODO 20968/head
Lennart Poettering [Sat, 28 Aug 2021 05:39:47 +0000 (07:39 +0200)] 
update TODO

2 years agohomed: allow overriding the root directory for home dirs via env var (i.e. use a...
Lennart Poettering [Thu, 7 Oct 2021 20:20:25 +0000 (22:20 +0200)] 
homed: allow overriding the root directory for home dirs via env var (i.e. use a different path than /home/)

This is a debugging feature. It's sometimes incredibly useful to be able
to run a second instance of homed that operates on another dir than
/home/.

Specifically, if you build homed from the source tree you can now run an
instance of it pretty reasonably directly from the build tree via:

  sudo SYSTEMD_HOME_DEBUG_SUFFIX=foo SYSTEMD_HOMEWORK_PATH=$(pwd)/build/systemd-homework SYSTEMD_HOME_ROOT=/home/foo ./build/systemd-homed

And then talk to it via

  sudo SYSTEMD_HOME_DEBUG_SUFFIX=foo homectl …

(you might need to tweak your dbus policy for this to work fully though)

2 years agohomed: optionally, drop caches on logout
Lennart Poettering [Tue, 5 Oct 2021 08:32:25 +0000 (10:32 +0200)] 
homed: optionally, drop caches on logout

Fixes: #20857
2 years agohomed: take BSD file lock on LUKS file while activated
Lennart Poettering [Tue, 5 Oct 2021 08:26:25 +0000 (10:26 +0200)] 
homed: take BSD file lock on LUKS file while activated

Fixes: #19758
2 years agohomed: retry deactivation every 15s until successful
Lennart Poettering [Mon, 30 Aug 2021 11:23:20 +0000 (13:23 +0200)] 
homed: retry deactivation every 15s until successful

Fixes: #17445
2 years agohomed: keep "pinning" fd open while home dir active
Lennart Poettering [Sat, 28 Aug 2021 05:36:25 +0000 (07:36 +0200)] 
homed: keep "pinning" fd open while home dir active

The pin fd keeps the mount busy, ensuring that unmount requests need to
go through us.

Note that this doesn't change too much IRL, since a logged in user
generally has processes keeping the home dir busy anyway. However, in
some corner cases it is safer to protect from accidental unmounts this
way. (e.g. if user manually called "homectl activate" first).

2 years agorm-rf: optionally fsync() after removing directory tree
Lennart Poettering [Tue, 5 Oct 2021 08:32:56 +0000 (10:32 +0200)] 
rm-rf: optionally fsync() after removing directory tree

2 years agovarlink: make one more parameter const
Lennart Poettering [Mon, 11 Oct 2021 13:37:18 +0000 (15:37 +0200)] 
varlink: make one more parameter const

2 years agoutil: define initializer for 'struct ucred' that properly invalidates all fields
Lennart Poettering [Mon, 11 Oct 2021 13:25:14 +0000 (15:25 +0200)] 
util: define initializer for 'struct ucred' that properly invalidates all fields

i.e. let's make sure to invalid uid/gid to UID_INVAID + GID_INVALID
instead of zero.

2 years agovirt: Fix Xen PV detection when nested inside another hypervisor
Bogdan Seniuc [Sat, 9 Oct 2021 12:00:36 +0000 (15:00 +0300)] 
virt: Fix Xen PV detection when nested inside another hypervisor

Currently, when Xen PV domains are nested within a hypervisor which is
detected through CPUID (such as VMware), the detected hypervisor might
not be Xen, because we don't check for Xen until after the CPUID check.

This change moves the Xen check before CPUID checks to fix the issue,
and moves Dom0 checking to detect_vm_xen so that we keep ignoring Xen
when we are in Dom0.

2 years agosd-stub: Provide initrd with LINUX_EFI_INITRD_MEDIA_GUID
Max Resch [Thu, 30 Sep 2021 16:43:52 +0000 (18:43 +0200)] 
sd-stub: Provide initrd with LINUX_EFI_INITRD_MEDIA_GUID

Register a LINUX_EFI_INITRD_MEDIA_GUID DevicePath with a LoadFile2Protocol interface and serve the initrd to a supported Linux kernel (Version 5.8+)
Leave the x86 code for older kernels in place until supported kernels become more mainstream

2 years agosort-util: avoid using glibc's internal __compar_d_fn_t type 20981/head
Lennart Poettering [Mon, 11 Oct 2021 12:03:00 +0000 (14:03 +0200)] 
sort-util: avoid using glibc's internal __compar_d_fn_t type

2 years agorecuse-dir: rework to use getdents64() instead of readdir() 20965/head
Lennart Poettering [Fri, 8 Oct 2021 08:48:52 +0000 (10:48 +0200)] 
recuse-dir: rework to use getdents64() instead of readdir()

Let's use the underlying Linux API directly, instead of
opendir()/readdir(). This makes it possible for us to do a single memory
allocation for all directory entries in common cases, instead of one for
each entry.

2 years agotest-recurse-dir: output some simple timing info, comparing recurse_dir() and nftw()
Lennart Poettering [Fri, 8 Oct 2021 08:47:41 +0000 (10:47 +0200)] 
test-recurse-dir: output some simple timing info, comparing recurse_dir() and nftw()

2 years agomissing: add getdents64() syscall wrapper
Lennart Poettering [Fri, 8 Oct 2021 08:46:02 +0000 (10:46 +0200)] 
missing: add getdents64() syscall wrapper

glibc 2.30 (Aug 2019) added a wrapper for getdents64(). For older
versions let's define our own.

(This syscall exists since Linux 2.4, hence should be safe to use for
us)

2 years agolocaled: use PROJECT_FILE rather than __FILE__ for logging
Lennart Poettering [Mon, 11 Oct 2021 11:56:22 +0000 (13:56 +0200)] 
localed: use PROJECT_FILE rather than __FILE__ for logging

All our log.h code uses PROJECT_FILE for this, let's hence use it here
too.

2 years agoethtool-util: let's use userspace types in userspace code
Lennart Poettering [Mon, 11 Oct 2021 11:50:54 +0000 (13:50 +0200)] 
ethtool-util: let's use userspace types in userspace code

Using kernel types __u32 is fine for headers shared by the kernel, but
if we define something in userspace and only use it in userspace, in our
own .c files, let's stick to userspace fixed-length types.

2 years agotree-wide: use C99 __func__ rather than obsolete __FUNCTION__
Lennart Poettering [Mon, 11 Oct 2021 11:50:29 +0000 (13:50 +0200)] 
tree-wide: use C99 __func__ rather than obsolete __FUNCTION__

We use __func__ almost everywhere, but there are some holdouts. Fix
that.

2 years agonetwork: use official bswap_32() rather than inofficial __bswap_32()
Lennart Poettering [Mon, 11 Oct 2021 11:39:25 +0000 (13:39 +0200)] 
network: use official bswap_32() rather than inofficial __bswap_32()

The former is a macro for the latter, but let's use the official API
(the one that has an API).

2 years agomacro: also use trailing __ for alignof use in attributes
Lennart Poettering [Mon, 11 Oct 2021 11:38:37 +0000 (13:38 +0200)] 
macro: also use trailing __ for alignof use in attributes

While the underscore is optional, the docs say we should suffix and we
do that everywher else. Do so here too.

2 years agostub: also move magic string in stub into .sdmagic PE section
Lennart Poettering [Mon, 11 Oct 2021 11:29:57 +0000 (13:29 +0200)] 
stub: also move magic string in stub into .sdmagic PE section

We already did that for sd-boot, hence do it for sd-stub the same way.

Also, move the __attribute__ stuff to the beginning of the statement,
rather than the middle. Mostly just because we usually put it first for
implementations for identifiers (for prototypes we put it last).

2 years agosort-util: use comparison_fn_t instead of __compar_fn_t
Lennart Poettering [Mon, 11 Oct 2021 11:21:36 +0000 (13:21 +0200)] 
sort-util: use comparison_fn_t instead of __compar_fn_t

Let's avoid using the internal type of glibc, and rather use the one
they officially export.

https://www.gnu.org/software/libc/manual/html_node/Comparison-Functions.html

2 years agosignal-util: don't introduce symbols with double underscores
Lennart Poettering [Mon, 11 Oct 2021 11:18:50 +0000 (13:18 +0200)] 
signal-util: don't introduce symbols with double underscores

ANSI C reserves identifiers beginning with an underscore for compiler
internal stuff. We already invade that namespace plenty and probably
should not. But even going for the doubly underscore prefixed namespace
is a bit too much. Let's just rename the offending table as
"static_signal_table[]", since it lists the static defined signals
rather than the "dynamic" RTSIGMIN/RTSIGMAX signals.

2 years agoMerge pull request #20979 from poettering/ac-power-tweak
Lennart Poettering [Mon, 11 Oct 2021 12:04:51 +0000 (14:04 +0200)] 
Merge pull request #20979 from poettering/ac-power-tweak

tweaks to ac_power()

2 years agoutil: invert ac_power() source type check 20979/head
Lennart Poettering [Mon, 11 Oct 2021 08:54:31 +0000 (10:54 +0200)] 
util: invert ac_power() source type check

So far we assumed every power source was a battery except for the ones
which definitely are not. I think this logic makes little sense, as
"battery" is kinda the exceptional case here, not the other way round.
Hence let's invert the type check, and denylist "Battery" devices rather
than allowlist "Mains" devices.

This should increase compatibility with alternative types of power
sources, in particular USB ones.

This takes into account that additional power types have been added
since we wrote the original code, and in particular should cover the
siutation discussed here OK:

https://sources.debian.org/src/powermgmt-base/1.36/power_supply.txt/#L31
https://sources.debian.org/src/powermgmt-base/1.36/on_ac_power/#L25

Also, modernizes the code in various was ways.

Inspired by and fixes: #20964

2 years agodocs: document $SYSTEMD_CRYPTSETUP_USE_TOKEN_MODULE 20970/head
Lennart Poettering [Mon, 11 Oct 2021 09:15:08 +0000 (11:15 +0200)] 
docs: document $SYSTEMD_CRYPTSETUP_USE_TOKEN_MODULE

2 years agoman: document new token-timeout= setting
Lennart Poettering [Fri, 8 Oct 2021 20:24:50 +0000 (22:24 +0200)] 
man: document new token-timeout= setting

2 years agocryptsetup: minor modernizations
Lennart Poettering [Fri, 8 Oct 2021 20:18:12 +0000 (22:18 +0200)] 
cryptsetup: minor modernizations

2 years agocryptsetup: add a configurable token waiting timeout
Lennart Poettering [Fri, 8 Oct 2021 20:11:06 +0000 (22:11 +0200)] 
cryptsetup: add a configurable token waiting timeout

Let's add  configurable timeout how long to wait for FIDO2/PKCS#11
devices to show up. Once the timeout is hit, let's automatically revert
to querying via passphrase.

Fixes: #19739
2 years agocryptsetup: before querying user for a PIN, check if a FIDO2 device is actually plugg...
Lennart Poettering [Fri, 8 Oct 2021 20:01:44 +0000 (22:01 +0200)] 
cryptsetup: before querying user for a PIN, check if a FIDO2 device is actually plugged in

Before we'd already ask for a PIN just because we know we'll need it
when the token is plugged in. We'd only the try to talk to the device
and notice it actually isn't plugged in. This is quite confusing, as
querying for the PIN suggests we already had a device we are talking to.

Let's hence check if there's actually device before we ask the PIN
question. And if there is none, let's immediately inform the caller, so
that they watch udev and retry once a device has shown up.

2 years agolibfido2-util: add helper that checks whether a FIDO2 device is plugged in
Lennart Poettering [Fri, 8 Oct 2021 19:55:04 +0000 (21:55 +0200)] 
libfido2-util: add helper that checks whether a FIDO2 device is plugged in

2 years agocryptsetup: optionally turn off token module support in libcryptsetup
Lennart Poettering [Fri, 8 Oct 2021 16:26:12 +0000 (18:26 +0200)] 
cryptsetup: optionally turn off token module support in libcryptsetup

This is useful for debugging purposes.

2 years agocryptsetup: don't repeat exact same code twice
Lennart Poettering [Fri, 8 Oct 2021 16:19:49 +0000 (18:19 +0200)] 
cryptsetup: don't repeat exact same code twice

let's move turning off of the cache bit into the for loop, so that we
can eliminate a copy of the loop body.

2 years agofileio: add read_virtual_file_at() flavour that takes dir_fd/path pair
Lennart Poettering [Mon, 11 Oct 2021 08:53:56 +0000 (10:53 +0200)] 
fileio: add read_virtual_file_at() flavour that takes dir_fd/path pair

2 years agoMerge pull request #20744 from yuwata/udev-netlink
Zbigniew Jędrzejewski-Szmek [Mon, 11 Oct 2021 07:40:43 +0000 (09:40 +0200)] 
Merge pull request #20744 from yuwata/udev-netlink

udev: use netlink more aggressively

I'm pasting the comment from https://github.com/systemd/systemd/pull/20744#issuecomment-934485287
which is quite informative. The code wasn't changed significantly since then:

atenart commented 6 days ago:
> I ran tests without (93caec7) and with this PR (06735f2) on Fedora, having a few udev rules
> using attributes eligible to be cached and creating 50 veth on 4 CPUs. Although the time spent
> running the test is variable between runs, I generally saw an improvement when using this PR, e.g:
>
249-910-g93caec7:
> real 0m3.691s
> user 0m0.022s
> sys 0m1.338s
>
249-920-g06735f2:
> real 0m2.950s
> user 0m0.005s
> sys 0m0.399s
>
> On a different system than the one used above, I even saw a 40% improvement; results depend
> on many parameters (distro, udev rules, concurrent daemons accessing sysfs, etc.).
>
> Because it's quite hard to measure the improvement here (as the kernel behave differently between
> the two test cases), I also ran tests using a modified kernel not hitting the trylock logic. There was
> an improvement with this PR as well. (Take this with a grain of salt though, as the kernel was
> modified not using patches approved upstream).

2 years agomacro: fix ALIGN_TO() to use ULLONG_MAX instead of ULONGLONG_MAX
Thomas Haller [Fri, 8 Oct 2021 07:44:39 +0000 (09:44 +0200)] 
macro: fix ALIGN_TO() to use ULLONG_MAX instead of ULONGLONG_MAX

<limits.h> calls this ULLONG_MAX. It's not clear to me where ULONGLONG_MAX
can be found. This seems to be just a mistake.

Fixes: c7ed7187203c ('macro: handle overflow in ALIGN_TO() somewhat reasonably')
2 years agoMerge pull request #20973 from yuwata/busctl-trivial-cleanups
Yu Watanabe [Mon, 11 Oct 2021 05:03:48 +0000 (14:03 +0900)] 
Merge pull request #20973 from yuwata/busctl-trivial-cleanups

busctl: trivial cleanups

2 years agoAvoid passing NULL to underlying fprintf() in sysusers (#20974)
(GalaxyMaster) [Mon, 11 Oct 2021 05:03:15 +0000 (16:03 +1100)] 
Avoid passing NULL to underlying fprintf() in sysusers (#20974)

2 years agotest: add a test for parsing xml obtained by DBus Introspect method 20973/head
Yu Watanabe [Sun, 10 Oct 2021 12:28:18 +0000 (21:28 +0900)] 
test: add a test for parsing xml obtained by DBus Introspect method

2 years agobusctl: add missing header
Yu Watanabe [Sun, 10 Oct 2021 12:15:04 +0000 (21:15 +0900)] 
busctl: add missing header

2 years agobusctl: shorten code a bit
Yu Watanabe [Sun, 10 Oct 2021 10:18:08 +0000 (19:18 +0900)] 
busctl: shorten code a bit

2 years agobusctl: use set_ensure_consume()
Yu Watanabe [Sun, 10 Oct 2021 10:10:56 +0000 (19:10 +0900)] 
busctl: use set_ensure_consume()

2 years agoMerge pull request #20969 from poettering/cryptenroll-no-homed
Yu Watanabe [Sun, 10 Oct 2021 07:00:07 +0000 (16:00 +0900)] 
Merge pull request #20969 from poettering/cryptenroll-no-homed

cryptenroll: politely refuse enrolling keys into homed volumes

2 years agoMerge pull request #20915 from bluca/libsystemd_openssl
Luca Boccassi [Sat, 9 Oct 2021 17:37:59 +0000 (18:37 +0100)] 
Merge pull request #20915 from bluca/libsystemd_openssl

libsystemd/sd-id128: use only internal hmac, remove khash/OpenSSL support

2 years agotest: set 5 minute timeout on TEST-11-ISSUE-3166 and TEST-50-DISSECT
Dimitri John Ledkov [Fri, 8 Oct 2021 11:50:13 +0000 (12:50 +0100)] 
test: set 5 minute timeout on TEST-11-ISSUE-3166 and TEST-50-DISSECT

When they work they finish quickly in under two minutes on slow machines, when
soft lock ups happen in the nested virt machine each test can run for like 5
hours clogging up CI infrastructure. It's best to fail quicker than that when
qemu or kernel are broken.

2 years agoupdate TODO 20969/head
Lennart Poettering [Fri, 8 Oct 2021 15:25:39 +0000 (17:25 +0200)] 
update TODO

2 years agocryptenroll: politely refuse enrolling keys into homed volumes
Lennart Poettering [Fri, 8 Oct 2021 15:26:19 +0000 (17:26 +0200)] 
cryptenroll: politely refuse enrolling keys into homed volumes

People should use homectl to enroll tokens into home directories, hence
point them there. Otherwise the auth data for the account and for the
LUKS volume will end up being different.

2 years agohomed: don't forget to look at all enrolled tokens
Lennart Poettering [Fri, 8 Oct 2021 14:59:35 +0000 (16:59 +0200)] 
homed: don't forget to look at all enrolled tokens

We accidentally increased the token index twice whenever we found our
token. Fix that.

2 years agohomed: use crypt_token_max() where appropriate
Lennart Poettering [Fri, 8 Oct 2021 14:58:42 +0000 (16:58 +0200)] 
homed: use crypt_token_max() where appropriate

Let's use the new crypt_token_max() API in systemd-homework too, to cut
iteration of tokens short.

We already use it in cryptenroll/cryptsetup, so let's use it here too.

2 years agocryptsetup: also define crypt_token_max() as fallback locally, not just sym_crypt_tok...
Lennart Poettering [Fri, 8 Oct 2021 21:48:51 +0000 (23:48 +0200)] 
cryptsetup: also define crypt_token_max() as fallback locally, not just sym_crypt_token_max()

Our code that links directly against libcryptsetup, and doesn't use
dlopen() might want to use this fallback glue function too.

2 years agobootctl: Add set-timeout verb 20776/head
Jan Janssen [Mon, 4 Oct 2021 09:25:50 +0000 (11:25 +0200)] 
bootctl: Add set-timeout verb

Fixes: #18766
2 years agosd-boot: Allow disabling timeout
Jan Janssen [Thu, 16 Sep 2021 08:25:10 +0000 (10:25 +0200)] 
sd-boot: Allow disabling timeout

2 years agotree-wide: assorted Coccinelle fixes
Frantisek Sumsal [Fri, 8 Oct 2021 09:53:23 +0000 (11:53 +0200)] 
tree-wide: assorted Coccinelle fixes

It's that time of year again.

2 years agoAdd benchmark for sha256 calculations 20915/head
Zbigniew Jędrzejewski-Szmek [Fri, 8 Oct 2021 07:35:50 +0000 (09:35 +0200)] 
Add benchmark for sha256 calculations

2 years agotest-id128: split into functions and add the usual headers
Zbigniew Jędrzejewski-Szmek [Fri, 8 Oct 2021 07:29:47 +0000 (09:29 +0200)] 
test-id128: split into functions and add the usual headers

2 years agobasic: remove khash helpers
Luca Boccassi [Thu, 7 Oct 2021 20:49:19 +0000 (21:49 +0100)] 
basic: remove khash helpers

No longer used anywhere. So long, and thanks for all the hashes!

2 years agolibsystemd/sd-id128: use only internal hmac, remove khash/OpenSSL support
Luca Boccassi [Thu, 30 Sep 2021 10:01:45 +0000 (11:01 +0100)] 
libsystemd/sd-id128: use only internal hmac, remove khash/OpenSSL support

Using OpenSSL brings in an additional dependency for all users of
libsystemd.so even though it's just one API that makes use of it.

The khash implementation is awkward as it requires context switches and
computation inside the kernel, thus leaving the process.

Remove both from libsystemd.so, and use exclusively the internal hmac fallback.
While this is not optimized, the sd-id128 API is not used in
performance-critical contexts where hardware acceleration would make a
noticeable difference.

2 years agobasic: add hmac_sha256 implementation
Luca Boccassi [Thu, 7 Oct 2021 20:02:44 +0000 (21:02 +0100)] 
basic: add hmac_sha256 implementation

Based on the FIPS 198 specification. Not optimized and probably
completely unsafe, to be used only for non-strong-cryptographic
purposes when OpenSSL cannot be used.

2 years agoboot/sha256: sd-ify and move to src/fundamental
Luca Boccassi [Thu, 7 Oct 2021 16:15:32 +0000 (17:15 +0100)] 
boot/sha256: sd-ify and move to src/fundamental

2 years agofundamental: define size_t and memcpy for sd-boot
Luca Boccassi [Fri, 8 Oct 2021 12:06:51 +0000 (13:06 +0100)] 
fundamental: define size_t and memcpy for sd-boot

2 years agoMerge pull request #20962 from poettering/dttoif
Lennart Poettering [Fri, 8 Oct 2021 09:14:03 +0000 (11:14 +0200)] 
Merge pull request #20962 from poettering/dttoif

Some tweaks to dirent-util.c

2 years agodirent-util: tweak readdir_ensure_type() a bit 20962/head
Lennart Poettering [Thu, 7 Oct 2021 20:58:43 +0000 (22:58 +0200)] 
dirent-util: tweak readdir_ensure_type() a bit

So far we ignored if readdir_ensure_type() failed, the .d_type would
then still possibly report DT_UNKNOWN, possibly confusing the caller.

Let's make this safer: if we get an error on readdir_ensure_type() then
report it — except if it is ENOENT which indicates the dirent vanished
by now, which is not a problem and we should just skip to the next
entry.

2 years agodirent-util: use statx() in readdir_ensure_type()
Lennart Poettering [Thu, 7 Oct 2021 20:55:20 +0000 (22:55 +0200)] 
dirent-util: use statx() in readdir_ensure_type()

Let's ask exactly for the one field we actually want to know, i.e.
STATX_TYPE.

(While we are at it, also copy over the inode number, if we have it,
simply to report the most recent info we have)

(Also, see AT_NO_AUTOMOUNT, so that we don't trigger automounts here.
After all, if we want to know the inode type of a dirent here, then
there's not need to trigger the automount, the inode type is not going
to change by that.)

2 years agodirent-util: get rid of stat_mode_to_dirent_type()
Lennart Poettering [Thu, 7 Oct 2021 20:23:35 +0000 (22:23 +0200)] 
dirent-util: get rid of stat_mode_to_dirent_type()

Apparently glibc already has a helper for this. (Not in the man pages
for Linux, but FreeBSD does document these cryptic helpers, and its
exported by glibc. That should be good enough for us.)

2 years agodissect: print more useful error messages for two more error cases
Lennart Poettering [Thu, 7 Oct 2021 12:14:02 +0000 (14:14 +0200)] 
dissect: print more useful error messages for two more error cases

2 years agocoredump: Add --all option
Daan De Meyer [Wed, 6 Oct 2021 12:47:46 +0000 (13:47 +0100)] 
coredump: Add --all option

This option has coredumpctl look at all journals instead of only the
local ones. This allows coredumpctl to show information about remote
coredumps if the coredumps are made available in /var/lib/systemd/coredump
and the corresponding journals are made available in /var/log/journal.

This is already possible using the --directory option but --all makes it
more user friendly since users don't have to enter the journal directory
anymore as long as it's available under /var/log/journal.

2 years agoMerge pull request #20910 from poettering/nftw-no-more
Lennart Poettering [Thu, 7 Oct 2021 20:12:41 +0000 (22:12 +0200)] 
Merge pull request #20910 from poettering/nftw-no-more

basic: add recurse_dir() function as modern replacement for nftw()

2 years agonetwork: assert on dereferenced pointer
Luca Boccassi [Thu, 7 Oct 2021 12:34:42 +0000 (13:34 +0100)] 
network: assert on dereferenced pointer

CID#1462762

2 years agoMerge pull request #20778 from yuwata/network-ipv6-token
Yu Watanabe [Thu, 7 Oct 2021 14:24:00 +0000 (23:24 +0900)] 
Merge pull request #20778 from yuwata/network-ipv6-token

network: rework IPv6 address generation mode

2 years agohomed: typo fix
Lennart Poettering [Mon, 4 Oct 2021 21:44:19 +0000 (23:44 +0200)] 
homed: typo fix

2 years agoupdate TODO
Lennart Poettering [Mon, 4 Oct 2021 08:31:04 +0000 (10:31 +0200)] 
update TODO