diff options
author | Andreas Kling <kling@serenityos.org> | 2021-03-10 20:07:08 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-10 22:30:02 +0100 |
commit | d677a73b0e7f39013017f1395b698e7e6ca0f6a2 (patch) | |
tree | d1d9ab593573003e7b5d938a592dc4911fa6db50 /Kernel/Syscalls/setuid.cpp | |
parent | cbcf891040e9921ff628fdda668c9738f358a178 (diff) | |
download | serenity-d677a73b0e7f39013017f1395b698e7e6ca0f6a2.zip |
Kernel: Move process extra_gids into protected data :^)
Diffstat (limited to 'Kernel/Syscalls/setuid.cpp')
-rw-r--r-- | Kernel/Syscalls/setuid.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Kernel/Syscalls/setuid.cpp b/Kernel/Syscalls/setuid.cpp index 66d333f236..023be08e57 100644 --- a/Kernel/Syscalls/setuid.cpp +++ b/Kernel/Syscalls/setuid.cpp @@ -148,7 +148,7 @@ KResultOr<int> Process::sys$setgroups(ssize_t count, Userspace<const gid_t*> use return EPERM; if (!count) { - m_extra_gids.clear(); + MutableProtectedData(*this)->extra_gids.clear(); return 0; } @@ -163,12 +163,13 @@ KResultOr<int> Process::sys$setgroups(ssize_t count, Userspace<const gid_t*> use unique_extra_gids.set(extra_gid); } - m_extra_gids.resize(unique_extra_gids.size()); + MutableProtectedData protected_data { *this }; + protected_data->extra_gids.resize(unique_extra_gids.size()); size_t i = 0; for (auto& extra_gid : unique_extra_gids) { if (extra_gid == gid()) continue; - m_extra_gids[i++] = extra_gid; + protected_data->extra_gids[i++] = extra_gid; } return 0; } |