feat(kernel): implement generation-based capability revocation with proofs and tests

This commit is contained in:
2026-10-18 01:11:24 +02:00
parent 71518a93a4
commit 192631d506
7 changed files with 225 additions and 3 deletions

View File

@@ -58,6 +58,10 @@ impl MemoryRegion {
pub fn generation(&self) -> &Generation {
&self.generation
}
pub fn revoke(&mut self) {
self.generation = self.generation.next();
}
}
pub struct RegionTable {
@@ -82,6 +86,10 @@ impl RegionTable {
self.regions.get(id.raw() as usize).and_then(|s| s.as_ref())
}
pub fn get_mut(&mut self, id: RegionId) -> Option<&mut MemoryRegion> {
self.regions.get_mut(id.raw() as usize).and_then(|s| s.as_mut())
}
pub fn remove(&mut self, id: RegionId) -> Option<MemoryRegion> {
self.regions.get_mut(id.raw() as usize).and_then(|s| s.take())
}