]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: wrap even more binaries when running with sanitizers
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 23 Apr 2026 11:44:59 +0000 (13:44 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 25 Apr 2026 15:42:20 +0000 (17:42 +0200)
Turns out that the util-linux dep on libsystemd caused more fun than I
originally anticipated:

$ lddtree /usr/bin/dfuzzer
dfuzzer => /usr/bin/dfuzzer (interpreter => /lib64/ld-linux-x86-64.so.2)
    libgio-2.0.so.0 => /lib64/libgio-2.0.so.0
        libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0
        libz.so.1 => /lib64/libz.so.1
        libmount.so.1 => /lib64/libmount.so.1
            libblkid.so.1 => /lib64/libblkid.so.1
            libsystemd.so.0 => /lib64/libsystemd.so.0
                libm.so.6 => /lib64/libm.so.6
                    ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
        libselinux.so.1 => /lib64/libselinux.so.1
            libpcre2-8.so.0 => /lib64/libpcre2-8.so.0
...

Also, the tpm2 utils now depend on libudev through libcurl -> libssh ->
libfido2 dep chain:

$ lddtree /usr/bin/tpm2_pcrread
tpm2_pcrread => /usr/bin/tpm2_pcrread (interpreter => /lib64/ld-linux-x86-64.so.2)
    ...
    libcurl.so.4 => /lib64/libcurl.so.4
    ...
        libssh.so.4 => /lib64/libssh.so.4
            libfido2.so.1 => /lib64/libfido2.so.1
                libcbor.so.0.13 => /lib64/libcbor.so.0.13
                libudev.so.1 => /lib64/libudev.so.1
                    libgcc_s.so.1 => /lib64/libgcc_s.so.1
...

Follow-up for 8030e0b19ef7c0e823d84dd08ad38a2d88e0a230.

mkosi/mkosi.sanitizers/mkosi.postinst
test/units/TEST-07-PID1.user-namespace-path.sh

index 88ba2c2bc098e9e04b80f1a39ea0a98174c973bf..988a604c63eb055cd92bf53f5f3a5bc61f7b0e67 100755 (executable)
@@ -56,6 +56,7 @@ wrap=(
     dbus-broker-launch
     dbus-daemon
     delv
+    dfuzzer
     dhcpd
     dig
     dnf
@@ -70,6 +71,7 @@ wrap=(
     groups
     id
     integritysetup
+    iscsiadm
     iscsid
     keymgr
     knotc
@@ -79,12 +81,15 @@ wrap=(
     login
     ls
     lsblk
+    lsns
     lsof
     lvm
     mdadm
     mkfs.btrfs
+    mkfs.ext4
     mksquashfs
     mount
+    mountpoint
     multipath
     multipathd
     nvme
@@ -98,8 +103,12 @@ wrap=(
     stat
     stress-ng
     su
+    swapoff
+    swapon
     tar
     tgtd
+    # The tpm2 tools (tpm2_readpublic, tpm2_pcrextend, ...) all are symlinks to tpm2
+    tpm2
     umount
     unix_chkpwd
     useradd
index 437968e8c25315178fbf36f54ab3b52b6ba958ec..fda83a9566f80cb77cc440c59eac5ca6db03867d 100755 (executable)
@@ -6,15 +6,6 @@ set -o pipefail
 # shellcheck source=test/units/util.sh
 . "$(dirname "$0")"/util.sh
 
-# When sanitizers are used, export LD_PRELOAD with the sanitizers path,
-# lsns doesn't work otherwise.
-if [ -f /usr/lib/systemd/systemd-asan-env ]; then
-    # shellcheck source=/dev/null
-    . /usr/lib/systemd/systemd-asan-env
-    export LD_PRELOAD
-    export ASAN_OPTIONS
-fi
-
 # Only reuse the user namespace
 systemd-run --unit=oldservice --property=Type=exec --property=PrivateUsers=true sleep 3600
 OLD_PID=$(systemctl show oldservice -p MainPID | awk -F= '{print $2}')