1
0
mirror of https://github.com/systemd/systemd synced 2025-11-21 01:34:44 +01:00

Compare commits

..

No commits in common. "675fa49f69943b0f009c973ed3d1e90afc1d88b1" and "bb437748da02c43bda64ecaf980a5377825ec1a6" have entirely different histories.

21 changed files with 30 additions and 135 deletions

View File

@ -825,9 +825,12 @@ mouse:usb:v0e8fp00a7:name:DaKai 2.4G RX:*
# Nulea # Nulea
########################################## ##########################################
# Note: The Nulea uses a generic USB dongle. Overriding its value would cause # Note: it is possible that other devices may use the same wireless dongle,
# other mice to be erroneously registered as trackballs, so only bluetooth # as such this could require revisiting if it causes issues with other mice
# detection is added. # Nulea M501 Wireless Trackball (USB Receiver)
mouse:usb:v25a7pfa61:name:Compx 2.4G Receiver Mouse:*
ID_INPUT_TRACKBALL=1
# Nulea M501 Wireless Trackball (Bluetooth) # Nulea M501 Wireless Trackball (Bluetooth)
mouse:bluetooth:v000ep3412:name:Nulea BT5.0 Mouse:* mouse:bluetooth:v000ep3412:name:Nulea BT5.0 Mouse:*
ID_INPUT_TRACKBALL=1 ID_INPUT_TRACKBALL=1

View File

@ -22,7 +22,6 @@ Packages=
dbus-broker dbus-broker
dbus-broker-units dbus-broker-units
dhcp dhcp
elfutils
erofs-utils erofs-utils
f2fs-tools f2fs-tools
git git
@ -40,7 +39,6 @@ Packages=
openssl openssl
pacman pacman
perf perf
pkgconf
polkit polkit
procps-ng procps-ng
psmisc psmisc

View File

@ -28,8 +28,6 @@ Packages=
device-mapper-event device-mapper-event
device-mapper-multipath device-mapper-multipath
dfuzzer dfuzzer
elfutils-devel
elfutils-libs
erofs-utils erofs-utils
git-core git-core
glibc-langpack-de glibc-langpack-de
@ -51,7 +49,6 @@ Packages=
pam pam
passwd passwd
perf perf
pkgconf
policycoreutils policycoreutils
polkit polkit
procps-ng procps-ng

View File

@ -53,8 +53,6 @@ Packages=
isc-dhcp-server isc-dhcp-server
knot knot
libcap-ng-utils libcap-ng-utils
libdw-dev
libdw1
locales locales
login login
man-db man-db
@ -65,7 +63,6 @@ Packages=
openssh-server openssh-server
passwd passwd
polkitd polkitd
pkgconf
procps procps
psmisc psmisc
python3-pexpect python3-pexpect

View File

@ -58,8 +58,6 @@ Packages=
knot knot
libapparmor1 libapparmor1
libcap-progs libcap-progs
libdw-devel
libdw1
libtss2-tcti-device0 libtss2-tcti-device0
man man
multipath-tools multipath-tools
@ -70,7 +68,6 @@ Packages=
pam pam
patterns-base-minimal_base patterns-base-minimal_base
perf perf
pkgconf
procps4 procps4
psmisc psmisc
python3-pefile python3-pefile

View File

@ -207,7 +207,7 @@ efi_c_ld_args = [
] ]
linker_sanity_code = 'void a(void) {}; void _start(void) { a(); }' linker_sanity_code = 'void a(void) {}; void _start(void) { a(); }'
linker_sanity_args = ['-nostdlib', '-Wl,--fatal-warnings', '-fno-stack-protector'] linker_sanity_args = ['-nostdlib', '-Wl,--fatal-warnings']
# Check if libgcc is available and then use it. It is needed for gcc builds # Check if libgcc is available and then use it. It is needed for gcc builds
# and for ia32 builds with clang. # and for ia32 builds with clang.

View File

@ -291,7 +291,7 @@ rmdir "$BOOT_ROOT/hoge"
########################################### ###########################################
output="$("$kernel_install" -v --json=pretty inspect 1.1.1 "$D/sources/linux")" output="$("$kernel_install" -v --json=pretty inspect 1.1.1 "$D/sources/linux")"
diff -u <(echo "$output") - >&2 <<EOF diff -u <(echo "$output") - <<EOF
{ {
"MachineID" : "3e0484f3634a418b8e6a39e8828b03e3", "MachineID" : "3e0484f3634a418b8e6a39e8828b03e3",
"KernelImageType" : "unknown", "KernelImageType" : "unknown",
@ -309,7 +309,7 @@ diff -u <(echo "$output") - >&2 <<EOF
"$D/00-skip.install" "$D/00-skip.install"
], ],
"PluginEnvironment" : [ "PluginEnvironment" : [
"LC_COLLATE=$SYSTEMD_DEFAULT_LOCALE", "LC_COLLATE=C.UTF-8",
"KERNEL_INSTALL_VERBOSE=1", "KERNEL_INSTALL_VERBOSE=1",
"KERNEL_INSTALL_IMAGE_TYPE=unknown", "KERNEL_INSTALL_IMAGE_TYPE=unknown",
"KERNEL_INSTALL_MACHINE_ID=3e0484f3634a418b8e6a39e8828b03e3", "KERNEL_INSTALL_MACHINE_ID=3e0484f3634a418b8e6a39e8828b03e3",

View File

@ -132,7 +132,7 @@ _sd_const_ static __inline__ int sd_id128_is_allf(sd_id128_t a) {
#define SD_ID128_NULL ((const sd_id128_t) { .qwords = { 0, 0 }}) #define SD_ID128_NULL ((const sd_id128_t) { .qwords = { 0, 0 }})
#define SD_ID128_ALLF ((const sd_id128_t) { .qwords = { UINT64_C(0xFFFFFFFFFFFFFFFF), UINT64_C(0xFFFFFFFFFFFFFFFF) }}) #define SD_ID128_ALLF ((const sd_id128_t) { .qwords = { UINT64_C(0xFFFFFFFFFFFFFFFF), UINT64_C(0xFFFFFFFFFFFFFFFF) }})
static __inline__ int sd_id128_in_setv(sd_id128_t a, va_list ap) { _sd_const_ static __inline__ int sd_id128_in_setv(sd_id128_t a, va_list ap) {
for (;;) { for (;;) {
sd_id128_t b = va_arg(ap, sd_id128_t); sd_id128_t b = va_arg(ap, sd_id128_t);

View File

@ -14,7 +14,6 @@ path = run_command(sh, '-c', 'echo "$PATH"', check: true).stdout().strip()
test_env = { test_env = {
'PATH' : meson.project_build_root() + ':' + path, 'PATH' : meson.project_build_root() + ':' + path,
'PROJECT_BUILD_ROOT' : meson.project_build_root(), 'PROJECT_BUILD_ROOT' : meson.project_build_root(),
'SYSTEMD_DEFAULT_LOCALE' : get_option('default-locale'),
'SYSTEMD_SLOW_TESTS' : want_slow_tests ? '1' : '0', 'SYSTEMD_SLOW_TESTS' : want_slow_tests ? '1' : '0',
'PYTHONDONTWRITEBYTECODE' : '1', 'PYTHONDONTWRITEBYTECODE' : '1',
} }
@ -276,17 +275,6 @@ executables += [
'sources' : files('test-compress.c'), 'sources' : files('test-compress.c'),
'link_with' : [libshared], 'link_with' : [libshared],
}, },
test_template + {
'sources' : files('test-coredump-stacktrace.c'),
'type' : 'manual',
# This test intentionally crashes with SIGSEGV by dereferencing a NULL pointer
# to generate a coredump with a predictable stack trace. To prevent sanitizers
# from catching the error first let's disable them explicitly, and also always
# build with minimal optimizations to make the stack trace predictable no matter
# what we build the rest of systemd with
'override_options' : ['b_sanitize=none', 'strip=false', 'debug=true'],
'c_args' : ['-fno-sanitize=all', '-fno-optimize-sibling-calls', '-O1'],
},
test_template + { test_template + {
'sources' : files('test-cryptolib.c'), 'sources' : files('test-cryptolib.c'),
'dependencies' : libopenssl, 'dependencies' : libopenssl,

View File

@ -1,29 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* This is a test program that intentionally segfaults so we can generate a
* predictable-ish stack trace in tests. */
#include <stdlib.h>
__attribute__((noinline))
static void baz(int *x) {
*x = rand();
}
__attribute__((noinline))
static void bar(void) {
int * volatile x = NULL;
baz(x);
}
__attribute__((noinline))
static void foo(void) {
bar();
}
int main(void) {
foo();
return 0;
}

View File

@ -5,7 +5,7 @@ integration_tests += [
integration_test_template + { integration_test_template + {
'name' : fs.name(meson.current_source_dir()), 'name' : fs.name(meson.current_source_dir()),
'storage': 'persistent', 'storage': 'persistent',
'coredump-exclude-regex' : '/(test-usr-dump|test-dump|test-stacktrace(-not)?-symbolized|bash)$', 'coredump-exclude-regex' : '/(test-usr-dump|test-dump|bash)$',
'vm' : true, 'vm' : true,
'firmware' : 'auto', 'firmware' : 'auto',
}, },

View File

@ -8,13 +8,15 @@ set -o pipefail
# Make sure the binary name fits into 15 characters # Make sure the binary name fits into 15 characters
CORE_TEST_BIN="/tmp/test-dump" CORE_TEST_BIN="/tmp/test-dump"
CORE_STACKTRACE_TEST_BIN="/tmp/test-stacktrace-dump"
MAKE_STACKTRACE_DUMP="/tmp/make-stacktrace-dump"
CORE_TEST_UNPRIV_BIN="/tmp/test-usr-dump" CORE_TEST_UNPRIV_BIN="/tmp/test-usr-dump"
MAKE_DUMP_SCRIPT="/tmp/make-dump" MAKE_DUMP_SCRIPT="/tmp/make-dump"
# Unset $PAGER so we don't have to use --no-pager everywhere # Unset $PAGER so we don't have to use --no-pager everywhere
export PAGER= export PAGER=
at_exit() { at_exit() {
rm -fv -- "$CORE_TEST_BIN" "$CORE_TEST_UNPRIV_BIN" "$MAKE_DUMP_SCRIPT" rm -fv -- "$CORE_TEST_BIN" "$CORE_TEST_UNPRIV_BIN" "$MAKE_DUMP_SCRIPT" "$MAKE_STACKTRACE_DUMP"
} }
(! systemd-detect-virt -cq) (! systemd-detect-virt -cq)
@ -249,70 +251,30 @@ systemd-run -t --property CoredumpFilter=default ls /tmp
(! coredumpctl debug --debugger=/bin/true --debugger-arguments='"') (! coredumpctl debug --debugger=/bin/true --debugger-arguments='"')
# Test for EnterNamespace= feature # Test for EnterNamespace= feature
# if pkgconf --atleast-version 0.192 libdw ; then
# dwfl_set_sysroot() is supported only in libdw-0.192 or newer. # dwfl_set_sysroot() is supported only in libdw-0.192 or newer.
# cat >"$MAKE_STACKTRACE_DUMP" <<END
# FIXME: drop the objdump call once https://github.com/systemd/systemd/pull/39268#issuecomment-3390745718 is #!/usr/bin/env bash
# addressed mount -t tmpfs tmpfs /tmp
if pkgconf --atleast-version 0.192 libdw && gcc -xc -O0 -g -o $CORE_STACKTRACE_TEST_BIN - <<EOF
objdump -h -j .gnu_debugdata -j .debug_info /usr/lib/systemd/tests/unit-tests/manual/test-coredump-stacktrace; then void baz(void) { int *x = 0; *x = 42; }
MAKE_STACKTRACE_DUMP="/tmp/make-stacktrace-dump" void bar(void) { baz(); }
void foo(void) { bar(); }
# Simple script that mounts tmpfs on /tmp/ and copies the crashing test binary there, which in int main(void) { foo(); return 0;}
# combination with `unshare --mount` ensures the "outside" systemd-coredump process won't be able to
# access the crashed binary (and hence won't be able to symbolize its stacktrace) unless
# EnterNamespace=yes is used
cat >"$MAKE_STACKTRACE_DUMP" <<\EOF
#!/usr/bin/bash -eux
TARGET="/tmp/${1:?}"
EC=0
# "Unhide" debuginfo in the namespace (see the comment below)
test -d /usr/lib/debug/ && umount /usr/lib/debug/
mount -t tmpfs tmpfs /tmp/
cp /usr/lib/systemd/tests/unit-tests/manual/test-coredump-stacktrace "$TARGET"
$TARGET || EC=$?
if [[ $EC -ne 139 ]]; then
echo >&2 "$TARGET didn't crash, this shouldn't happen"
exit 1
fi
exit 0
EOF EOF
$CORE_STACKTRACE_TEST_BIN
END
chmod +x "$MAKE_STACKTRACE_DUMP" chmod +x "$MAKE_STACKTRACE_DUMP"
# Since the test-coredump-stacktrace binary is built together with rest of the systemd its debug symbols
# might be part of debuginfo packages (if supported & built), and libdw will then use them to symbolize
# the stacktrace even if it doesn't have access to the original crashing binary. Let's make the test
# simpler and just "hide" the debuginfo data, so libdw is forced to access the target namespace to get
# the necessary symbols
test -d /usr/lib/debug/ && mount -t tmpfs tmpfs /usr/lib/debug/
mkdir -p /run/systemd/coredump.conf.d/ mkdir -p /run/systemd/coredump.conf.d/
printf '[Coredump]\nEnterNamespace=no' >/run/systemd/coredump.conf.d/99-enter-namespace.conf printf '[Coredump]\nEnterNamespace=no' >/run/systemd/coredump.conf.d/99-enter-namespace.conf
unshare --pid --fork --mount-proc --mount --uts --ipc --net "$MAKE_STACKTRACE_DUMP" "test-stacktrace-not-symbolized" unshare --pid --fork --mount-proc --mount --uts --ipc --net bash -c "$MAKE_STACKTRACE_DUMP" || :
timeout 30 bash -c "until coredumpctl list -q --no-legend /tmp/test-stacktrace-not-symbolized; do sleep .2; done" timeout 30 bash -c "until coredumpctl -1 info $CORE_STACKTRACE_TEST_BIN | grep -zvqE 'baz.*bar.*foo'; do sleep .2; done"
coredumpctl info /tmp/test-stacktrace-not-symbolized | tee /tmp/not-symbolized.log
(! grep -E "#[0-9]+ .* main " /tmp/not-symbolized.log)
(! grep -E "#[0-9]+ .* foo " /tmp/not-symbolized.log)
(! grep -E "#[0-9]+ .* bar " /tmp/not-symbolized.log)
(! grep -E "#[0-9]+ .* baz " /tmp/not-symbolized.log)
printf '[Coredump]\nEnterNamespace=yes' >/run/systemd/coredump.conf.d/99-enter-namespace.conf printf '[Coredump]\nEnterNamespace=yes' >/run/systemd/coredump.conf.d/99-enter-namespace.conf
unshare --pid --fork --mount-proc --mount --uts --ipc --net "$MAKE_STACKTRACE_DUMP" "test-stacktrace-symbolized" unshare --pid --fork --mount-proc --mount --uts --ipc --net bash -c "$MAKE_STACKTRACE_DUMP" || :
timeout 30 bash -c "until coredumpctl list -q --no-legend /tmp/test-stacktrace-symbolized; do sleep .2; done" timeout 30 bash -c "until coredumpctl -1 info $CORE_STACKTRACE_TEST_BIN | grep -zqE 'baz.*bar.*foo'; do sleep .2; done"
coredumpctl info /tmp/test-stacktrace-symbolized | tee /tmp/symbolized.log
grep -E "#[0-9]+ .* main " /tmp/symbolized.log
grep -E "#[0-9]+ .* foo " /tmp/symbolized.log
grep -E "#[0-9]+ .* bar " /tmp/symbolized.log
grep -E "#[0-9]+ .* baz " /tmp/symbolized.log
test -d /usr/lib/debug/ && umount /usr/lib/debug/
rm -f "$MAKE_STACKTRACE_DUMP" /run/systemd/coredump.conf.d/99-enter-namespace.conf /tmp/{not-,}symbolized.log
else else
echo "libdw doesn't not support setting sysroot, skipping EnterNamespace= test" echo "libdw doesn't not support setting sysroot, skipping EnterNamespace= test"
fi fi