Skip to content

Commit b4ac14d

Browse files
committed
chdir: Fix SMAP violation
Signed-off-by: Dennis Bonke <[email protected]>
1 parent 894476f commit b4ac14d

File tree

1 file changed

+1
-1
lines changed
  • src/aero_kernel/src/syscall

1 file changed

+1
-1
lines changed

src/aero_kernel/src/syscall/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub fn close(fd: usize) -> Result<usize, AeroSyscallError> {
139139

140140
pub fn chdir(path: usize, size: usize) -> Result<usize, AeroSyscallError> {
141141
let buffer = validate_str(path as *mut u8, size).ok_or(AeroSyscallError::EINVAL)?;
142-
let inode = fs::lookup_path(Path::new(buffer))?;
142+
let inode = controlregs::with_userspace_access(||fs::lookup_path(Path::new(buffer)))?;
143143

144144
if !inode.inode().metadata()?.is_directory() {
145145
// A component of path is not a directory.

0 commit comments

Comments
 (0)