You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: address PR 1270 review feedback for GuestCounter
Address review comments from syntactically and jsturtevant:
- Doc: replace "backed by" with "exposed to the guest via" (syntactically)
- Doc: remove "confused-deputy" framing; clarify that the host never
reads back from guest memory so a malicious guest cannot influence
the host's view (syntactically)
- Doc: add Implementation Note explaining why raw write_volatile is
used instead of SharedMemory methods — GuestCounter is created on
UninitializedSandbox (ExclusiveSharedMemory) but must survive across
evolve() into MultiUseSandbox (HostSharedMemory); the pointer stays
valid because evolve() internally clones the Arc<HostMapping>
(syntactically)
- Doc: document single-instance requirement — multiple GuestCounter
instances would cause cached values to diverge (jsturtevant)
- Safety: move "must not outlive sandbox" and single-instance
requirements into a structured # Safety doc on the constructor
(jsturtevant)
- Bounds check: remove sizeof(u64) addend since the offset constant
(0x1008) already statically accounts for it (syntactically)
- Remove unused SandboxMemoryLayout import
Signed-off-by: danbugs <danilochiarlone@gmail.com>
0 commit comments