Guest required capabilities may cause failures at runtime after restore
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
Start at the OutBAction restore handling for TraceBatch and memory-profile actions, then inspect the existing ELF metadata and snapshot restore flow. Determine whether the immediate fix should safely ignore unavailable guest actions or whether capability metadata and host validation are required. Done means restoring a guest does not fail with invalid port values when host features are disabled.
由索引模型根据 Issue 内容生成。
描述
There are a couple of guest-features that produce specific port values, e.g.:
#[cfg(feature = "trace_guest")]
TraceBatch = 104,
#[cfg(feature = "mem_profile")]
TraceMemoryAlloc = 105,
Right now if these are enabled and then restored in a host where those features are not enabled it will result in an error something like Invalid OutBAction value: 104
A simple fix for this would be something like:
OutBAction::TraceBatch => {
#[cfg(feature = "trace_guest")]
handle_trace_batch(...);
Ok(())
}
OutBAction::TraceMemoryAlloc | OutBAction::TraceMemoryFree => {
#[cfg(feature = "mem_profile")]
handle_memory_profile_action(...)?;
Ok(())
}
This would not work for any potential future feature where the guest depended on the host to do work, in such a case we would need to detect features in the guest and host and ensure that there was alignment when restoring, since rust does not enable runtime reflection of what features are enabled we would have to do something along these lines:
- Define a host function that lists capabilities
fn host_capabilities() -> CapabilitySet {
let mut capabilities = CapabilitySet::core();
if cfg!(feature = "trace_guest") {
capabilities.insert(TRACE_BATCH_V1);
}
if cfg!(feature = "mem_profile") {
capabilities.insert(MEM_PROFILE_V1);
}
capabilities
}
- Extend the existing elf metadata to add
.note.hyperlight-capabilitiesand add features with ABI versions, e.g.:
hyperlight.outb.trace-batch.v1
hyperlight.outb.memory-profile.v1
- Then
- At snapshot time query the guest binary elf headers and record the values as OCI snapshot configuration.
- At restore validate that no required features are missing
If we implement this we might want to also validate when we initially load a guest binary. We might want to make this mechanism extensible by consumers of hyperlight.
- 主要语言
- Rust
- 星标
- 4.8k
- 派生
- 222
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 60
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hyperlight-dev/hyperlight 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
hyperlight-dev/hyperlight#2089 ·
维护者通常 1 天内回复
-
S-needs-triage
难度 2/5 1-3 小时 新手友好度 64/100
hyperlight-dev/hyperlight#2073 ·
维护者通常 1 天内回复
-
C-bug S-needs-triage
难度 2/5 1-3 小时 新手友好度 82/100
hyperlight-dev/hyperlight#2056 ·
维护者通常 1 天内回复
-
A-docs C-bug S-needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
hyperlight-dev/hyperlight#2027 ·
维护者通常 1 天内回复
-
S-needs-triage
难度 2/5 1-3 小时 新手友好度 65/100
hyperlight-dev/hyperlight#1970 ·
维护者通常 1 天内回复
查看 hyperlight-dev/hyperlight 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
-
tests
难度 2/5 1-3 小时 新手友好度 70/100
vfarcic/dot-agent-deck#2512 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
pop-os/cosmic-applets#1641 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
pop-os/cosmic-store#650 ·