1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-27 03:21:32 +03:00
Commit Graph

61176 Commits

Author SHA1 Message Date
Daan De Meyer
983154f518 repart: Use ftruncate() instead of posix_allocate() 2022-11-21 10:44:38 +01:00
Daan De Meyer
766f52f25c repart: Fix parse_filter_partitions() log messages 2022-11-21 10:36:37 +01:00
Daan De Meyer
53538e33e9 repart: Fix FilterPartitionsType enum name 2022-11-21 10:35:18 +01:00
Daan De Meyer
5f59807d2d repart: Rework unused partition number algorithm 2022-11-21 10:34:28 +01:00
Daan De Meyer
c1979cd881 repart: Use IN_SET() in one more place 2022-11-21 10:28:36 +01:00
Richard E. van der Luit
214ba5cadf po: Translated using Weblate (Dutch)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Richard E. van der Luit <fedoraproject@veneax.nl>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/nl/
Translation: systemd/main
2022-11-21 00:43:55 +09:00
Jan Janssen
967a868563 boot: Replace firmware security hooks directly
For some firmware, replacing their own security arch instance with our
override using ReinstallProtocolInterface() is not enough as they will
not use it. This commit goes back to how this was done before by
directly modifying the security protocols.

Fixes: #25336
2022-11-19 16:39:04 +01:00
Jan Janssen
5489c13bae boot: Rework security arch override
This simplifies the caller interface for security arch overrides by only
having to pass a validator and an optional context.
2022-11-19 16:37:27 +01:00
Jan Janssen
679007044f boot: Manually convert filepaths if needed
The conversion of a filepath device path to text is needed for the stub
loader to find credential files.
2022-11-19 16:36:02 +01:00
Jan Janssen
af7ef648cd boot: Do not require a loaded image path
If the device path to text protocol is not available (looking angrily at
Apple) we would fail to boot because we cannot get the loaded image
path. As this is only used for cosmetic purposes, we can just silently
continue.

Fixes: #25363
2022-11-19 16:36:02 +01:00
Jan Janssen
b7b327f856 boot: Fix memory leak 2022-11-19 16:36:02 +01:00
lichao
eb263aabb0 remove obsolete translate in zh_CN.po 2022-11-19 23:51:39 +09:00
Yu Watanabe
da2e6df00a
Merge pull request #25438 from poettering/localhost-ifindex-tweak
resolved: fix ifindex for contacting per-interface DNS server if it is 127.0.0.1
2022-11-19 15:36:12 +09:00
Yu Watanabe
26627c088b
Merge pull request #25423 from yuwata/network-tc-cake-rtt-and-ack-filter
network: tc-cake: support controlling RTT and ACK filter
2022-11-19 15:35:49 +09:00
Mike Yuan
2d8cc7a7bb dbus-manager: add comments about booleans in function calls
Update to match the new coding style
See also: https://github.com/systemd/systemd/pull/25437#discussion_r1026934242
2022-11-19 14:34:08 +09:00
Yu Watanabe
77d5f36d93 test-network: add tests for RTT and ACK filter for CAKE 2022-11-19 07:08:26 +09:00
Yu Watanabe
8c92063633 network: tc-cake: add support to specify ACK filter 2022-11-19 07:08:22 +09:00
Yu Watanabe
8077dc9657
Merge pull request #25389 from fbuihuu/update-test-for-opensuse
Update test/ for openSUSE
2022-11-19 05:58:51 +09:00
Lennart Poettering
af1bed8e83 bootctl: rework how we handle referenced but absent EFI boot entries
Follow-up for #25368.

Let's consider ENOENT an expected error, and just debug log about it
(though, let's suffix it with `, ignoring.`). All other errors will log
loudly, as they are unexpected errors.
2022-11-19 05:27:50 +09:00
Lennart Poettering
6e32414a66 resolved: when configuring 127.0.0.1 as per-interface DNS server, contact it via "lo" always
ussually if you specify a DNS server on some interface then we'll use
that interface to talk to it. Let's override this for localhost
addresses, as they only really make sense on "lo".

Fixes: #25397
2022-11-18 16:54:46 +01:00
Lennart Poettering
5faaed5b62 resolved: use right conditionalization when setting unicast ifindex on UDP sockets 2022-11-18 16:53:31 +01:00
Sam James
b9e7f22c2d nspawn: allow sched_rr_get_interval_time64 through seccomp filter
We only allow a selected subset of syscalls from nspawn containers
and don't list any time64 variants (needed for 32-bit arches when
built using TIME_BITS=64, which is relatively new).

We allow sched_rr_get_interval which cpython's test suite makes
use of, but we don't allow sched_rr_get_interval_time64.

The test failures when run in an arm32 nspawn container on an arm64 host
were as follows:
```
======================================================================
ERROR: test_sched_rr_get_interval (test.test_posix.PosixTester.test_sched_rr_get_interval)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/python-3.11.0_p1/work/Python-3.11.0/Lib/test/test_posix.py", line 1180, in test_sched_rr_get_interval
    interval = posix.sched_rr_get_interval(0)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 1] Operation not permitted
```

Then strace showed:
```
sched_rr_get_interval_time64(0, 0xffbbd4a0) = -1 EPERM (Operation not permitted)
```

This appears to be the only time64 syscall that isn't already included one of
the sets listed in nspawn-seccomp.c that has a non-time64 variant. Checked
over each of the time64 syscalls known to systemd and verified that none
of the others had a non-time64-variant whitelisted in nspawn other than
sched_rr_get_interval.

Bug: https://bugs.gentoo.org/880131
2022-11-18 16:32:17 +01:00
reuben olinsky
f8a7112c47 sysupdate: Support volatile-root for finding the root partition
The existing logic can't find the root device in scenarios where
the root has been replaced with an overlay. We support looking
at "/run/systemd/volatile-root" to find the original root, similar
to what systemd-repart and gpt-auto-generator do.
2022-11-18 16:31:22 +01:00
Lennart Poettering
d995ccd7b5 update TODO 2022-11-18 14:58:30 +01:00
Lennart Poettering
eb2a610210
Merge pull request #25410 from DaanDeMeyer/mkfs-xfs-fixes
Followups for #25400
2022-11-18 14:45:48 +01:00
Li kunyu
fc0cc6db1e boot/measure: fix oom check 2022-11-18 21:02:03 +09:00
Franck Bui
eb1f60230a test: fix the default timeout values described in README.testsuite
Unlike it was described, the default is 30 min.
2022-11-18 11:09:44 +01:00
Franck Bui
cc77a56532 meson: install test-kernel-install only when -Dkernel-install=true
This patch fixes the following build failure:

  meson.build:3853:8: ERROR: Unknown variable "test_kernel_install_sh".

Fixes #25432.
2022-11-18 11:09:35 +01:00
Franck Bui
4e8172c88a tests: update install_suse_systemd()
- Use inst_recursive() and image_install() helpers where appropriate

- Update comments to explain why we need to install the test data manually in
  $initdir

- Install manual/ in $initdir as TEST-35-LOGIN relies on
  manual/test-session-properties
2022-11-18 11:03:22 +01:00
Li kunyu
f54f6d88b1
fuzz: fuzz-compress: fix copy-and-paste error: buf -> buf2 (#25431) 2022-11-18 15:03:41 +09:00
Luca Boccassi
daefca4611
Merge pull request #25414 from zx2c4-forks/krngseed
EFI random seed post #25319 review fixups
2022-11-17 19:49:40 +01:00
Daan De Meyer
0ae03a0fe7 kmod-setup: Make sure the tpm module is available early
Required for early boot services such as systemd-pcrphase-sysinit
which need early access to the tpm.
2022-11-17 18:17:44 +01:00
Jason A. Donenfeld
1d679b208d Update NEWS and TODO with sd-boot random seed developments 2022-11-17 18:15:04 +01:00
Lennart Poettering
fa4c01933d
Merge pull request #25333 from yuwata/find-esp-part-entry-scheme
find-esp: downgrade and ignore error on retrieving PART_ENTRY_SCHEME
2022-11-17 15:28:54 +01:00
Lennart Poettering
128a11ea99 signal-util: add common implementation for propagating a signal
i.e. let's add a common logic to be called from a signal handler to
raise the passed signal again.

Follow-up for: #25399
2022-11-17 22:38:14 +09:00
Edson Juliano Drosdeck
58dad4d5e5
hwdb: fix Compaq N14KP6 key toggle touchpad (#25404) 2022-11-17 22:37:08 +09:00
Daan De Meyer
f9fbac8b1f log: Remove log_ratelimit_debug() macros
These don't make sense anymore since we disable log ratelimiting
when logging at debug level.
2022-11-17 22:16:18 +09:00
Daan De Meyer
0b75744d5c repart: Write temporary LUKS header to /var/tmp instead of /tmp
This is a relatively large file so let's not create it in memory.
2022-11-17 14:15:28 +01:00
Daan De Meyer
48ac1fd132 Followups for aa6aa81c1e 2022-11-17 14:14:45 +01:00
Daan De Meyer
dd3c825294 tmpfile-util: Introduce fopen_temporary_child()
Instead of having fopen_temporary() create the file either next
to an existing file or in tmp/, let's split this up clearly into
two different functions, one for creating temporary files next to
existing files, and one for creating a temporary file in a directory.
2022-11-17 14:14:31 +01:00
Yu Watanabe
3af9cd0bf1 network: tc-cake: add support to specify RTT 2022-11-17 21:13:42 +09:00
Jason A. Donenfeld
1a2b1e10bd boot: only use __builtin_object_size with -O>0
__builtin_object_size() returns -1 with -O0, so disable this and warn
about it instead.
2022-11-17 12:23:17 +01:00
Jason A. Donenfeld
5d29d07b34 boot: do not truncate random seed file
There are concerns about the FAT file system driver exploding if we try
to do this, so just leave the bytes zeroed out instead.
2022-11-17 12:22:32 +01:00
Jason A. Donenfeld
3daeef0884 random-seed: handle post-merge review nits
These are various misc things that came up after merging.
2022-11-17 12:22:27 +01:00
Marcus Schäfer
305dd91adf Handle MACHINE_ID=uninitialized
systemd supports /etc/machine-id to be set to: uninitialized
In this case the expectation is that systemd creates a new
machine ID and replaces the value 'uninitialized' with the
effective machine id. In the scope of kernel-install we
should also enforce the creation of a new machine id in this
condition
2022-11-17 07:45:25 +09:00
Lennart Poettering
6337be0a4e pcrphase: add $SYSTEMD_PCRPHASE_STUB_VERIFY env var for overriding stub check 2022-11-17 07:44:11 +09:00
Vitaly Kuznetsov
155c51293d shared/tpm2-util: Fix "Error: Esys invalid ESAPI handle (40000001)" warning
systemd-cryptenroll complains (but succeeds!) upon binding to a signed PCR
policy:

$ systemd-cryptenroll --unlock-key-file=/tmp/passphrase --tpm2-device=auto
  --tpm2-public-key=... --tpm2-signature=..." /tmp/tmp.img

ERROR:esys:src/tss2-esys/esys_iutil.c:394:iesys_handle_to_tpm_handle() Error: Esys invalid ESAPI handle (40000001).
WARNING:esys:src/tss2-esys/esys_iutil.c:415:iesys_is_platform_handle() Convert handle from TPM2_RH to ESYS_TR, got: 0x40000001
ERROR:esys:src/tss2-esys/esys_iutil.c:394:iesys_handle_to_tpm_handle() Error: Esys invalid ESAPI handle (40000001).
WARNING:esys:src/tss2-esys/esys_iutil.c:415:iesys_is_platform_handle() Convert handle from TPM2_RH to ESYS_TR, got: 0x4000000
New TPM2 token enrolled as key slot 1.

The problem seems to be that Esys_LoadExternal() function from tpm2-tss
expects a 'ESYS_TR_RH*' constant specifying the requested hierarchy and not
a 'TPM2_RH_*' one (see Esys_LoadExternal() -> Esys_LoadExternal_Async() ->
iesys_handle_to_tpm_handle() call chain).

It all works because Esys_LoadExternal_Async() falls back to using the
supplied values when iesys_handle_to_tpm_handle() fails:

    r = iesys_handle_to_tpm_handle(hierarchy, &tpm_hierarchy);
    if (r != TSS2_RC_SUCCESS) {
        ...
        tpm_hierarchy = hierarchy;
    }

Note, TPM2_RH_OWNER was used on purpose to support older tpm2-tss versions
(pre https://github.com/tpm2-software/tpm2-tss/pull/1531), use meson magic
to preserve compatibility.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
2022-11-16 21:45:57 +01:00
Lennart Poettering
c204cfb2e8
Merge pull request #25399 from DaanDeMeyer/siginfo-crash
crash-handler: Make sure we propagate the original siginfo
2022-11-16 18:42:07 +01:00
Daan De Meyer
ffa8d1ba39
Merge pull request #25096 from DaanDeMeyer/journald-log-fixes
journal: Ratelimit more journald log messages
2022-11-16 16:40:00 +01:00
Daan De Meyer
2af3e23fc0 crash-handler: Make sure we propagate the original siginfo
If we call raise(), we lose the information from the original signal.
If we use rt_sigqueueinfo(), the original siginfo gets reused which
is helpful when debugging crashes.
2022-11-16 16:07:35 +01:00