Skip to content

QEMU shutdown on panic #130

Open
Open
@sruffell

Description

@sruffell

Mythril's panic_handler will currently spin in halt:

loop {
unsafe {
// Try to at least keep CPU from running at 100%
asm!("hlt", options(nostack, nomem));
}
}

I think it would be worthwhile to allow mythril to use the isa-debug-exit device to cause QEMU to exit with an error code if mythril panics. However @dlrobertson mentioned that he would like to see this configurable.

The following commit will allow qemu to exit on panic, but my question is about how to make it configurable:

sruffell@912f08c

Currently, this can be turned on and off by adding/removing -device isa-debug-exit on the QEMU command-line but was there another idea about how to configure this? Should the mythril.cfg file have an option that would control whether the panic handler even tries to do the port IO to the isa-debug-exit device?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions