Guest required capabilities may cause failures at runtime after restore
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- rust
- Domínio
- operating-systems
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Rust
- Estrelas
- 4.8k
- Forks
- 222
- Merge médio
- 1d 16h
- PRs com merge (30d)
- 60
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de hyperlight-dev/hyperlight
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
hyperlight-dev/hyperlight#2089 ·
Mantenedores costumam responder em até 1 dia
-
S-needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
hyperlight-dev/hyperlight#2073 ·
Mantenedores costumam responder em até 1 dia
-
C-bug S-needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
hyperlight-dev/hyperlight#2056 ·
Mantenedores costumam responder em até 1 dia
-
A-docs C-bug S-needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
hyperlight-dev/hyperlight#2027 ·
Mantenedores costumam responder em até 1 dia
-
S-needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
hyperlight-dev/hyperlight#1970 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de hyperlight-dev/hyperlight
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 86/100
-
tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
vfarcic/dot-agent-deck#2512 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
pop-os/cosmic-applets#1641 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
pop-os/cosmic-store#650 ·