Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEMU shutdown on panic #130

Open
sruffell opened this issue May 3, 2021 · 1 comment
Open

QEMU shutdown on panic #130

sruffell opened this issue May 3, 2021 · 1 comment

Comments

@sruffell
Copy link
Contributor

sruffell commented May 3, 2021

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?

@dlrobertson
Copy link
Contributor

I do think that long term having some option for configuring how a VM panics would be a good idea. I'm not sure now how we'd get the VM info and config in the panic handler, so perhaps now a feature would work so that we conditionally compile one of the available panic handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants