Guest required capabilities may cause failures at runtime after restore
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- operating-systems
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Rust
- Sterne
- 4.8k
- Forks
- 222
- Ø Merge
- 1 T. 16 Std.
- Gemergte PRs (30 T.)
- 60
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus hyperlight-dev/hyperlight
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
hyperlight-dev/hyperlight#2089 ·
Maintainer antworten meist innerhalb von 1 Tag
-
S-needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
hyperlight-dev/hyperlight#2073 ·
Maintainer antworten meist innerhalb von 1 Tag
-
C-bug S-needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
hyperlight-dev/hyperlight#2056 ·
Maintainer antworten meist innerhalb von 1 Tag
-
A-docs C-bug S-needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
hyperlight-dev/hyperlight#2027 ·
Maintainer antworten meist innerhalb von 1 Tag
-
S-needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
hyperlight-dev/hyperlight#1970 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in hyperlight-dev/hyperlight
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
-
tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
vfarcic/dot-agent-deck#2512 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
pop-os/cosmic-applets#1641 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
pop-os/cosmic-store#650 ·