kAFL
kAFL copied to clipboard
Generate VM dumps for offline debugging with crash util
Save VM image on crash/kasan event to help with debugging (in particular w.r.t. TDX/SDV setup).
Background: https://linux.die.net/man/8/crash File format: https://listman.redhat.com/archives/crash-utility/2008-August/001591.html Qemu gdb/python plugin: https://github.com/qemu/qemu/blob/master/scripts/dump-guest-memory.py
Qemu also has a native VM dump feature that can be triggered via QMP API: https://wiki.ubuntu.com/DebuggingKernelWithQEMU#QMP
We can trigger this on kAFL crash event, but crash(8) fails to load the resulting image.
@schumilo confirmed that qmp dump-guest-memory + crash util are working fine for vanilla qemu/kafl setup before and after snapshot. In that case, looks like the bug is caused by TDX/SDV-specific modifications to Qemu, Linux guest, or host KVM?