Lennart Poettering [Mon, 18 Oct 2021 09:21:42 +0000 (11:21 +0200)]
watchdog: always prefer /dev/watchdog0 over /dev/watchdog
Lennart Poettering [Mon, 18 Oct 2021 09:17:11 +0000 (11:17 +0200)]
watchdog: fix error code handling
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.
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
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
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.
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.
Piotr Drąg [Sat, 16 Oct 2021 11:59:20 +0000 (13:59 +0200)]
po: add a false positive to POTFILES.skip
Max Resch [Sat, 16 Oct 2021 11:26:21 +0000 (13:26 +0200)]
[st-stub] documenting the .dtb section
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.
Lennart Poettering [Thu, 14 Oct 2021 15:23:29 +0000 (17:23 +0200)]
homework: remove duplicate error logging when doing ext4 resizes
Lennart Poettering [Fri, 15 Oct 2021 16:00:38 +0000 (18:00 +0200)]
homework: let's simply some code via erase_and_free()
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.
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.
Max Resch [Fri, 15 Oct 2021 12:18:57 +0000 (14:18 +0200)]
[sd-stub] add support for embedding devicetree
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
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
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.
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.
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
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
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
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.
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.
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
Lennart Poettering [Thu, 14 Oct 2021 13:40:59 +0000 (15:40 +0200)]
homework: fix incorrect error variable use
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
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
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.
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.
Lennart Poettering [Wed, 13 Oct 2021 10:07:52 +0000 (12:07 +0200)]
tree-wide: port all calls to alloca() to alloca_safe()
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.
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.
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
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
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.
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
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
Max Resch [Mon, 11 Oct 2021 13:15:30 +0000 (15:15 +0200)]
[sd-stub] Add support for aarch64 booting via pe-entry point
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
Lennart Poettering [Wed, 13 Oct 2021 11:07:27 +0000 (13:07 +0200)]
man: document new "off" setting for systemd-system.conf watchdog settings
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).
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
Yu Watanabe [Wed, 13 Oct 2021 04:05:17 +0000 (13:05 +0900)]
core/bpf-firewall: add missing oom check
Fixes CID#
1464627.
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"
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.
Franck Bui [Fri, 17 Sep 2021 09:11:14 +0000 (11:11 +0200)]
core: introduce systemd.watchdog_sec=<sec> option
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.
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().
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.
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
Franck Bui [Fri, 17 Sep 2021 07:21:18 +0000 (09:21 +0200)]
watchdog: minor optimization in watchdog_setup()
Franck Bui [Thu, 16 Sep 2021 14:19:05 +0000 (16:19 +0200)]
watchdog: cleanup: create an helper for each ioctl
No functional changes.
Zbigniew Jędrzejewski-Szmek [Wed, 13 Oct 2021 06:25:37 +0000 (08:25 +0200)]
Merge pull request #20987 from yuwata/sd-dhcp6-enum-cleanups
sd-dhcp6-client: enum cleanups
Yu Watanabe [Wed, 13 Oct 2021 03:58:24 +0000 (12:58 +0900)]
test: show debug and verbose message
Yu Watanabe [Wed, 13 Oct 2021 03:57:40 +0000 (12:57 +0900)]
sd-device-monitor: update log message to clarify the error will be ignored
Dan Streetman [Tue, 5 Oct 2021 12:49:21 +0000 (08:49 -0400)]
cgroup: check if any controller is in use as v1
Check if any cgroup controller is currently being used as v1, and if so don't
use cgroup unified mode. This is only checked when there is no cgroup already
mounted, and is most useful when running in a container where the host is using
a legacy or hybrid cgroup, since we can't (fully) use unified cgroup, as the
host kernel has the cgroup controllers in use by v1.
This shouldn't be needed if the container manager has pre-mounted cgroups
appropriately based on the host system cgroup setup, but we can't rely
on that always being the case.
Anita Zhang [Mon, 11 Oct 2021 07:25:20 +0000 (00:25 -0700)]
core: serialize device cgroup bpf progs across daemon-reload/reexec
Follows what was done in
b57d75232615f98aefcf41cb145ec2ea3262857d and
adds a test that verifies the device BPF program is not detached during
reload/reexec.
Yu Watanabe [Wed, 13 Oct 2021 02:12:26 +0000 (11:12 +0900)]
Merge pull request #20992 from keszybz/fix-two-outputs
Fix two outputs
Yu Watanabe [Tue, 12 Oct 2021 09:50:34 +0000 (18:50 +0900)]
sd-dhcp6-client: max_retransmit_time must be positive
Found by LGTM.com analysis.
Yu Watanabe [Tue, 12 Oct 2021 06:51:09 +0000 (15:51 +0900)]
sd-dhcp6-client: introduce dhcp6_option_can_request()
Zbigniew Jędrzejewski-Szmek [Tue, 12 Oct 2021 17:46:25 +0000 (19:46 +0200)]
coredumpctl: stop truncating information about coredump
With the changes to limit that print 'Found module …' over and over, we were
hitting the journal field message limit, effectively truncating the info output.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
1998488.
Yu Watanabe [Tue, 12 Oct 2021 11:46:18 +0000 (20:46 +0900)]
network: do not request RAPID_COMMIT option
The option must not be included in OPTION_REQUEST option.
See the "Client ORO" field in
https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#dhcpv6-parameters-2
This deprecates RapidCommit= setting. Note that sd-dhcp6-client always
sets the RAPID_COMMIT option in the solicit message.
наб [Tue, 12 Oct 2021 16:52:33 +0000 (18:52 +0200)]
systemd-machine-id-setup(1): "machine[d] ID" typo
Max Resch [Mon, 11 Oct 2021 23:26:00 +0000 (01:26 +0200)]
move mfree to macro-fundamentals.h
Zbigniew Jędrzejewski-Szmek [Tue, 5 Oct 2021 17:56:46 +0000 (19:56 +0200)]
shared/dissect-image: reword debug message
I read the message and initially thought that there's some bug in time
subtraction. Let's make it clear that the message is about what we'll
do in the future, and not a report on how we waited up until now.
Yu Watanabe [Mon, 11 Oct 2021 21:56:04 +0000 (06:56 +0900)]
sd-dhcp6-client: add missing options
Yu Watanabe [Mon, 11 Oct 2021 21:07:47 +0000 (06:07 +0900)]
sd-dhcp6-client: add missing parenthesis
Yu Watanabe [Mon, 11 Oct 2021 20:20:59 +0000 (05:20 +0900)]
sd-dhcp6-client: add missing message types
This also changes the prefix: DHCP6_ -> DHCP6_MESSAGE_.
Yu Watanabe [Mon, 11 Oct 2021 20:45:23 +0000 (05:45 +0900)]
sd-dhcp6-client: name one more enum
Yu Watanabe [Mon, 11 Oct 2021 20:43:04 +0000 (05:43 +0900)]
sd-dhcp6-client: typedef several enums
Also introduces _MAX and _INVALID for several enums.
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
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.
Luca Boccassi [Mon, 11 Oct 2021 11:16:44 +0000 (12:16 +0100)]
docs: add guidelines w.r.t. compatibility to docs/CONTRIBUTING.md
Luca Boccassi [Mon, 11 Oct 2021 11:18:02 +0000 (12:18 +0100)]
LICENSES/README.md: remove reference to non-existing files
All example code was relicensed
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
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.
Jan Janssen [Mon, 27 Sep 2021 11:07:16 +0000 (13:07 +0200)]
sd-boot: Use _cleanup_ in more places
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.
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.
Jan Janssen [Mon, 27 Sep 2021 08:54:29 +0000 (10:54 +0200)]
sd-boot: Split up xbootldr_open()
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.
Jan Janssen [Mon, 27 Sep 2021 08:02:50 +0000 (10:02 +0200)]
sd-boot: Move xbootldr code into its own file
Jan Janssen [Fri, 24 Sep 2021 08:24:38 +0000 (10:24 +0200)]
sd-boot: Invert if in disk_get_part_uuid()
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
Yu Watanabe [Mon, 11 Oct 2021 17:39:11 +0000 (02:39 +0900)]
test: use assert_se() instead of assert()
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.
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
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
Yu Watanabe [Mon, 11 Oct 2021 18:04:06 +0000 (03:04 +0900)]
test: shorten code a bit
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.
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.
Yu Watanabe [Mon, 27 Sep 2021 13:01:14 +0000 (22:01 +0900)]
network: radv: verify [IPv6Prefix] and [IPv6RoutePrefix] sections
Yu Watanabe [Mon, 27 Sep 2021 13:00:00 +0000 (22:00 +0900)]
network: radv: mask unnecessary part of specified addresses
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.
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()
Yu Watanabe [Mon, 11 Oct 2021 18:02:41 +0000 (03:02 +0900)]
test: add more node enumerator tests
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
Yu Watanabe [Mon, 11 Oct 2021 17:03:12 +0000 (02:03 +0900)]
Merge pull request #20965 from poettering/getdents
recurse-dir: use getdents64()
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