mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 15:32:22 +00:00
Kernel: Use copy_n_from_user in sys$setgroups to check for overflow
This commit is contained in:
parent
4743afeaf4
commit
d934e77522
Notes:
sideshowbarker
2024-07-18 22:02:53 +09:00
Author: https://github.com/bgianfo
Commit: d934e77522
Pull-request: https://github.com/SerenityOS/serenity/pull/5454
1 changed files with 1 additions and 1 deletions
|
@ -150,7 +150,7 @@ int Process::sys$setgroups(ssize_t count, Userspace<const gid_t*> user_gids)
|
||||||
|
|
||||||
Vector<gid_t> gids;
|
Vector<gid_t> gids;
|
||||||
gids.resize(count);
|
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;
|
return -EFAULT;
|
||||||
|
|
||||||
HashTable<gid_t> unique_extra_gids;
|
HashTable<gid_t> unique_extra_gids;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue