1
0
mirror of https://github.com/systemd/systemd synced 2026-03-24 15:55:00 +01:00

Compare commits

...

14 Commits

Author SHA1 Message Date
Albert Brox
8a513eee30 pid1: add support for cgroup.kill 2021-08-09 12:14:26 +02:00
longpanda
2846007ecf Fix the "Failed to open random seed ..." message.
When boot ArchLinux from Ventoy, it always print `Failed to open random seed file: write protected.`
As Ventoy emulate the ISO file as a read-only CDROM, I didn't test with a real physical CDROM drive, but maybe it also has such problem.
As we use `EFI_FILE_MODE_WRITE`  to open the `loader\random-seed` file, so I think it's better to check the result with both  `EFI_WRITE_PROTECTED` and `EFI_NOT_FOUND`.
2021-08-09 10:56:01 +02:00
Yu Watanabe
5865dc1493 network: use monotonic instead of boot time to handle address creation/update timestamp
Follow-up for 25db3aeaf32ba95bad5e765720ebc23c8ef77a99 and 899034ba8167bd16e802cfbea29a9ee85dee5be5.

Fixes another issue in #20244.
2021-08-09 10:33:49 +02:00
StefanBruens
bd73806888 Update 60-autosuspend-fingerprint-reader.hwdb to libfprint-1.92.1 2021-08-09 10:17:55 +02:00
GnunuX
c5f62204ee man systemd-sysusers: fix password to passwd 2021-08-09 10:17:05 +02:00
Zbigniew Jędrzejewski-Szmek
cb18d4e5d9
Merge pull request #20395 from takaswie/topic/correct-ieee1394-hwdb-entries
hwdb: ieee1394-unit-function: correct entries for some models
2021-08-09 10:12:11 +02:00
Zbigniew Jędrzejewski-Szmek
4f11590f9b
Merge pull request #20399 from mrc0mmand/test-tweaks
test: yet another fix for ASan detection
2021-08-09 10:06:23 +02:00
Frantisek Sumsal
6476676b84 test: skip a harmless ldd error when installing test libs
Skip a harmless error when running the tests on a system with a significantly
older systemd version (ldd tries to resolve the unprefixed RPATH for libsystemd.so.0,
which is in this case older than the already installed libsystemd.so.0 in $initdir).
The issue is triggered by installing test dependencies in install_missing_libraries().

Spotted on CentOS 8.

```
$ ldd /var/tmp/systemd-test.nZO11F/root/lib/systemd/tests/test-sd-device-thread
/var/tmp/systemd-test.nZO11F/root/lib/systemd/tests/test-sd-device-thread: /lib64/libsystemd.so.0: version `LIBSYSTEMD_240' not found (required by /var/tmp/systemd-test.nZO11F/root/lib/systemd/tests/test-sd-device-thread)
        linux-vdso64.so.1 (0x00007fffb79d0000)
        libclang_rt.asan-powerpc64le.so => /usr/lib64/clang/11.0.0/lib/linux/libclang_rt.asan-powerpc64le.so (0x00007fffb6ef0000)
        libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007fffb6d20000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fffb6cd0000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fffb6ab0000)

$ LD_LIBRARY_PATH=/var/tmp/systemd-test.nZO11F/root/lib64/ ldd /var/tmp/systemd-test.nZO11F/root/lib/systemd/tests/test-sd-device-thread
        linux-vdso64.so.1 (0x00007fffaba80000)
        libclang_rt.asan-powerpc64le.so => /usr/lib64/clang/11.0.0/lib/linux/libclang_rt.asan-powerpc64le.so (0x00007fffaafa0000)
        libsystemd.so.0 => /var/tmp/systemd-test.nZO11F/root/lib64/libsystemd.so.0 (0x00007fffaa5f0000)
        libpthread.so.0 => /var/tmp/systemd-test.nZO11F/root/lib64/libpthread.so.0 (0x00007fffaa5a0000)
        libc.so.6 => /var/tmp/systemd-test.nZO11F/root/lib64/libc.so.6 (0x00007fffaa380000)

```
2021-08-09 10:04:40 +02:00
Frantisek Sumsal
25e399948b test: make busybox TEST-13-only dependency
to make running other tests a bit easier on distributions which don't have
busybox in repositories (CentOS).
2021-08-08 19:43:23 +02:00
Frantisek Sumsal
2d50e3c7bc test: yet another fix for ASan detection
This time for ppc64le:

```
100737c4:	5d 55 f9 4b 	bl      10008d20 <00000024.plt_call.__asan_report_load8>
100737f4:	4d 55 f9 4b 	bl      10008d40 <00000024.plt_call.__asan_handle_no_return>
10073884:	5d 50 f9 4b 	bl      100088e0 <00000024.plt_call.__asan_init>
1007388c:	75 54 f9 4b 	bl      10008d00 <00000024.plt_call.__asan_version_mismatch_check_v8>
100738a0:	41 36 f9 4b 	bl      10006ee0 <00000024.plt_call.__asan_register_globals>
100738f0:	71 4c f9 4b 	bl      10008560 <00000024.plt_call.__asan_unregister_globals>
```
2021-08-08 19:33:10 +02:00
Takashi Sakamoto
9f5c4c80d0 hwdb: ieee1394-unit-function: correct entries for eAR Master One and Terratec Aureon 7.1 FireWire
The configuration ROM of Acoustic Reality eAR Master One, Eroica, Figaro,
and Ciaccona has OUI for TerraTec Electronic GmbH in its vendor ID field.
As a result, modalias for the unit is the same as Terratec Electronic
Aureon 7.1 FireWire.

Linux FireWire subsystem adds the same modalias for units of the models.
ALSA bebob driver had duplicated entries for them and was changed at
Linux kernel v5.14 to remove the duplicated entries.

It's better to improve corresponding entries in systemd hwdb, while
it's impossible to distinguish the models by modalias and force to use
the same entry for them. As last resort, this commit selects more
popular model, Aureon 7.1 FireWire for ID_VENDOR_FROM_DATABASE and
ID_MODEL_FROM_DATABASE.

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a07ebc7e050ccdfec508449b2ef8f2b2aa90927b
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-08-08 08:37:46 +09:00
Takashi Sakamoto
15c04125a2 hwdb: ieee1394-unit-function: correct comment for Mackie d.2 and d.2 Pro
I had misunderstanding that BridgeCo ASIC would be used for extension
option for Mackie d.2 and OXFW971 would be used for Mackie d.2 Pro like
Mackie d.4 Pro. However, it's clear that the latter is model with
pre-installed option.

This commit fixes commit to entry for Mackie d.2. I note that the modalias
of unit of Mackie d.4 Pro is still unidentified.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-08-08 08:37:46 +09:00
Takashi Sakamoto
1ba328a1e6 hwdb: ieee1394-unit-function: correct comment for Mackie Onyx-i series
Some Mackie Onyx-i models are known to have two revisions at least, which
use different ASICS; Oxford Semiconductor FW971 and TC Applied
Technologies TCD2210. I misunderstand that Onyx 1640i had not such
revisions.

This commit fixes comment to entry for the model.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-08-08 08:37:46 +09:00
Takashi Sakamoto
343ff58001 hwdb: ieee1394-unit-function: correct entries for Phonic products
Some of Phonic Firefly series and Helix Board series have the same
combination of vendor ID, model ID, specifier ID, and software
version in their configuration ROM. On the other hand, the other models
have unique combination.

ALSA bebob driver in Linux kernel v5.14 was changed in its modalias table
for the models.

This commit fixes systemd hwdb for the models.

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1586d461f641b60040438275e14c7dbcec5907d6
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2021-08-08 08:37:46 +09:00
9 changed files with 143 additions and 41 deletions

View File

@ -68,6 +68,11 @@ usb:v08FFp5731*
usb:v5501p08FF*
ID_AUTOSUSPEND=1
# Supported by libfprint driver egis0570
usb:v1C7Ap0570*
usb:v1C7Ap0571*
ID_AUTOSUSPEND=1
# Supported by libfprint driver elan
usb:v04F3p0903*
usb:v04F3p0907*
@ -127,6 +132,11 @@ usb:v04F3p0C42*
usb:v04F3p0C4D*
usb:v04F3p0C4F*
usb:v04F3p0C63*
usb:v04F3p0C6E*
ID_AUTOSUSPEND=1
# Supported by libfprint driver elanmoc
usb:v04F3p0C7E*
ID_AUTOSUSPEND=1
# Supported by libfprint driver etes603
@ -264,7 +274,6 @@ usb:v147Ep1002*
usb:v1491p0088*
usb:v16D1p1027*
usb:v1C7Ap0300*
usb:v1C7Ap0570*
usb:v1C7Ap0575*
usb:v27C6p5042*
usb:v27C6p5110*

View File

@ -112,14 +112,6 @@ ieee1394:ven*sp0000A02Dver00000110
# BridgeCo. Enhancement BreakOut Box (BeBoB) for DM1000, DM1100, and DM1500 ASICs.
#
# Match to eAR Master One, Eroica, Figaro, and Ciaccona.
ieee1394:node:ven0x000aacmo0x000002units0x00a02d:0x010001
ieee1394:ven00000AACmo00000002sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Acoustic Reality
ID_MODEL_FROM_DATABASE=eAR FireWire Audio
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
ieee1394:node:ven0x0003dbmo0x01eeeeunits0x00a02d:0x010001
ieee1394:ven000003DBmo0001EEEEsp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Apogee Electronics
@ -322,7 +314,7 @@ ieee1394:ven00000FF2mo00010065sp0000A02Dver00010001
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
# An extension card for Mackie d.2.
# An extension card for Mackie d.2. Mackie d.2 Pro is preinstalled model.
ieee1394:node:ven0x000ff2mo0x010067units0x00a02d:0x010001
ieee1394:ven00000FF2mo00010067sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Loud Technologies
@ -330,8 +322,41 @@ ieee1394:ven00000FF2mo00010067sp0000A02Dver00010001
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
# Match to FireFly 202, 302, 808, and 808 Universal.
# Match to HelixBoard 12 mk II, 18 mk II, 24 mk II, 12 Universal, 18 Universal, and 24 Universal.
ieee1394:node:ven0x001496mo0x050000units0x00a02d:0x010001
ieee1394:ven00001496mo00050000sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Phonic
ID_MODEL_FROM_DATABASE=Helixboard 12 FireWire MkII
IEEE1394_UNIT_FUNCTION_MIDI=1
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
ieee1394:node:ven0x001496mo0x060000units0x00a02d:0x010001
ieee1394:ven00001496mo00060000sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Phonic
ID_MODEL_FROM_DATABASE=Helixboard 18 FireWire MkII
IEEE1394_UNIT_FUNCTION_MIDI=1
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
ieee1394:node:ven0x001496mo0x070000units0x00a02d:0x010001
ieee1394:ven00001496mo00070000sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Phonic
ID_MODEL_FROM_DATABASE=Helixboard 24 FireWire MkII
IEEE1394_UNIT_FUNCTION_MIDI=1
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
ieee1394:node:ven0x001496mo0x080000units0x00a02d:0x010001
ieee1394:ven00001496mo00080000sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Phonic
ID_MODEL_FROM_DATABASE=Firefly 808 FireWire
IEEE1394_UNIT_FUNCTION_MIDI=1
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
# Match to FireFly 202, 302, 808 Universal.
# Match to HelixBoard 12 FireWire, 18 FireWire, 24 FireWire.
# Match to HelixBoard 12 Universal, 18 Universal, and 24 Universal.
ieee1394:node:ven0x001496mo0x000000units0x00a02d:0x010001
ieee1394:ven00001496mo00000000sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Phonic
@ -386,6 +411,15 @@ ieee1394:ven00010065mo00010067sp0000A02Dver00010001
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
# Match to TerraTec Aureon 7.1 FireWire.
# Match to eAR Master One, Eroica, Figaro, and Ciaccona. OEM by TerraTec perhaps.
ieee1394:node:ven0x000aacmo0x000002units0x00a02d:0x010001
ieee1394:ven00000AACmo00000002sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=TerraTec
ID_MODEL_FROM_DATABASE=Aureon 7.1 FireWire
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
ieee1394:node:ven0x000aacmo0x000003units0x00a02d:0x010001
ieee1394:ven00000AACmo00000003sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=TerraTec Electronic
@ -545,6 +579,7 @@ ieee1394:ven00000FF2mo00081216sp0000A02Dver00010001
IEEE1394_UNIT_FUNCTION_AUDIO=1
IEEE1394_UNIT_FUNCTION_VIDEO=0
# Match to former model of Onyx 1640i.
ieee1394:node:ven0x000ff2mo0x001640units0x00a02d:0x010001
ieee1394:ven00000FF2mo00001640sp0000A02Dver00010001
ID_VENDOR_FROM_DATABASE=Loud Technologies
@ -707,7 +742,7 @@ ieee1394:ven00000FF2mo00000007sp00000FF2ver00000001
ID_MODEL_FROM_DATABASE=Mackie Onyx Blackbird
IEEE1394_UNIT_FUNCTION_AUDIO=1
# Match to Onyx 1640i, and latter models of Onyx 820i, 1220i, and 1620i.
# Match to latter models of Onyx 820i, 1220i, 1620i, and 1640i.
ieee1394:node:ven0x000ff2mo0x000006units0x000ff2:0x000001
ieee1394:ven00000FF2mo00000006sp00000FF2ver00000001
ID_VENDOR_FROM_DATABASE=Loud Technologies

View File

@ -172,7 +172,7 @@
for the first time it is possible to configure the root user's password to be <literal>systemd</literal>
like this:</para>
<para><programlisting># systemd-nspawn --image=… --set-credential=password.hashed-password.root:'$y$j9T$yAuRJu1o5HioZAGDYPU5d.$F64ni6J2y2nNQve90M/p0ZP0ECP/qqzipNyaY9fjGpC' …</programlisting></para>
<para><programlisting># systemd-nspawn --image=… --set-credential=passwd.hashed-password.root:'$y$j9T$yAuRJu1o5HioZAGDYPU5d.$F64ni6J2y2nNQve90M/p0ZP0ECP/qqzipNyaY9fjGpC' …</programlisting></para>
<para>Note again that the data specified in these credentials is consulted only when creating an account
for the first time, it may not be used for changing the password or shell of an account that already

View File

@ -160,6 +160,24 @@ bool cg_freezer_supported(void) {
return supported;
}
bool cg_kill_supported(void) {
static thread_local int supported = -1;
if (supported >= 0)
return supported;
if (cg_all_unified() <= 0)
supported = false;
else if (access("/sys/fs/cgroup/init.scope/cgroup.kill", F_OK) < 0) {
if (errno != ENOENT)
log_debug_errno(errno, "Failed to check if cgroup.kill is available, assuming not: %m");
supported = false;
} else
supported = true;
return supported;
}
int cg_enumerate_subgroups(const char *controller, const char *path, DIR **_d) {
_cleanup_free_ char *fs = NULL;
int r;
@ -358,6 +376,29 @@ int cg_kill(
return cg_kill_items(controller, path, sig, flags, s, log_kill, userdata, "cgroup.threads");
}
int cg_kill_kernel_sigkill(const char *controller, const char *path) {
/* Kills the cgroup at `path` directly by writing to its cgroup.kill file.
* This sends SIGKILL to all processes in the cgroup and has the advantage of
* being completely atomic, unlike cg_kill_items. */
int r;
_cleanup_free_ char *killfile = NULL;
assert(path);
if (!cg_kill_supported())
return -EOPNOTSUPP;
r = cg_get_path(controller, path, "cgroup.kill", &killfile);
if (r < 0)
return r;
r = write_string_file(killfile, "1", WRITE_STRING_FILE_DISABLE_BUFFER);
if (r < 0)
return r;
return 0;
}
int cg_kill_recursive(
const char *controller,
const char *path,
@ -375,38 +416,46 @@ int cg_kill_recursive(
assert(path);
assert(sig >= 0);
if (!s) {
s = allocated_set = set_new(NULL);
if (!s)
return -ENOMEM;
}
if (sig == SIGKILL && cg_kill_supported() &&
!FLAGS_SET(flags, CGROUP_IGNORE_SELF) && !s && !log_kill) {
/* ignore CGROUP_SIGCONT, since this is a no-op alongside SIGKILL */
ret = cg_kill_kernel_sigkill(controller, path);
if (ret < 0)
return ret;
} else {
if (!s) {
s = allocated_set = set_new(NULL);
if (!s)
return -ENOMEM;
}
ret = cg_kill(controller, path, sig, flags, s, log_kill, userdata);
ret = cg_kill(controller, path, sig, flags, s, log_kill, userdata);
r = cg_enumerate_subgroups(controller, path, &d);
if (r < 0) {
if (ret >= 0 && r != -ENOENT)
return r;
r = cg_enumerate_subgroups(controller, path, &d);
if (r < 0) {
if (ret >= 0 && r != -ENOENT)
return r;
return ret;
}
return ret;
}
while ((r = cg_read_subgroup(d, &fn)) > 0) {
_cleanup_free_ char *p = NULL;
while ((r = cg_read_subgroup(d, &fn)) > 0) {
_cleanup_free_ char *p = NULL;
p = path_join(empty_to_root(path), fn);
free(fn);
if (!p)
return -ENOMEM;
p = path_join(empty_to_root(path), fn);
free(fn);
if (!p)
return -ENOMEM;
r = cg_kill_recursive(controller, p, sig, flags, s, log_kill, userdata);
if (r != 0 && ret >= 0)
r = cg_kill_recursive(controller, p, sig, flags, s, log_kill, userdata);
if (r != 0 && ret >= 0)
ret = r;
}
if (ret >= 0 && r < 0)
ret = r;
}
if (ret >= 0 && r < 0)
ret = r;
if (flags & CGROUP_REMOVE) {
if (FLAGS_SET(flags, CGROUP_REMOVE)) {
r = cg_rmdir(controller, path);
if (r < 0 && ret >= 0 && !IN_SET(r, -ENOENT, -EBUSY))
return r;

View File

@ -172,6 +172,7 @@ typedef enum CGroupFlags {
typedef int (*cg_kill_log_func_t)(pid_t pid, int sig, void *userdata);
int cg_kill(const char *controller, const char *path, int sig, CGroupFlags flags, Set *s, cg_kill_log_func_t kill_log, void *userdata);
int cg_kill_kernel_sigkill(const char *controller, const char *path);
int cg_kill_recursive(const char *controller, const char *path, int sig, CGroupFlags flags, Set *s, cg_kill_log_func_t kill_log, void *userdata);
int cg_split_spec(const char *spec, char **ret_controller, char **ret_path);
@ -272,6 +273,7 @@ int cg_kernel_controllers(Set **controllers);
bool cg_ns_supported(void);
bool cg_freezer_supported(void);
bool cg_kill_supported(void);
int cg_all_unified(void);
int cg_hybrid_unified(void);

View File

@ -245,7 +245,7 @@ EFI_STATUS process_random_seed(EFI_FILE *root_dir, RandomSeedMode mode) {
err = uefi_call_wrapper(root_dir->Open, 5, root_dir, &handle, (CHAR16*) L"\\loader\\random-seed", EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0ULL);
if (EFI_ERROR(err)) {
if (err != EFI_NOT_FOUND)
if (err != EFI_NOT_FOUND && err != EFI_WRITE_PROTECTED)
Print(L"Failed to open random seed file: %r\n", err);
return err;
}

View File

@ -765,7 +765,9 @@ static int ndisc_router_process_autonomous_prefix(Link *link, sd_ndisc_router *r
assert(link);
assert(rt);
r = sd_ndisc_router_get_timestamp(rt, clock_boottime_or_monotonic(), &time_now);
/* Do not use clock_boottime_or_monotonic() here, as the kernel internally manages cstamp and
* tstamp with jiffies, and it is not increased while the system is suspended. */
r = sd_ndisc_router_get_timestamp(rt, CLOCK_MONOTONIC, &time_now);
if (r < 0)
return log_link_error_errno(link, r, "Failed to get RA timestamp: %m");

View File

@ -11,6 +11,7 @@ TEST_NO_NSPAWN=1
test_append_files() {
(
local workspace="${1:?}"
dracut_install busybox
if selinuxenabled >/dev/null; then
dracut_install selinuxenabled

View File

@ -126,7 +126,6 @@ BASICTOOLS=(
base64
basename
bash
busybox
capsh
cat
chmod
@ -229,7 +228,7 @@ is_built_with_asan() {
# Borrowed from https://github.com/google/oss-fuzz/blob/cd9acd02f9d3f6e80011cc1e9549be526ce5f270/infra/base-images/base-runner/bad_build_check#L182
local _asan_calls
_asan_calls="$(objdump -dC "$SYSTEMD_JOURNALD" | grep -E "(callq?|brasl?)\s+[^ <]+\s+<__asan" -c)"
_asan_calls="$(objdump -dC "$SYSTEMD_JOURNALD" | grep -E "(callq?|brasl?|bl)\s.+__asan" -c)"
if ((_asan_calls < 1000)); then
return 1
else
@ -1681,6 +1680,11 @@ inst_libs() {
while read -r line; do
[[ "$line" = 'not a dynamic executable' ]] && break
# Skip a harmless error when running the tests on a system with a significantly
# older systemd version (ldd tries to resolve the unprefixed RPATH for libsystemd.so.0,
# which is in this case older than the already installed libsystemd.so.0 in $initdir).
# The issue is triggered by installing test dependencies in install_missing_libraries().
[[ "$line" =~ libsystemd.so.*:\ version\ .*\ not\ found ]] && continue
if [[ "$line" =~ $so_regex ]]; then
file="${BASH_REMATCH[1]}"