Commit Graph

53689 Commits

Author SHA1 Message Date
Lennart Poettering
b6e44cd934
Merge pull request #20787 from fbuihuu/watchdog-more-rework
Watchdog more rework
2021-10-13 12:56:44 +02:00
Yu Watanabe
f25e10b1c9 core/bpf-firewall: add missing oom check
Fixes CID#1464627.
2021-10-13 18:06:04 +09:00
Franck Bui
8a85c5b616 watchdog: rename special string "infinity" taken by the watchdog timeout options to "default" 2021-10-13 08:58:36 +02:00
Franck Bui
0ffdfe7d68 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.
2021-10-13 08:58:36 +02:00
Franck Bui
b3aa73e4de core: introduce systemd.watchdog_sec=<sec> option 2021-10-13 08:58:36 +02:00
Franck Bui
807938e7ec 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.
2021-10-13 08:58:36 +02:00
Franck Bui
f16890f8d2 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().
2021-10-13 08:58:30 +02:00
Franck Bui
c1a08a76ab 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.
2021-10-13 08:51:15 +02:00
Franck Bui
ef1d5f3c5c 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
2021-10-13 08:51:13 +02:00
Franck Bui
fcbf2c64f5 watchdog: minor optimization in watchdog_setup() 2021-10-13 08:50:08 +02:00
Franck Bui
85e5613cf3 watchdog: cleanup: create an helper for each ioctl
No functional changes.
2021-10-13 08:50:04 +02:00
Zbigniew Jędrzejewski-Szmek
df618f259a
Merge pull request #20987 from yuwata/sd-dhcp6-enum-cleanups
sd-dhcp6-client: enum cleanups
2021-10-13 08:25:37 +02:00
Dan Streetman
22eeada935 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.
2021-10-13 12:24:33 +09:00
Anita Zhang
0b4f8d9498 core: serialize device cgroup bpf progs across daemon-reload/reexec
Follows what was done in b57d752326 and
adds a test that verifies the device BPF program is not detached during
reload/reexec.
2021-10-13 11:13:56 +09:00
Yu Watanabe
c2e22d73ae
Merge pull request #20992 from keszybz/fix-two-outputs
Fix two outputs
2021-10-13 11:12:26 +09:00
Yu Watanabe
7502812c92 sd-dhcp6-client: max_retransmit_time must be positive
Found by LGTM.com analysis.
2021-10-13 02:49:49 +09:00
Yu Watanabe
fea8c18085 sd-dhcp6-client: introduce dhcp6_option_can_request() 2021-10-13 02:49:49 +09:00
Zbigniew Jędrzejewski-Szmek
384c620766 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.
2021-10-12 19:48:20 +02:00
Yu Watanabe
308d01f3c4 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.
2021-10-13 02:46:24 +09:00
наб
7d449b5618 systemd-machine-id-setup(1): "machine[d] ID" typo 2021-10-13 02:21:44 +09:00
Zbigniew Jędrzejewski-Szmek
cc7ac73ddb 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.
2021-10-12 13:56:57 +02:00
Yu Watanabe
f5e3619b70 sd-dhcp6-client: add missing options 2021-10-12 20:48:19 +09:00
Yu Watanabe
ac94edc857 sd-dhcp6-client: add missing parenthesis 2021-10-12 20:48:19 +09:00
Yu Watanabe
59f1ded834 sd-dhcp6-client: add missing message types
This also changes the prefix: DHCP6_ -> DHCP6_MESSAGE_.
2021-10-12 20:48:19 +09:00
Yu Watanabe
b261b5f416 sd-dhcp6-client: name one more enum 2021-10-12 20:48:19 +09:00
Yu Watanabe
dd5e9378a2 sd-dhcp6-client: typedef several enums
Also introduces _MAX and _INVALID for several enums.
2021-10-12 20:48:19 +09:00
alexlzhu
76dc17254f 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
2021-10-12 12:48:23 +02:00
Yu Watanabe
d92681a65e network: dhcp6-pd: also assign addresses in IA_PD prefixes on uplink interface
Closes #20808.
2021-10-12 11:13:25 +01:00
Zbigniew Jędrzejewski-Szmek
78ae9d3100
Merge pull request #20853 from yuwata/network-radv-set-default-timeouts
network: RADV: set default timeouts
2021-10-12 10:49:03 +02:00
Jan Janssen
a69702c5ea sd-boot: Move security and console control protocol to missing_efi.h
This also fixes a broken #ifdefs in the header itself.
2021-10-12 09:56:54 +02:00
Jan Janssen
4ec9d873f3 sd-boot: Use _cleanup_ in more places 2021-10-12 09:56:23 +02:00
Jan Janssen
19dd3995aa sd-boot: Remove unnecessary TPM conditionalization
This is already done in measure.h.
2021-10-12 09:56:02 +02:00
Jan Janssen
d09065f894 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.
2021-10-12 09:55:49 +02:00
Jan Janssen
393955fd21 sd-boot: Split up xbootldr_open() 2021-10-12 09:55:21 +02:00
Jan Janssen
423523e063 sd-boot: Fix xbootldr detection
The broken crc32 calculation was a copy pasta error introduced in
87167331c9 and luckily has never been
shipped yet.
2021-10-12 09:54:04 +02:00
Jan Janssen
bcbc3e81d3 sd-boot: Move xbootldr code into its own file 2021-10-12 09:53:48 +02:00
Jan Janssen
6e7bb7d3ee sd-boot: Invert if in disk_get_part_uuid() 2021-10-12 09:53:16 +02:00
Yu Watanabe
6f47ab1bb1
Merge pull request #20985 from yuwata/test-bus-node-enumerator
test: add more tests for sd-bus node enumerator
2021-10-12 15:20:47 +09:00
Yu Watanabe
f21b863eeb test: use assert_se() instead of assert() 2021-10-12 15:20:28 +09:00
Frantisek Sumsal
1c71302f70 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.
2021-10-12 08:17:56 +02:00
Lennart Poettering
de3ef2524e
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
2021-10-11 23:11:03 +02:00
Lennart Poettering
5c791053e3
Merge pull request #20776 from medhefgo/boot-timeout
sd-boot: Allow disabling timeout
2021-10-11 23:05:37 +02:00
Yu Watanabe
16614bebd8 test: shorten code a bit 2021-10-12 03:31:54 +09:00
Yu Watanabe
165a654e29 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.
2021-10-12 03:10:30 +09:00
Yu Watanabe
9fa25e0791 network: radv: set non-zero lifetime for DNS servers and domains by default
Closes #20850.
2021-10-12 03:10:30 +09:00
Yu Watanabe
2110040b2d network: radv: verify [IPv6Prefix] and [IPv6RoutePrefix] sections 2021-10-12 03:10:30 +09:00
Yu Watanabe
cf72568ae4 network: radv: mask unnecessary part of specified addresses 2021-10-12 03:10:30 +09:00
Yu Watanabe
2ac4167900 network: radv: make conf parsers not set values into sd_radv_prefix/sd_radv_route_prefix
Preparation for later commits.
2021-10-12 03:10:30 +09:00
Yu Watanabe
7ebb14313f sd-radv: rename sd_radv_prefix_set_route_prefix() -> sd_radv_route_prefix_set_prefix() 2021-10-12 03:10:30 +09:00
Yu Watanabe
e660d66e1c test: add more node enumerator tests 2021-10-12 03:05:24 +09:00