tpm2-software/tpm2-tss

GitHub actions on ubuntu:latest get stuck in a AddressSanitizer:DEADLYSIGNAL loop

wxleong opened this issue · 0 comments

Reproduce:

docker run -it --env LANG=C.UTF-8 ghcr.io/tpm2-software/ubuntu-22.04

git clone https://github.com/tpm2-software/tpm2-tss ~/tpm2-tss
cd ~/tpm2-tss
./bootstrap
./configure --with-sanitizer=undefined,address --with-maxloglevel=none --enable-debug=yes --enable-unit --enable-self-generated-certificate --enable-integration --with-crypto=ossl
make -j check
Ctrl+z
less test/integration/fapi-second-provisioning.log

    Trying to start simulator swtpm
    Starting simulator on port 56994
    successfully started daemon: swtpm with PID: 631966
    /root/tpm2-tss
    simulator PID: 631966
    LISTEN 0      1          127.0.0.1:56994      0.0.0.0:*    users:(("swtpm",pid=631966,fd=3))
    LISTEN 0      1          127.0.0.1:56995      0.0.0.0:*    users:(("swtpm",pid=631966,fd=2))
    Simulator with PID 631966 bound to port 56994 and  56995 successfully.
    TPM20TEST_TCTI=swtpm:host=127.0.0.1,port=56994
    Execute the test script
    AddressSanitizer:DEADLYSIGNAL
    AddressSanitizer:DEADLYSIGNAL
    AddressSanitizer:DEADLYSIGNAL
    AddressSanitizer:DEADLYSIGNAL

This issue has been reported across multiple repositories: mod-cpp/ms-pacman#30. As suggested, a temporary workaround can be implemented until the image is updated with the latest fix. The issue was resolved in newer versions of LLVM.

    - name: Fix kernel mmap rnd bits
      # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
      # high-entropy ASLR in much newer kernels that GitHub runners are
      # using leading to random crashes: https://reviews.llvm.org/D148280
      run: sudo sysctl vm.mmap_rnd_bits=28