Kernel: Fail gracefully due to OOM on HashTable set in sys$setgroups

This commit is contained in:
Idan Horowitz 2022-01-25 15:16:39 +02:00
parent a9cd8ca841
commit e23d320bb9
Notes: sideshowbarker 2024-07-17 20:12:17 +09:00

View file

@ -187,7 +187,7 @@ ErrorOr<FlatPtr> Process::sys$setgroups(size_t count, Userspace<const gid_t*> us
HashTable<gid_t> unique_extra_gids;
for (auto& extra_gid : new_extra_gids) {
if (extra_gid != gid())
unique_extra_gids.set(extra_gid);
TRY(unique_extra_gids.try_set(extra_gid));
}
ProtectedDataMutationScope scope { *this };