Skip to content

Commit 073b032

Browse files
committed
userland: Wrap some userspace access for SMAP
Signed-off-by: Dennis Bonke <[email protected]>
1 parent 1252874 commit 073b032

File tree

1 file changed

+4
-3
lines changed
  • src/aero_kernel/src/userland

1 file changed

+4
-3
lines changed

src/aero_kernel/src/userland/task.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use crate::fs::{self, FileSystem};
3030
use crate::mem::paging::*;
3131

3232
use crate::arch::task::ArchTask;
33+
use crate::arch::controlregs;
3334
use crate::fs::file_table::FileTable;
3435
use crate::syscall::{ExecArgs, MessageQueue};
3536
use crate::utils::sync::{BlockQueue, Mutex};
@@ -154,9 +155,9 @@ impl Zombies {
154155

155156
// WIFEXITED: The child process has been terminated normally by
156157
// either calling sys_exit() or returning from the main function.
157-
*status = 0x200;
158+
controlregs::with_userspace_access(||*status = 0x200);
158159
// The lower 8-bits are used to store the exit status.
159-
*status |= st as u32 & 0xff;
160+
controlregs::with_userspace_access(||*status |= st as u32 & 0xff);
160161

161162
Ok(tid.as_usize())
162163
}
@@ -399,7 +400,7 @@ impl Task {
399400
// Clear the signals that are pending for this task on exec.
400401
self.signals().clear();
401402

402-
self.arch_task_mut().exec(vm, executable, argv, envv)
403+
controlregs::with_userspace_access(||self.arch_task_mut().exec(vm, executable, argv, envv))
403404
}
404405

405406
pub fn vm(&self) -> &Arc<Vm> {

0 commit comments

Comments
 (0)