Properly handle search_end restrictions in sceKernelAllocateDirectMemory (#4600)

This commit is contained in:
Stephen Miller 2026-06-20 02:20:32 -04:00 committed by GitHub
parent dcd036d261
commit 5ddd87d742
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -256,7 +256,7 @@ PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, u64 size, u6
mapping_end = mapping_start + size;
}
if (dmem_area == dmem_map.end()) {
if (dmem_area == dmem_map.end() || mapping_end > search_end) {
// There are no suitable mappings in this range
LOG_ERROR(Kernel_Vmm, "Unable to find free direct memory area: size = {:#x}", size);
return -1;