SPU: absolutely unacceptable hack for SPU LS

Make normal threads inaccessible in PS3 memory.
This commit is contained in:
Nekotekina 2020-11-17 14:53:41 +03:00
parent f8d1f070f5
commit 0fec99e75b
2 changed files with 4 additions and 3 deletions

View File

@ -1672,7 +1672,8 @@ spu_thread::spu_thread(lv2_spu_group* group, u32 index, std::string_view name, u
}
else
{
vm::get(vm::spu)->falloc(SPU_FAKE_BASE_ADDR + SPU_LS_SIZE * (cpu_thread::id & 0xffffff), SPU_LS_SIZE, &shm);
// 0x1000 indicates falloc to allocate page with no access rights in base memory
vm::get(vm::spu)->falloc(SPU_FAKE_BASE_ADDR + SPU_LS_SIZE * (cpu_thread::id & 0xffffff), SPU_LS_SIZE, &shm, 0x1000);
}
vm::writer_lock(0);

View File

@ -1173,7 +1173,7 @@ namespace vm
return 0;
}
u8 pflags = page_readable | page_writable;
u8 pflags = flags & 0x1000 ? 0 : page_readable | page_writable;
if ((flags & SYS_MEMORY_PAGE_SIZE_64K) == SYS_MEMORY_PAGE_SIZE_64K)
{
@ -1230,7 +1230,7 @@ namespace vm
return 0;
}
u8 pflags = page_readable | page_writable;
u8 pflags = flags & 0x1000 ? 0 : page_readable | page_writable;
if ((flags & SYS_MEMORY_PAGE_SIZE_64K) == SYS_MEMORY_PAGE_SIZE_64K)
{