summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
authorBrian Gianforcaro <b.gianfo@gmail.com>2020-08-09 15:35:06 -0700
committerAndreas Kling <kling@serenityos.org>2020-08-10 12:52:15 +0200
commitb5a2a215f62be9604c8da4cdf3aa9c2996569642 (patch)
tree25c8a5bbd580b92432f31883d034889317d5ecad /Kernel/Syscalls
parentc8ae244ab8c65500ad940cdf4e3cd50068308e9f (diff)
downloadserenity-b5a2a215f62be9604c8da4cdf3aa9c2996569642.zip
Kernel: Use Userspace<T> for the getrandom syscall
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/getrandom.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Kernel/Syscalls/getrandom.cpp b/Kernel/Syscalls/getrandom.cpp
index 0f9b82d6ae..53361d9263 100644
--- a/Kernel/Syscalls/getrandom.cpp
+++ b/Kernel/Syscalls/getrandom.cpp
@@ -32,7 +32,7 @@ namespace Kernel {
// We don't use the flag yet, but we could use it for distinguishing
// random source like Linux, unlike the OpenBSD equivalent. However, if we
// do, we should be able of the caveats that Linux has dealt with.
-ssize_t Process::sys$getrandom(void* buffer, size_t buffer_size, [[maybe_unused]] unsigned flags)
+ssize_t Process::sys$getrandom(Userspace<void*> buffer, size_t buffer_size, [[maybe_unused]] unsigned flags)
{
REQUIRE_PROMISE(stdio);
if (buffer_size <= 0)
@@ -42,7 +42,8 @@ ssize_t Process::sys$getrandom(void* buffer, size_t buffer_size, [[maybe_unused]
return -EFAULT;
SmapDisabler disabler;
- get_good_random_bytes((u8*)buffer, buffer_size);
+ // FIXME: We should really push Userspace<T> down through the interface.
+ get_good_random_bytes((u8*)buffer.ptr(), buffer_size);
return 0;
}