diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-07-18 11:20:12 -0700 |
---|---|---|
committer | Gunnar Beutner <gunnar@beutner.name> | 2021-07-20 03:21:14 +0200 |
commit | 9201a0602706a463d65ecf4b3623235f1f82cd03 (patch) | |
tree | f943b67898d4271d7dc1e33784262f95e018c59c /Kernel/Syscalls/getuid.cpp | |
parent | 120b9bc05bb7c2569719f2d0b2d6d434f32840ff (diff) | |
download | serenity-9201a0602706a463d65ecf4b3623235f1f82cd03.zip |
Kernel: Annotate all syscalls with VERIFY_PROCESS_BIG_LOCK_ACQUIRED
Before we start disabling acquisition of the big process lock for
specific syscalls, make sure to document and assert that all the
lock is held during all syscalls.
Diffstat (limited to 'Kernel/Syscalls/getuid.cpp')
-rw-r--r-- | Kernel/Syscalls/getuid.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Kernel/Syscalls/getuid.cpp b/Kernel/Syscalls/getuid.cpp index 357607d702..b94711e3dd 100644 --- a/Kernel/Syscalls/getuid.cpp +++ b/Kernel/Syscalls/getuid.cpp @@ -10,30 +10,35 @@ namespace Kernel { KResultOr<FlatPtr> Process::sys$getuid() { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); return uid(); } KResultOr<FlatPtr> Process::sys$getgid() { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); return gid(); } KResultOr<FlatPtr> Process::sys$geteuid() { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); return euid(); } KResultOr<FlatPtr> Process::sys$getegid() { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); return egid(); } KResultOr<FlatPtr> Process::sys$getresuid(Userspace<uid_t*> ruid, Userspace<uid_t*> euid, Userspace<uid_t*> suid) { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); if (!copy_to_user(ruid, &m_uid) || !copy_to_user(euid, &m_euid) || !copy_to_user(suid, &m_suid)) return EFAULT; @@ -42,6 +47,7 @@ KResultOr<FlatPtr> Process::sys$getresuid(Userspace<uid_t*> ruid, Userspace<uid_ KResultOr<FlatPtr> Process::sys$getresgid(Userspace<gid_t*> rgid, Userspace<gid_t*> egid, Userspace<gid_t*> sgid) { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); if (!copy_to_user(rgid, &m_gid) || !copy_to_user(egid, &m_egid) || !copy_to_user(sgid, &m_sgid)) return EFAULT; @@ -50,6 +56,7 @@ KResultOr<FlatPtr> Process::sys$getresgid(Userspace<gid_t*> rgid, Userspace<gid_ KResultOr<FlatPtr> Process::sys$getgroups(size_t count, Userspace<gid_t*> user_gids) { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); if (!count) return extra_gids().size(); |