mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
Kernel: Use try_copy_kstring_from_user() in sys$mount()
This commit is contained in:
parent
33adc3a42d
commit
3377cc74df
1 changed files with 9 additions and 6 deletions
|
@ -30,12 +30,15 @@ KResultOr<FlatPtr> Process::sys$mount(Userspace<const Syscall::SC_mount_params*>
|
||||||
return EFAULT;
|
return EFAULT;
|
||||||
|
|
||||||
auto source_fd = params.source_fd;
|
auto source_fd = params.source_fd;
|
||||||
auto target = copy_string_from_user(params.target);
|
auto target_or_error = try_copy_kstring_from_user(params.target);
|
||||||
if (target.is_null())
|
if (target_or_error.is_error())
|
||||||
return EFAULT;
|
return target_or_error.error();
|
||||||
auto fs_type = copy_string_from_user(params.fs_type);
|
auto fs_type_or_error = try_copy_kstring_from_user(params.fs_type);
|
||||||
if (fs_type.is_null())
|
if (fs_type_or_error.is_error())
|
||||||
return EFAULT;
|
return fs_type_or_error.error();
|
||||||
|
|
||||||
|
auto target = target_or_error.value()->view();
|
||||||
|
auto fs_type = fs_type_or_error.value()->view();
|
||||||
|
|
||||||
auto description = fds().file_description(source_fd);
|
auto description = fds().file_description(source_fd);
|
||||||
if (!description.is_null())
|
if (!description.is_null())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue