hyperlight-dev / hyperlight-dev/hyperlight

Make it possible to kill guest execution when running a host function.

オープン
#192 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
lifecycle/confirmed
主要言語
Rust
スター
4.7k
フォーク
208
平均マージ
1日 7時間
マージ済み PR(30日)
47

説明

Currently, it is not possible to interrupt or cancel execution if the guest is calling a host function. This means that, if the host function hangs, then the call will never return or get cancelled. This gets surfaced, like so:

https://github.com/hyperlight-dev/hyperlight/blob/b9c67fb7450cfebbd47918b979a97cfa447c43be/src/hyperlight_host/src/func/guest_dispatch.rs#L476

**One possible solution**

When running with the seccomp feature on, host functions are wrapped in their own thread like so:

https://github.com/hyperlight-dev/hyperlight/blob/b9c67fb7450cfebbd47918b979a97cfa447c43be/src/hyperlight_host/src/sandbox/host_funcs.rs#L208-L228

You could leverage these threads to cancel execution in the same way we cancel execution in the guest:

https://github.com/hyperlight-dev/hyperlight/blob/b9c67fb7450cfebbd47918b979a97cfa447c43be/src/hyperlight_host/src/hypervisor/hypervisor_handler.rs#L729-L762

Though, this would mean always wrapping host function calls with an extra thread and that might be naive in terms of perf.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。