From e7e65ccbc9caed8b7211399a1040fcd4a7ef77da Mon Sep 17 00:00:00 2001 From: Mary Date: Sun, 24 Oct 2021 01:07:41 +0200 Subject: [PATCH] kernel: Add missing address space check in SetMemoryAttribute syscall (#2771) --- Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs index d65a373dd..4718d412b 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,