Skip to content

Seccomp violation when Firecracker gets SIGSEGV/SIGBUS #1064

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

Closed
alxiord opened this issue Apr 19, 2019 · 1 comment
Closed

Seccomp violation when Firecracker gets SIGSEGV/SIGBUS #1064

alxiord opened this issue Apr 19, 2019 · 1 comment
Assignees
Labels
Priority: High Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Type: Bug Indicates an unexpected problem or unintended behavior

Comments

@alxiord
Copy link

alxiord commented Apr 19, 2019

If for any reason other than stack overflow Firecracker gets a SIGSEGV or SIGBUS, the signal handler installed by Rust ends up calling sigaction to deregister itself. sigaction is not whitelisted, therefore Firecracker will exit with a seccomp violation.

What's with the sigaction?
Rust installs this signal handler to gracefully detect and handle stack overflows. A guard page tells whether the signal originated in a SO or not. If so, Rust promptly aborts to protect the program against it; if not, the signal handler deregisters itself (with sigaction) by overwriting itself with SIG_DFL. Next time the signal hits, the program will be terminated.

The way Firecracker deals with this is misleading overall; if it gets a non-stack overflow SIGSEGV/SIGBUS, we see a seccomp violation.

kill -BUS `pidof firecracker`
2019-04-19T09:46:13.958232287 [anonymous-instance:ERROR:vmm/src/sigsys_handler.rs:69] Shutting down VM after intercepting a bad syscall (13).
2019-04-19T09:46:13.958542547 [anonymous-instance:ERROR:vmm/src/sigsys_handler.rs:75] Failed to log metrics while stopping: Logger was not initialized.
@alxiord alxiord added Priority: High Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Type: Bug Indicates an unexpected problem or unintended behavior labels Apr 19, 2019
@alxiord
Copy link
Author

alxiord commented May 13, 2019

Fixed by #1070

@alxiord alxiord closed this as completed May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant