Skip to content

Commit 5ce6160

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

File tree

1 file changed

+2
-1
lines changed
  • src/aero_kernel/src/userland

1 file changed

+2
-1
lines changed

src/aero_kernel/src/userland/vm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use xmas_elf::header::*;
2727
use xmas_elf::program::*;
2828
use xmas_elf::*;
2929

30+
use crate::arch::controlregs;
3031
use crate::arch::task::userland_last_address;
3132
use crate::fs;
3233
use crate::fs::cache::DirCacheItem;
@@ -385,7 +386,7 @@ impl Mapping {
385386
let new_slice = new_frame.as_slice_mut::<u8>();
386387

387388
// Copy the contents from the old frame to the newly allocated frame.
388-
new_slice.copy_from_slice(old_slice);
389+
controlregs::with_userspace_access(||new_slice.copy_from_slice(old_slice));
389390

390391
// Re-map the page to the newly allocated frame and with the provided
391392
// protection flags.

0 commit comments

Comments
 (0)