aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary <me@thog.eu>2021-10-24 01:07:41 +0200
committerGitHub <noreply@github.com>2021-10-24 01:07:41 +0200
commite7e65ccbc9caed8b7211399a1040fcd4a7ef77da (patch)
tree15f25a7106c87437dd92e435cee155970d1ce9a1
parent0d174cbd4555e69660a900577a52f3d4bf7391b9 (diff)
kernel: Add missing address space check in SetMemoryAttribute syscall (#2771)
-rw-r--r--Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
index d65a373d..4718d412 100644
--- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
+++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
@@ -845,6 +845,11 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
KProcess process = KernelStatic.GetCurrentProcess();
+ if (!process.MemoryManager.InsideAddrSpace(position, size))
+ {
+ return KernelResult.InvalidMemState;
+ }
+
KernelResult result = process.MemoryManager.SetMemoryAttribute(
position,
size,