From 152a83fac59f8ac2f85ed79aa9020374bede7953 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Jan 2020 21:55:20 +0100 Subject: [PATCH] Kernel: Remove SmapDisabler in watch_file() --- Kernel/Process.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index dd0f9dbcd1..b89b8c6a07 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -3435,17 +3435,17 @@ int Process::sys$ftruncate(int fd, off_t length) return description->truncate(length); } -int Process::sys$watch_file(const char* path, int path_length) +int Process::sys$watch_file(const char* user_path, int path_length) { if (path_length < 0) return -EINVAL; - if (!validate_read(path, path_length)) + if (!validate_read(user_path, path_length)) return -EFAULT; - SmapDisabler disabler; + auto path = copy_string_from_user(user_path, path_length); - auto custody_or_error = VFS::the().resolve_path({ path, (size_t)path_length }, current_directory()); + auto custody_or_error = VFS::the().resolve_path(path, current_directory()); if (custody_or_error.is_error()) return custody_or_error.error();