summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-09-18 00:49:51 +0200
committerLioncash <mathew1800@gmail.com>2018-09-18 05:27:53 +0200
commitb6867602ca5accf84b5e1f9d4895b232c9448816 (patch)
tree1fa3c3b8972f6d795197fd6ad73afa0f0f982ba6 /src/core/hle/kernel
parentMerge pull request #1311 from FernandoS27/fast-swizzle (diff)
downloadyuzu-b6867602ca5accf84b5e1f9d4895b232c9448816.tar
yuzu-b6867602ca5accf84b5e1f9d4895b232c9448816.tar.gz
yuzu-b6867602ca5accf84b5e1f9d4895b232c9448816.tar.bz2
yuzu-b6867602ca5accf84b5e1f9d4895b232c9448816.tar.lz
yuzu-b6867602ca5accf84b5e1f9d4895b232c9448816.tar.xz
yuzu-b6867602ca5accf84b5e1f9d4895b232c9448816.tar.zst
yuzu-b6867602ca5accf84b5e1f9d4895b232c9448816.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/svc.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index c5c1697ee..371fc439e 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -280,6 +280,10 @@ static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr,
"requesting_current_thread_handle=0x{:08X}",
holding_thread_handle, mutex_addr, requesting_thread_handle);
+ if (Memory::IsKernelVirtualAddress(mutex_addr)) {
+ return ERR_INVALID_ADDRESS_STATE;
+ }
+
auto& handle_table = Core::System::GetInstance().Kernel().HandleTable();
return Mutex::TryAcquire(handle_table, mutex_addr, holding_thread_handle,
requesting_thread_handle);
@@ -289,6 +293,10 @@ static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr,
static ResultCode ArbitrateUnlock(VAddr mutex_addr) {
LOG_TRACE(Kernel_SVC, "called mutex_addr=0x{:X}", mutex_addr);
+ if (Memory::IsKernelVirtualAddress(mutex_addr)) {
+ return ERR_INVALID_ADDRESS_STATE;
+ }
+
return Mutex::Release(mutex_addr);
}