Prechádzať zdrojové kódy

kernel: Add missing address space check in SetMemoryAttribute syscall (#2771)

Mary 4 rokov pred
rodič
commit
e7e65ccbc9

+ 5 - 0
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,