Kernel: Use copy_typed_from_user<T> for fetching syscall parameters

This commit is contained in:
Andreas Kling 2021-09-05 17:51:37 +02:00
commit 789db813d3
Notes: sideshowbarker 2024-07-18 04:41:47 +09:00
24 changed files with 42 additions and 81 deletions

View file

@ -14,8 +14,8 @@ KResultOr<FlatPtr> Process::sys$rename(Userspace<const Syscall::SC_rename_params
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(cpath);
Syscall::SC_rename_params params;
TRY(copy_from_user(&params, user_params));
auto params = TRY(copy_typed_from_user(user_params));
auto old_path = get_syscall_path_argument(params.old_path);
if (old_path.is_error())
return old_path.error();