Guest required capabilities may cause failures at runtime after restore
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- operating-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 4.8k
- Fork
- 222
- Merge medio
- 1g 16h
- PR unite (30g)
- 60
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hyperlight-dev/hyperlight
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
hyperlight-dev/hyperlight#2089 ·
I maintainer di solito rispondono entro 1 giorno
-
S-needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
hyperlight-dev/hyperlight#2073 ·
I maintainer di solito rispondono entro 1 giorno
-
C-bug S-needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
hyperlight-dev/hyperlight#2056 ·
I maintainer di solito rispondono entro 1 giorno
-
A-docs C-bug S-needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hyperlight-dev/hyperlight#2027 ·
I maintainer di solito rispondono entro 1 giorno
-
S-needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
hyperlight-dev/hyperlight#1970 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hyperlight-dev/hyperlight
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
-
tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vfarcic/dot-agent-deck#2512 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
pop-os/cosmic-applets#1641 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pop-os/cosmic-store#650 ·