diff options
author | Lioncash <mathew1800@gmail.com> | 2019-04-04 02:23:14 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-04-04 02:25:41 +0200 |
commit | c39c8e69824af03799b0903f218eac81eba80751 (patch) | |
tree | d9402176960660adfd5f206146b05541a22b7c5a /src/core/hle/kernel/svc.cpp | |
parent | Merge pull request #2302 from ReinUsesLisp/vk-swapchain (diff) | |
download | yuzu-c39c8e69824af03799b0903f218eac81eba80751.tar yuzu-c39c8e69824af03799b0903f218eac81eba80751.tar.gz yuzu-c39c8e69824af03799b0903f218eac81eba80751.tar.bz2 yuzu-c39c8e69824af03799b0903f218eac81eba80751.tar.lz yuzu-c39c8e69824af03799b0903f218eac81eba80751.tar.xz yuzu-c39c8e69824af03799b0903f218eac81eba80751.tar.zst yuzu-c39c8e69824af03799b0903f218eac81eba80751.zip |
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index ab10db3df..2fd07ab34 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -1339,6 +1339,20 @@ static ResultCode WaitProcessWideKeyAtomic(VAddr mutex_addr, VAddr condition_var "called mutex_addr={:X}, condition_variable_addr={:X}, thread_handle=0x{:08X}, timeout={}", mutex_addr, condition_variable_addr, thread_handle, nano_seconds); + if (Memory::IsKernelVirtualAddress(mutex_addr)) { + LOG_ERROR( + Kernel_SVC, + "Given mutex address must not be within the kernel address space. address=0x{:016X}", + mutex_addr); + return ERR_INVALID_ADDRESS_STATE; + } + + if (!Common::IsWordAligned(mutex_addr)) { + LOG_ERROR(Kernel_SVC, "Given mutex address must be word-aligned. address=0x{:016X}", + mutex_addr); + return ERR_INVALID_ADDRESS; + } + auto* const current_process = Core::System::GetInstance().Kernel().CurrentProcess(); const auto& handle_table = current_process->GetHandleTable(); SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); |