Skip to content

Commit ca372f3

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

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
@@ -138,7 +138,7 @@ pub fn close(fd: usize) -> Result<usize, AeroSyscallError> {
138138
}
139139

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

144144
if !inode.inode().metadata()?.is_directory() {

0 commit comments

Comments
 (0)