]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoloop-util: work around cache invalidation bug in older kernels 21044/head
Lennart Poettering [Mon, 18 Oct 2021 20:34:54 +0000 (22:34 +0200)] 
loop-util: work around cache invalidation bug in older kernels

Inspired by the discussions in #21003.

Inspired in particular by what Android apexd does:

https://android.googlesource.com/platform/system/apex/+/refs/heads/master/apexd/apexd_loop.cpp

4 years agoloop-util: enable LO_FLAGS_DIRECT_IO by default on loopback devices
Lennart Poettering [Mon, 18 Oct 2021 15:23:30 +0000 (17:23 +0200)] 
loop-util: enable LO_FLAGS_DIRECT_IO by default on loopback devices

Fixes: #21003
4 years agoMerge pull request #20905 from medhefgo/boot-cleanup
Lennart Poettering [Tue, 19 Oct 2021 08:23:12 +0000 (10:23 +0200)] 
Merge pull request #20905 from medhefgo/boot-cleanup

sd-boot: Code cleanups

4 years agoMerge pull request #20988 from DaanDeMeyer/rotate-reason
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 07:53:31 +0000 (09:53 +0200)] 
Merge pull request #20988 from DaanDeMeyer/rotate-reason

journal: Improve rotation logging

4 years agoMerge pull request #21037 from yuwata/network-dhcp6-pd-simplify-distribute
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 07:24:38 +0000 (09:24 +0200)] 
Merge pull request #21037 from yuwata/network-dhcp6-pd-simplify-distribute

network: dhcp6-pd: simplify dhcp6_pd_prefix_distribute()

4 years agoMerge pull request #21036 from yuwata/network-dhcp6-pd-manage-prefix-with-hashmap
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 07:22:32 +0000 (09:22 +0200)] 
Merge pull request #21036 from yuwata/network-dhcp6-pd-manage-prefix-with-hashmap

network: dhcp6-pd: manage prefix with hashmap

4 years agoutmp: remove /dev from line
Vincent Bernat [Mon, 18 Oct 2021 18:58:43 +0000 (20:58 +0200)] 
utmp: remove /dev from line

utmp(5) says `ut_line` is the device name minus the leading "/dev/". Therefore,
remove it. Without that, when using UtmpMode=user, we get `/dev/tty` in the
output of `last`/`w`.

4 years agoMerge pull request #21038 from yuwata/network-dhcp6-pd-fix-address-check
Zbigniew Jędrzejewski-Szmek [Tue, 19 Oct 2021 07:16:09 +0000 (09:16 +0200)] 
Merge pull request #21038 from yuwata/network-dhcp6-pd-fix-address-check

network: dhcp6-pd: fix address check

4 years agonetwork: neighbor: fix log message
Yu Watanabe [Tue, 19 Oct 2021 03:58:06 +0000 (12:58 +0900)] 
network: neighbor: fix log message

4 years agomeson: use partial_dependency() to get include directory
Alexander Kanavin [Mon, 18 Oct 2021 08:13:07 +0000 (10:13 +0200)] 
meson: use partial_dependency() to get include directory

Getting the variable directly from pkg-config (without
adding the sysroot prefix) is prone to host contamination
when building in sysroots as the compiler starts looking for the
headers on the host in addition to the sysroot.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
4 years agotree-wide: use AF_NETLINK instead of PF_NETLINK
Yu Watanabe [Mon, 18 Oct 2021 16:49:53 +0000 (01:49 +0900)] 
tree-wide: use AF_NETLINK instead of PF_NETLINK

4 years agoMerge pull request #21034 from poettering/homed-password-cache-tweaks
Lennart Poettering [Mon, 18 Oct 2021 20:46:16 +0000 (22:46 +0200)] 
Merge pull request #21034 from poettering/homed-password-cache-tweaks

homed: minor tweaks to the PasswordCache logic

4 years agoMerge pull request #21028 from poettering/watchdog-fixlets
Lennart Poettering [Mon, 18 Oct 2021 20:45:44 +0000 (22:45 +0200)] 
Merge pull request #21028 from poettering/watchdog-fixlets

pid1: various small watchdog tweaks and fixes

4 years agohomework: move allocation/destruction into outer/generic scope
Lennart Poettering [Mon, 18 Oct 2021 11:59:29 +0000 (13:59 +0200)] 
homework: move allocation/destruction into outer/generic scope

Previously in most cases we'd allocate the HomeSetup context object
in generic code in homework.c. But for some cases we allocated them
instead inside the specific code in homework-{cifs,directory,luks}.c
Let's clean that up, and systematically allocate it in the outer
"entrypoint" calls in homework.c instead of the inner ones.

This doesn't change much in behaviour (i.e. it just means when something
fails we'll now clean it up one stack frame further up). But it will
allow is to more easily work with the context objects, since we'll have
them around in all stack frames.

4 years agohomework: unify code that opens the backing image file in open_image_file()
Lennart Poettering [Thu, 14 Oct 2021 13:43:08 +0000 (15:43 +0200)] 
homework: unify code that opens the backing image file in open_image_file()

Also, reuse an already opened image file if we have one.

4 years agonetwork: dhcp6: use IPv6 specific functions 21036/head
Yu Watanabe [Wed, 13 Oct 2021 18:22:30 +0000 (03:22 +0900)] 
network: dhcp6: use IPv6 specific functions

4 years agonetwork: dhcp6: manage assigned downstream prefixes by using Hashmap
Yu Watanabe [Wed, 13 Oct 2021 18:10:31 +0000 (03:10 +0900)] 
network: dhcp6: manage assigned downstream prefixes by using Hashmap

When a system has thousands of downstream interfaces, previously the
total cost of finding free subnet ID was O(n^2), where n is the number
of downstream interfaces.

This makes assigned prefixes are managed by Manager with Hashmap. So,
the cost becomes O(n log n).

4 years agonetwork: dhcp6: shorten code a bit 21037/head
Yu Watanabe [Wed, 13 Oct 2021 17:57:10 +0000 (02:57 +0900)] 
network: dhcp6: shorten code a bit

4 years agonetwork: dhcp6: always assign prefix through dhcp6_pd_assign_prefix()
Yu Watanabe [Wed, 13 Oct 2021 17:54:20 +0000 (02:54 +0900)] 
network: dhcp6: always assign prefix through dhcp6_pd_assign_prefix()

For uplink interface, we request Assign= is enabled in the above.
So, we can always use dhcp6_pd_assign_prefix().

Just a minor simplification for later commits.

4 years agonetwork: dhcp6pd: check if address is ready only when Assign=yes 21038/head
Yu Watanabe [Thu, 14 Oct 2021 20:37:18 +0000 (05:37 +0900)] 
network: dhcp6pd: check if address is ready only when Assign=yes

4 years agonetwork: add missing DHCPv6PD address check
Yu Watanabe [Thu, 14 Oct 2021 17:53:52 +0000 (02:53 +0900)] 
network: add missing DHCPv6PD address check

4 years agojournal: Expand rotate log messages in journald 20988/head
Daan De Meyer [Tue, 12 Oct 2021 10:20:59 +0000 (11:20 +0100)] 
journal: Expand rotate log messages in journald

Make sure we always log when we rotate journals and always do so at
least at INFO log level. Doing so we make sure there's always a clear
reason available explaining why we rotated a journal.

4 years agojournal: Add two more log messages to journal_file_rotate_suggested()
Daan De Meyer [Tue, 12 Oct 2021 10:03:44 +0000 (11:03 +0100)] 
journal: Add two more log messages to journal_file_rotate_suggested()

This ensures every reason for rotation has an associated log message.

4 years agodocs: Fix value for "processId" in HACKING doc
Daan De Meyer [Mon, 18 Oct 2021 12:29:15 +0000 (14:29 +0200)] 
docs: Fix value for "processId" in HACKING doc

This needs to be pickRemoteProcess to make sure the UI shows
the PIDs of processes in the mkosi container instead of processes
on the host system.

4 years agohomework: mae sure PasswordCache is really optional 21034/head
Lennart Poettering [Mon, 18 Oct 2021 13:31:10 +0000 (15:31 +0200)] 
homework: mae sure PasswordCache is really optional

It was supposed to be optional (i.e. there's a reason why we never
assert()ed on it), and in many codepaths it is, let's make sure it is
everywhere.

4 years agohomework: make PasswordCache const wherever we can
Lennart Poettering [Mon, 18 Oct 2021 12:58:36 +0000 (14:58 +0200)] 
homework: make PasswordCache const wherever we can

4 years agojournal: Add log level argument to journal_file_rotate_suggested()
Daan De Meyer [Tue, 12 Oct 2021 10:00:00 +0000 (11:00 +0100)] 
journal: Add log level argument to journal_file_rotate_suggested()

When journald is rotating a file, we'd like to log the reason at
LOG_INFO or higher instead of LOG_DEBUG. For journalctl --header,
logging the reason at a level higher than LOG_DEBUG doesn't really
make sense. To accomodate both use cases, make the log level used
by journal_file_rotate_suggested() configurable.

4 years agoMerge pull request #21026 from keszybz/licensing-info-for-generated-files
Luca Boccassi [Mon, 18 Oct 2021 12:08:36 +0000 (13:08 +0100)] 
Merge pull request #21026 from keszybz/licensing-info-for-generated-files

Licensing info for generated files

4 years agowatchdog: fix fd validity check 21028/head
Lennart Poettering [Mon, 18 Oct 2021 09:26:58 +0000 (11:26 +0200)] 
watchdog: fix fd validity check

4 years agowatchdog: drop unnecessary variable
Lennart Poettering [Mon, 18 Oct 2021 09:26:49 +0000 (11:26 +0200)] 
watchdog: drop unnecessary variable

4 years agowatchdog: always prefer /dev/watchdog0 over /dev/watchdog
Lennart Poettering [Mon, 18 Oct 2021 09:21:42 +0000 (11:21 +0200)] 
watchdog: always prefer /dev/watchdog0 over /dev/watchdog

4 years agowatchdog: fix error code handling
Lennart Poettering [Mon, 18 Oct 2021 09:17:11 +0000 (11:17 +0200)] 
watchdog: fix error code handling

4 years agodocs: mark spdx headers with the default license to website files 21026/head
Zbigniew Jędrzejewski-Szmek [Mon, 18 Oct 2021 06:56:45 +0000 (08:56 +0200)] 
docs: mark spdx headers with the default license to website files

Those were added in b41a3f66c97e3d861faed04b727daf929383b827 without
an explicit license, so they are under the default license. Some files
already got a header previously, so this only touches the remaining.

The same should be done for docs/_data/extra_pages.json, but it's json, and
json doesn't allow comments.

4 years agolicensing: add a license file for the fonts we carry
Zbigniew Jędrzejewski-Szmek [Mon, 18 Oct 2021 06:40:04 +0000 (08:40 +0200)] 
licensing: add a license file for the fonts we carry

4 years agofuzz-fido-id-desc: drop unused case file
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 18:24:10 +0000 (20:24 +0200)] 
fuzz-fido-id-desc: drop unused case file

It wasn't picked up automatically because it's not in
test/fuzz/fuzz-fido-id-desc/. But looking at the contents, it doesn't seem to
be in the expected input format either.

4 years agoTEST-06-SELINUX: add the usual spdx license header to policy files
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 18:09:09 +0000 (20:09 +0200)] 
TEST-06-SELINUX: add the usual spdx license header to policy files

4 years agogitattributes: introduce and use "generated" attribute
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 17:49:15 +0000 (19:49 +0200)] 
gitattributes: introduce and use "generated" attribute

I want to mark some files to be ignored for licensing purposes,
e.g. output from fuzzers and other samples. By using the gitattribute
machinery for this we don't need to design a custom protocol:

$ git check-attr generated test/test-sysusers/unhappy-*
test/test-sysusers/unhappy-1.expected-err: generated: set
test/test-sysusers/unhappy-1.input: generated: unspecified
test/test-sysusers/unhappy-2.expected-err: generated: set
test/test-sysusers/unhappy-2.input: generated: unspecified
test/test-sysusers/unhappy-3.expected-err: generated: set
test/test-sysusers/unhappy-3.input: generated: unspecified

4 years agogitattributes: mark more files as "binary"
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 17:44:47 +0000 (19:44 +0200)] 
gitattributes: mark more files as "binary"

This way we know that we shouldn't look for a spdx header in them.

4 years agotests: use !/usr/bin/env bash consistently
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 16:14:58 +0000 (18:14 +0200)] 
tests: use !/usr/bin/env bash consistently

This adjustment was last done in f96bc66901ecbcf7ecb280d9442fd0cc92e67186,
but it seems some files were missed and some were added later.

4 years agotests: add spdx headers to scripts and Makefiles
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 16:13:06 +0000 (18:13 +0200)] 
tests: add spdx headers to scripts and Makefiles

4 years agotests: add spdx license header to test unit/link/network/conf files
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 16:07:22 +0000 (18:07 +0200)] 
tests: add spdx license header to test unit/link/network/conf files

Those are all consumed by our parser, so they all support comments.
I was considering whether they should have a license header at all,
but in the end I decided to add it because those files are often created
by copying parts of real unit files. And if the real ones have a license,
then those might as well. It's easier to add it than to make an exception.

4 years agobpf: fix SPDX short identifier for LGPL-2.1-or-later
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 15:03:45 +0000 (17:03 +0200)] 
bpf: fix SPDX short identifier for LGPL-2.1-or-later

4 years agolicensing: add two missing spdx headers
Zbigniew Jędrzejewski-Szmek [Sun, 17 Oct 2021 07:46:19 +0000 (09:46 +0200)] 
licensing: add two missing spdx headers

Both files were developed in our tree, so they are under the default license.

4 years agogitattributes: mark fuzz inputs that are pure binary as such
Zbigniew Jędrzejewski-Szmek [Sat, 16 Oct 2021 16:19:19 +0000 (18:19 +0200)] 
gitattributes: mark fuzz inputs that are pure binary as such

We also have a bunch of files that have some bytes and a lot
of text, like the journal export format. For those, it is still quite
useful when the tools try to diff them, so let's not mark those.

4 years agohomed: replace "already_activated" boolean parameter by a flags value
Lennart Poettering [Sun, 17 Oct 2021 07:42:15 +0000 (09:42 +0200)] 
homed: replace "already_activated" boolean parameter by a flags value

This is mostly preparation for further defined flags to be added in
later PRs/commits.

No change in behaviour just the flagsification.

4 years agomacro: Move ALIGN_TO to macro-fundamental.h and introduce CONST_ALIGN_TO 20905/head
Jan Janssen [Wed, 6 Oct 2021 08:21:42 +0000 (10:21 +0200)] 
macro: Move ALIGN_TO to macro-fundamental.h and introduce CONST_ALIGN_TO

4 years agosd-boot: Require gnu-efi 3.0.5
Jan Janssen [Thu, 30 Sep 2021 10:51:32 +0000 (12:51 +0200)] 
sd-boot: Require gnu-efi 3.0.5

This version is from 2017 and should be stale enough to not cause
an outrage. All the relevant distros have it or a newer version.

We also already depend on some symbols defined in 3.0.5 anyway,
so let's take the opportunity to reduce our missing_efi.h
baggage.

4 years agosd-boot: Get rid of uefi_call_wrapper
Jan Janssen [Thu, 30 Sep 2021 10:11:56 +0000 (12:11 +0200)] 
sd-boot: Get rid of uefi_call_wrapper

The uefi_call_wrapper exists to convert to the right calling convention
and presumably predates compilers that can do so natively. The only
architecture where this is even needed is x86_64.
But because we are building with GNU_EFI_USE_MS_ABI defined, the
EFIAPI macro tells the compiler to use the right calling convention
for EFI functions. Our shim callback (which is called by EFI itself)
already relies on this.

This also adds a safety check to make se we are compiling with
GNU_EFI_USE_MS_ABI defined and also adds it to the compiler args
unconditionally. It is only used with x86_64 anyways, so it should
be fine to do so. EFI_FUNCTION_WRAPPER is unused in gnu-efi, so
it is dropped.

4 years agosd-boot: Convert VOID -> void
Jan Janssen [Thu, 30 Sep 2021 09:17:22 +0000 (11:17 +0200)] 
sd-boot: Convert VOID -> void

We are already using void in several places and having a screaming
typedef for void feels pointless. There are also CONST, IN, OUT
and OPTIONAL which we aren't using either.

This leaves missing_efi.h to keep it in line with how they are
defined in gnu-efi and/or the specs.

4 years agosd-boot: Rework print_status()
Jan Janssen [Thu, 30 Sep 2021 07:46:55 +0000 (09:46 +0200)] 
sd-boot: Rework print_status()

A little helper function and some unusual formatting makes this
whole thing a lot easier on the eyes. Also, right-aligning the
properties for better readability at runtime.

4 years agosd-boot: Rearm the watchdog in console_key_read
Jan Janssen [Tue, 28 Sep 2021 08:57:06 +0000 (10:57 +0200)] 
sd-boot: Rearm the watchdog in console_key_read

Let's not disable the watchdog at all and instead rearm it inside
of console_key_read(). This way, we are covered by the watchdog everywhere.

4 years agosd-boot: Check for OOM in some places
Jan Janssen [Tue, 28 Sep 2021 08:21:42 +0000 (10:21 +0200)] 
sd-boot: Check for OOM in some places

4 years agoMerge pull request #21013 from mxre/feature/stub-dtb
Lennart Poettering [Sun, 17 Oct 2021 09:27:03 +0000 (11:27 +0200)] 
Merge pull request #21013 from mxre/feature/stub-dtb

[sd-stub] add support for embedding devicetree

4 years agoMerge pull request #21023 from poettering/home-prepare-rename
Yu Watanabe [Sat, 16 Oct 2021 19:32:07 +0000 (04:32 +0900)] 
Merge pull request #21023 from poettering/home-prepare-rename

homed: rename some functions

4 years agohomed: rename home_setup_undo() → home_setup_done() 21023/head
Lennart Poettering [Sat, 16 Oct 2021 12:45:42 +0000 (14:45 +0200)] 
homed: rename home_setup_undo() → home_setup_done()

This function is a destructor, hence it should be named like one.

(We usually use xyz_free() for a destructor that frees the object passed
itself. xyz_unref() we typically use for destructors that are similar,
but ref counted. xyz_done() usually is used for destructors which free
the members of an object, but not the object itself – to allow stack
allocation of objects. We don't strictly follow this, but it's good to
stick to rules wherever we can.)

No actual code change, just renaming.

4 years agohomed: rename home_prepare*() → home_setup*()
Lennart Poettering [Wed, 13 Oct 2021 20:24:24 +0000 (22:24 +0200)] 
homed: rename home_prepare*() → home_setup*()

These set of functions are constructors for an object called HomeSetup,
which has a destructor home_setup_undo(), hence to be reasonably
symmetric, let's call it home_setup*() too, instead of using a new verb
"prepare" for its name.

No actual code changes, just some renaming.

4 years agopo: add a false positive to POTFILES.skip
Piotr Drąg [Sat, 16 Oct 2021 11:59:20 +0000 (13:59 +0200)] 
po: add a false positive to POTFILES.skip

4 years ago[st-stub] documenting the .dtb section 21013/head
Max Resch [Sat, 16 Oct 2021 11:26:21 +0000 (13:26 +0200)] 
[st-stub] documenting the .dtb section

4 years agohomework: reuse home_validate_update_luks() at one more place
Lennart Poettering [Wed, 13 Oct 2021 20:40:11 +0000 (22:40 +0200)] 
homework: reuse home_validate_update_luks() at one more place

We have the same code at two places, let's reuse it. Given the more
generic scope let's rename the function home_get_state() since it
retrieve the current setup state of the LUKS logic.

4 years agohomework: remove duplicate error logging when doing ext4 resizes
Lennart Poettering [Thu, 14 Oct 2021 15:23:29 +0000 (17:23 +0200)] 
homework: remove duplicate error logging when doing ext4 resizes

4 years agohomework: let's simply some code via erase_and_free()
Lennart Poettering [Fri, 15 Oct 2021 16:00:38 +0000 (18:00 +0200)] 
homework: let's simply some code via erase_and_free()

4 years agohomed,shutdown: call valgrind magic after LOOP_GET_STATUS64
Lennart Poettering [Fri, 15 Oct 2021 15:58:13 +0000 (17:58 +0200)] 
homed,shutdown: call valgrind magic after LOOP_GET_STATUS64

valgrind doesn't understand LOOP_GET_STATUS64. We already work around
this in various placed, via VALGRIND_MAKE_MEM_DEFINE(), but we forgot
three places. Let's fix that.

4 years agouserdb: fix type to pass to connect()
Yu Watanabe [Fri, 15 Oct 2021 20:04:26 +0000 (05:04 +0900)] 
userdb: fix type to pass to connect()

Fixes https://github.com/systemd/systemd/pull/20613#issuecomment-944621275.

4 years ago[sd-stub] add support for embedding devicetree
Max Resch [Fri, 15 Oct 2021 12:18:57 +0000 (14:18 +0200)] 
[sd-stub] add support for embedding devicetree

4 years agoMerge pull request #20902 from tasleson/integritysetup-generator
Lennart Poettering [Fri, 15 Oct 2021 16:57:17 +0000 (18:57 +0200)] 
Merge pull request #20902 from tasleson/integritysetup-generator

Add stand-alone dm integrity support

4 years agohomework: only do image locks for regular image files
Lennart Poettering [Thu, 14 Oct 2021 13:38:03 +0000 (15:38 +0200)] 
homework: only do image locks for regular image files

If an image file is actually a block device taking a lock on it doesn't
really make sense for us: it will interfere with udev's block device
probing logic, and it's not going to propagated across the network
anyway (which is what we are after here). Hence simply don't do it.

Follow-up for 2aaf565a2da8eb0ea9adf84028c9d0ab7a90e53e

4 years agohomework: don't bother with BLKRRPART on images that aren't block devices
Lennart Poettering [Fri, 15 Oct 2021 09:23:00 +0000 (11:23 +0200)] 
homework: don't bother with BLKRRPART on images that aren't block devices

We currently call this ioctl even if we are backed by a regular file,
which is actually the common case. While this doesn't really hurt, it
does result in very confusing logs.

4 years agoAdd stand-alone dm-integrity support 20902/head
Tony Asleson [Sun, 26 Sep 2021 16:53:42 +0000 (11:53 -0500)] 
Add stand-alone dm-integrity support

This adds support for dm integrity targets and an associated
/etc/integritytab file which is required as the dm integrity device
super block doesn't include all of the required metadata to bring up
the device correctly.  See integritytab man page for details.

4 years agoMerge pull request #20983 from mxre/feature/aarch64
Lennart Poettering [Fri, 15 Oct 2021 08:26:10 +0000 (10:26 +0200)] 
Merge pull request #20983 from mxre/feature/aarch64

[sd-stub] Add support for aarch64 booting via pe-entry point

4 years agoMerge pull request #20980 from bluca/compat_readme
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 07:49:29 +0000 (09:49 +0200)] 
Merge pull request #20980 from bluca/compat_readme

docs: add guidelines w.r.t. compatibility to docs/CONTRIBUTING.md

4 years agoMerge pull request #20996 from yuwata/udevadm-trigger-debug
Zbigniew Jędrzejewski-Szmek [Fri, 15 Oct 2021 07:44:59 +0000 (09:44 +0200)] 
Merge pull request #20996 from yuwata/udevadm-trigger-debug

test: show debug and verbose message

4 years agounit: networkd does not require AF_ALG anymore
Yu Watanabe [Thu, 14 Oct 2021 21:31:21 +0000 (06:31 +0900)] 
unit: networkd does not require AF_ALG anymore

As khash is retired.

4 years agodm-verity: Remove usage of integrity
Tony Asleson [Wed, 13 Oct 2021 19:18:12 +0000 (14:18 -0500)] 
dm-verity: Remove usage of integrity

There is a difference between dm-verity and dm-integrity.  Remove
usage of integrity from verity documentation in man pages and
target files.

4 years agoMerge pull request #21001 from poettering/alloca-safe
Yu Watanabe [Thu, 14 Oct 2021 15:57:27 +0000 (00:57 +0900)] 
Merge pull request #21001 from poettering/alloca-safe

honour ALLOCA_MAX limit on all alloca() allocations, not just some

4 years agohomework: fix incorrect error variable use
Lennart Poettering [Thu, 14 Oct 2021 13:40:59 +0000 (15:40 +0200)] 
homework: fix incorrect error variable use

4 years agoMerge pull request #21006 from DaanDeMeyer/mkosi-ordering
Yu Watanabe [Thu, 14 Oct 2021 15:07:21 +0000 (00:07 +0900)] 
Merge pull request #21006 from DaanDeMeyer/mkosi-ordering

mkosi: Add number prefixes to per-distro files for easier overriding

4 years agodoc: document that alloca_safe() and friends are the APIs to use 21001/head
Lennart Poettering [Wed, 13 Oct 2021 12:19:40 +0000 (14:19 +0200)] 
doc: document that alloca_safe() and friends are the APIs to use

4 years agoalloc-util: add strdupa_safe() + strndupa_safe() and use it everywhere
Lennart Poettering [Wed, 13 Oct 2021 10:38:37 +0000 (12:38 +0200)] 
alloc-util: add strdupa_safe() + strndupa_safe() and use it everywhere

Let's define two helpers strdupa_safe() + strndupa_safe() which do the
same as their non-safe counterparts, except that they abort if called
with allocations larger than ALLOCA_MAX.

This should ensure that all our alloca() based allocations are subject
to this limit.

afaics glibc offers three alloca() based APIs: alloca() itself,
strndupa() + strdupa(). With this we have now replacements for all of
them, that take the limit into account.

4 years agojournal: drop unnecessary +1 in newa() expression
Lennart Poettering [Wed, 13 Oct 2021 10:08:20 +0000 (12:08 +0200)] 
journal: drop unnecessary +1 in newa() expression

newa() does this internally anyway, no need to do this explicitly.

4 years agotree-wide: port all calls to alloca() to alloca_safe()
Lennart Poettering [Wed, 13 Oct 2021 10:07:52 +0000 (12:07 +0200)] 
tree-wide: port all calls to alloca() to alloca_safe()

4 years agoalloca-util: drop two unnecessary casts
Lennart Poettering [Wed, 13 Oct 2021 10:07:20 +0000 (12:07 +0200)] 
alloca-util: drop two unnecessary casts

memset() already returns void*, no need to cast it to that.

4 years agoalloc-util: introduce new helper alloca_safe()
Lennart Poettering [Wed, 13 Oct 2021 10:05:54 +0000 (12:05 +0200)] 
alloc-util: introduce new helper alloca_safe()

This is like alloca(), but does two things:

1. Verifies the allocation is smaller than ALLOCA_MAX
2. Ensures we allocate at least one byte

This was previously done manually in all invocations. This adds a handy
helper that does that implicitly.

4 years agocgroup: when checking for legacy controllers, ignore any we don't care about
Dan Streetman [Wed, 13 Oct 2021 11:43:14 +0000 (07:43 -0400)] 
cgroup: when checking for legacy controllers, ignore any we don't care about

4 years agoIgnore local files in subdirectories of mkosi.default.d/ as well 21006/head
Daan De Meyer [Thu, 14 Oct 2021 12:07:16 +0000 (14:07 +0200)] 
Ignore local files in subdirectories of mkosi.default.d/ as well

4 years agomkosi: Add number prefixes to per-distro files for easier overriding
Daan De Meyer [Thu, 14 Oct 2021 12:06:53 +0000 (14:06 +0200)] 
mkosi: Add number prefixes to per-distro files for easier overriding

This allows developers to add override files to override per-distro settings.

4 years agovirt: Support detection for ARM64 Hyper-V guests
Boqun Feng [Wed, 13 Oct 2021 03:32:09 +0000 (11:32 +0800)] 
virt: Support detection for ARM64 Hyper-V guests

The detection of Microsoft Hyper-V VMs is done by cpuid currently,
however there is no cpuid on ARM64. And since ARM64 is now a supported
architecture for Microsoft Hyper-V guests[1], then use DMI tables to
detect a Hyper-V guest, which is more generic and works for ARM64.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467

4 years agoMerge pull request #21002 from poettering/watchdog-off
Luca Boccassi [Wed, 13 Oct 2021 19:03:06 +0000 (20:03 +0100)] 
Merge pull request #21002 from poettering/watchdog-off

minor tweaks to watchdog configuration logic

4 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

4 years agoman: document new systemd.watchdog_sec= kernel cmdline option 21002/head
Lennart Poettering [Wed, 13 Oct 2021 11:07:50 +0000 (13:07 +0200)] 
man: document new systemd.watchdog_sec= kernel cmdline option

Follow-up for: b3aa73e4de614c06c4a27e5635967a0392654fbc

4 years agoman: document new "off" setting for systemd-system.conf watchdog settings
Lennart Poettering [Wed, 13 Oct 2021 11:07:27 +0000 (13:07 +0200)] 
man: document new "off" setting for systemd-system.conf watchdog settings

4 years agocore: allow "off" as special watchdog time to be specified
Lennart Poettering [Wed, 13 Oct 2021 11:06:03 +0000 (13:06 +0200)] 
core: allow "off" as special watchdog time to be specified

Right now we already understand "default" as special string for enabling
the watchdog but not reconfiguring its timeout (it is internally mapped
to USEC_MAX). To be systematic this adds "off" as special string for
disabling the watchdog logic (it is internally mapped to 0, which is how
this behaviour was previously requested).

4 years agoMerge pull request #20787 from fbuihuu/watchdog-more-rework
Lennart Poettering [Wed, 13 Oct 2021 10:56:44 +0000 (12:56 +0200)] 
Merge pull request #20787 from fbuihuu/watchdog-more-rework

Watchdog more rework

4 years agocore/bpf-firewall: add missing oom check
Yu Watanabe [Wed, 13 Oct 2021 04:05:17 +0000 (13:05 +0900)] 
core/bpf-firewall: add missing oom check

Fixes CID#1464627.

4 years agowatchdog: rename special string "infinity" taken by the watchdog timeout options... 20787/head
Franck Bui [Fri, 1 Oct 2021 08:42:11 +0000 (10:42 +0200)] 
watchdog: rename special string "infinity" taken by the watchdog timeout options to "default"

4 years agowatchdog: handle timeout programming errors more safely
Franck Bui [Mon, 27 Sep 2021 08:51:28 +0000 (10:51 +0200)] 
watchdog: handle timeout programming errors more safely

If an error happened while the timeout value was being programmed, the error
was ignored and the watchdog module used the new timeout value whereas the
watchdog device was left with the previous one.

Now in cases of error, the device is now disabled and closed if it wasn't
opened already otherwise the previous timeout value is kept so the device is
still pinged at correct intervals.

4 years agocore: introduce systemd.watchdog_sec=<sec> option
Franck Bui [Fri, 17 Sep 2021 09:11:14 +0000 (11:11 +0200)] 
core: introduce systemd.watchdog_sec=<sec> option

4 years agowatchdog: update the documentation
Franck Bui [Mon, 27 Sep 2021 08:16:09 +0000 (10:16 +0200)] 
watchdog: update the documentation

While at it, split the watchdog section into a few paragraphs to make it easier
to read as it becomes lengthy.

4 years agowatchdog: passing 0 to watchdog_setup now closes the watchdog
Franck Bui [Fri, 17 Sep 2021 13:16:38 +0000 (15:16 +0200)] 
watchdog: passing 0 to watchdog_setup now closes the watchdog

Passing 0 meant "disable the watchdog although still kept it opened". However
this case didn't seem to be useful especially since PID1 closes the device if
it is passed the nul timeout.

Hence let's change the meaning of watchdog_setup(0) to match PID1's behavior
which allows to simplify the code a bit.

Hence this patch also drops enable_watchdog().

4 years agowatchdog: pass USEC_INFINITY to watchdog_setup() to reuse the programmed timeout...
Franck Bui [Fri, 17 Sep 2021 08:34:35 +0000 (10:34 +0200)] 
watchdog: pass USEC_INFINITY to watchdog_setup() to reuse the programmed timeout value

This patch changes the meaning of USEC_INFINITY value for the watchdog
module.

Previously passing this value was a NOP. It now has a special meaning: it
requests the watchdog module to read the programmed timeout value and reuse it
for pinging the device.

This is mostly useful when the watchdog is started by the firmware and there's
no way to reconfigure the timeout with a different value
afterwards. "RuntimeWatchdogSec=infinity" in system.conf can now be used rather
than putting an arbitrary value that PID1 will fail to set (even if it still
felt back to the programmed timeout).

Please note that "infinity" is not supposed to restore the default value of the
firmware. If the value is changed after booting then "infinity" would simply
reuse the current programmed value. IOW it's a NOP unless the watchdog was
previously closed and in that case it will be reopened and the last programmed
value reused.

4 years agowatchdog: configuring a timeout value might not be supported by the HW
Franck Bui [Thu, 16 Sep 2021 16:46:04 +0000 (18:46 +0200)] 
watchdog: configuring a timeout value might not be supported by the HW

In that case we should hanlde this case more gracefully by reusing the
programmed value.

Fixes: #20683