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/process.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/process.cpp')
-rw-r--r-- | Kernel/Syscalls/process.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/Syscalls/process.cpp b/Kernel/Syscalls/process.cpp index 708526892a..c4d15ce4d1 100644 --- a/Kernel/Syscalls/process.cpp +++ b/Kernel/Syscalls/process.cpp @@ -11,18 +11,21 @@ namespace Kernel { KResultOr<FlatPtr> Process::sys$getpid() { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); return pid().value(); } KResultOr<FlatPtr> Process::sys$getppid() { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); return m_ppid.value(); } KResultOr<FlatPtr> Process::sys$get_process_name(Userspace<char*> buffer, size_t buffer_size) { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); if (m_name.length() + 1 > buffer_size) return ENAMETOOLONG; @@ -34,6 +37,7 @@ KResultOr<FlatPtr> Process::sys$get_process_name(Userspace<char*> buffer, size_t KResultOr<FlatPtr> Process::sys$set_process_name(Userspace<const char*> user_name, size_t user_name_length) { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(proc); if (user_name_length > 256) return ENAMETOOLONG; @@ -49,6 +53,7 @@ KResultOr<FlatPtr> Process::sys$set_process_name(Userspace<const char*> user_nam KResultOr<FlatPtr> Process::sys$set_coredump_metadata(Userspace<const Syscall::SC_set_coredump_metadata_params*> user_params) { + VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) Syscall::SC_set_coredump_metadata_params params; if (!copy_from_user(¶ms, user_params)) return EFAULT; |