mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-24 19:54:22 -04:00
kern: fix KCodeMemory SVCs when Owner process != Generator process
This commit is contained in:
parent
9b65daf439
commit
dbe59fd041
2 changed files with 4 additions and 4 deletions
|
@ -110,7 +110,7 @@ namespace ams::kern::svc {
|
|||
case ams::svc::CodeMemoryOperation_MapToOwner:
|
||||
{
|
||||
/* Check that the region is in range. */
|
||||
R_UNLESS(GetCurrentProcess().GetPageTable().CanContain(address, size, KMemoryState_GeneratedCode), svc::ResultInvalidMemoryRegion());
|
||||
R_UNLESS(code_mem->GetOwner()->GetPageTable().CanContain(address, size, KMemoryState_GeneratedCode), svc::ResultInvalidMemoryRegion());
|
||||
|
||||
/* Check the memory permission. */
|
||||
R_UNLESS(IsValidMapToOwnerCodeMemoryPermission(perm), svc::ResultInvalidNewMemoryPermission());
|
||||
|
@ -122,7 +122,7 @@ namespace ams::kern::svc {
|
|||
case ams::svc::CodeMemoryOperation_UnmapFromOwner:
|
||||
{
|
||||
/* Check that the region is in range. */
|
||||
R_UNLESS(GetCurrentProcess().GetPageTable().CanContain(address, size, KMemoryState_GeneratedCode), svc::ResultInvalidMemoryRegion());
|
||||
R_UNLESS(code_mem->GetOwner()->GetPageTable().CanContain(address, size, KMemoryState_GeneratedCode), svc::ResultInvalidMemoryRegion());
|
||||
|
||||
/* Check the memory permission. */
|
||||
R_UNLESS(IsValidUnmapFromOwnerCodeMemoryPermission(perm), svc::ResultInvalidNewMemoryPermission());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue