[Zion] Make sure result of ValidateCapability is used.

This commit is contained in:
Drew Galbraith 2024-08-17 17:14:30 -07:00
parent c6dbc395aa
commit 19a8ab41d4
3 changed files with 10 additions and 6 deletions

View file

@ -331,7 +331,7 @@ pub fn spawn_process_from_elf(elf_file: &[u8]) -> Result<z_cap_t, ZError> {
port.write_u64_and_cap(crate::init::Z_INIT_SELF_VMAS, new_as_cap)?;
port.write_u64_and_cap(
crate::init::Z_INIT_ENDPOINT,
syscall::cap_duplicate(unsafe { crate::init::INIT_ENDPOINT }, u64::MAX)?,
self_cap.duplicate(Capability::PERMS_ALL)?,
)?;
let thread_cap = syscall::thread_create(new_proc_cap)?;