hyperlight-dev / hyperlight-dev/hyperlight

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

未关闭
#192 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
lifecycle/confirmed
主要语言
Rust
星标
4.7k
派生
208
平均合并
1 天 7 小时
30 天内合并 PR
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 摘要。