summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/setuid.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <b.gianfo@gmail.com>2021-02-21 08:05:09 -0800
committerAndreas Kling <kling@serenityos.org>2021-02-21 17:12:01 +0100
commitd934e775227257350a9e42e3dd3f4e19b6bbd68e (patch)
tree67db482550fbb70b1d752371c3a385dcdd1f91bb /Kernel/Syscalls/setuid.cpp
parent4743afeaf466b7ae718a96ca71be46305c51a793 (diff)
downloadserenity-d934e775227257350a9e42e3dd3f4e19b6bbd68e.zip
Kernel: Use copy_n_from_user in sys$setgroups to check for overflow
Diffstat (limited to 'Kernel/Syscalls/setuid.cpp')
-rw-r--r--Kernel/Syscalls/setuid.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/setuid.cpp b/Kernel/Syscalls/setuid.cpp
index ee01f4e325..9e63ceb6bd 100644
--- a/Kernel/Syscalls/setuid.cpp
+++ b/Kernel/Syscalls/setuid.cpp
@@ -150,7 +150,7 @@ int Process::sys$setgroups(ssize_t count, Userspace<const gid_t*> user_gids)
Vector<gid_t> gids;
gids.resize(count);
- if (!copy_from_user(gids.data(), user_gids.unsafe_userspace_ptr(), sizeof(gid_t) * count))
+ if (!copy_n_from_user(gids.data(), user_gids, count))
return -EFAULT;
HashTable<gid_t> unique_extra_gids;