1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00
Commit Graph

53722 Commits

Author SHA1 Message Date
Lennart Poettering
eaaa02bffe
Merge pull request #20902 from tasleson/integritysetup-generator
Add stand-alone dm integrity support
2021-10-15 18:57:17 +02:00
Lennart Poettering
2aa94bb88a 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 2aaf565a2d
2021-10-15 18:03:32 +02:00
Lennart Poettering
6a1301d8c9 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.
2021-10-15 18:03:12 +02:00
Tony Asleson
1f1a2243c0 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.
2021-10-15 10:19:54 -05:00
Lennart Poettering
0a51337df1
Merge pull request #20983 from mxre/feature/aarch64
[sd-stub] Add support for aarch64 booting via pe-entry point
2021-10-15 10:26:10 +02:00
Zbigniew Jędrzejewski-Szmek
0bb6699edc
Merge pull request #20980 from bluca/compat_readme
docs: add guidelines w.r.t. compatibility to docs/CONTRIBUTING.md
2021-10-15 09:49:29 +02:00
Zbigniew Jędrzejewski-Szmek
6b292fa17b
Merge pull request #20996 from yuwata/udevadm-trigger-debug
test: show debug and verbose message
2021-10-15 09:44:59 +02:00
Yu Watanabe
a6d4e83b8a unit: networkd does not require AF_ALG anymore
As khash is retired.
2021-10-15 09:25:38 +02:00
Tony Asleson
9a2a6ec4e3 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.
2021-10-14 12:17:02 -05:00
Yu Watanabe
81218ac1e1
Merge pull request #21001 from poettering/alloca-safe
honour ALLOCA_MAX limit on all alloca() allocations, not just some
2021-10-15 00:57:27 +09:00
Lennart Poettering
82fb0911fc homework: fix incorrect error variable use 2021-10-15 00:56:57 +09:00
Yu Watanabe
3780f3993f
Merge pull request #21006 from DaanDeMeyer/mkosi-ordering
mkosi: Add number prefixes to per-distro files for easier overriding
2021-10-15 00:07:21 +09:00
Lennart Poettering
e3bde91293 doc: document that alloca_safe() and friends are the APIs to use 2021-10-14 15:57:52 +02:00
Lennart Poettering
2f82562bad 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.
2021-10-14 15:57:52 +02:00
Lennart Poettering
5222651ecc journal: drop unnecessary +1 in newa() expression
newa() does this internally anyway, no need to do this explicitly.
2021-10-14 15:57:52 +02:00
Lennart Poettering
698cec65c4 tree-wide: port all calls to alloca() to alloca_safe() 2021-10-14 15:57:52 +02:00
Lennart Poettering
5e76324eea alloca-util: drop two unnecessary casts
memset() already returns void*, no need to cast it to that.
2021-10-14 15:57:52 +02:00
Lennart Poettering
9e1a759903 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.
2021-10-14 15:57:52 +02:00
Dan Streetman
a69f1dd9ca cgroup: when checking for legacy controllers, ignore any we don't care about 2021-10-14 14:57:49 +02:00
Daan De Meyer
6da99d33a4 Ignore local files in subdirectories of mkosi.default.d/ as well 2021-10-14 14:07:16 +02:00
Daan De Meyer
1427e56dfd mkosi: Add number prefixes to per-distro files for easier overriding
This allows developers to add override files to override per-distro settings.
2021-10-14 14:06:53 +02:00
Boqun Feng
506bbc8569 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
2021-10-13 22:22:24 +02:00
Luca Boccassi
0bc0726ead
Merge pull request #21002 from poettering/watchdog-off
minor tweaks to watchdog configuration logic
2021-10-13 20:03:06 +01:00
Max Resch
dc46792831 [sd-stub] Add support for aarch64 booting via pe-entry point 2021-10-13 18:20:32 +02:00
Lennart Poettering
9c5ea4b143 man: document new systemd.watchdog_sec= kernel cmdline option
Follow-up for: b3aa73e4de
2021-10-13 13:10:34 +02:00
Lennart Poettering
5254d15896 man: document new "off" setting for systemd-system.conf watchdog settings 2021-10-13 13:10:34 +02:00
Lennart Poettering
c91c95e66c 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).
2021-10-13 13:10:34 +02:00
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
Yu Watanabe
6870cf0729 test: show debug and verbose message 2021-10-13 12:58:24 +09:00
Yu Watanabe
6b652c03a4 sd-device-monitor: update log message to clarify the error will be ignored 2021-10-13 12:57:40 +09: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
Max Resch
200b1d997d move mfree to macro-fundamentals.h 2021-10-12 18:31:57 +02:00