feat(apps): permission manager equips apps (manifest+consent+decisions in /system), launches via init w/ file grant; shell unprivileged (/home); install/apps/allow/revoke; revoke stops running app; app-image tool; counter app

This commit is contained in:
2026-10-27 22:56:44 +01:00
parent 9bc31a9bbe
commit 90e11eb2e8
51 changed files with 1766 additions and 644 deletions

View File

@@ -49,6 +49,8 @@ impl DirEntry {
pub struct Storage {
ep: CapSlot,
buf: &'static mut [u8],
/// What maps `buf`; dropping it unmaps it.
region: CapSlot,
}
impl Storage {
@@ -66,7 +68,12 @@ impl Storage {
};
let mapped = crate::window::map_buffer(region, va).map_err(|_| FsError::Failed)?;
let buf = mapped.get_mut(..size).ok_or(FsError::Failed)?;
Ok(Self { ep, buf })
Ok(Self { ep, buf, region })
}
/// Unmaps the buffer, freeing its address for another connection.
pub fn detach(self) {
syscall::drop_cap(self.region);
}
fn call(&self, words: [usize; 4]) -> Result<[usize; 4]> {