]> 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)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 22 May 2026 12:57:29 +0000 (13:57 +0100)
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.

(cherry picked from commit a8400c8f1a61223e4905e2939f8d71be82831c8c)

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

index 8fbd0d4f85e28ab3751017093f3756605a75e6fc..c451e05796d43e832285707c27ea3629c317eca4 100755 (executable)
@@ -53,6 +53,7 @@ wrap=(
     dbus-broker-launch
     dbus-daemon
     delv
+    dfuzzer
     dhcpd
     dig
     dnf
@@ -67,6 +68,7 @@ wrap=(
     groups
     id
     integritysetup
+    iscsiadm
     iscsid
     keymgr
     knotc
@@ -76,12 +78,15 @@ wrap=(
     login
     ls
     lsblk
+    lsns
     lsof
     lvm
     mdadm
     mkfs.btrfs
+    mkfs.ext4
     mksquashfs
     mount
+    mountpoint
     multipath
     multipathd
     nvme
@@ -95,8 +100,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}')