Skip to content

Testing with ASAN and UBSAN

Stefan Berger edited this page Nov 23, 2020 · 6 revisions

Fedora

ASAN

libtpms configure line: CFLAGS="-fsanitize=address -g -fno-omit-frame-pointer -fno-sanitize-recover" LIBS="-lasan" ./autogen.sh --prefix=/usr --with-tpm2 --with-openssl

swtpm configure line: CFLAGS="-fsanitize=address -g -fno-omit-frame-pointer -fno-sanitize-recover" LIBS="-lasan" ./autogen.sh --prefix=/usr --without-seccomp

UBSAN

libtpms configure line: CFLAGS="-fsanitize=undefined -g -fno-omit-frame-pointer -fno-sanitize-recover" LIBS="-lubsan" ./autogen.sh --prefix=/usr --with-tpm2 --with-openssl

swtpm configure line: CFLAGS="-fsanitize=undefined -g -fno-omit-frame-pointer -fno-sanitize-recover" LIBS="-lubsan" ./autogen.sh --prefix=/usr

breakpoint for gdb: rbreak ^__ubsan_handle