kern: fix KCodeMemory SVCs when Owner process != Generator process

This commit is contained in:
Michael Scire 2020-09-17 08:25:27 -07:00 committed by SciresM
parent 9b65daf439
commit dbe59fd041
2 changed files with 4 additions and 4 deletions

View file

@ -133,7 +133,7 @@ namespace ams::kern {
}
/* Map the memory. */
R_TRY(GetCurrentProcess().GetPageTable().MapPageGroup(address, GetReference(this->page_group), KMemoryState_GeneratedCode, k_perm));
R_TRY(this->owner->GetPageTable().MapPageGroup(address, GetReference(this->page_group), KMemoryState_GeneratedCode, k_perm));
/* Mark ourselves as mapped. */
this->is_owner_mapped = true;
@ -151,7 +151,7 @@ namespace ams::kern {
KScopedLightLock lk(this->lock);
/* Unmap the memory. */
R_TRY(GetCurrentProcess().GetPageTable().UnmapPageGroup(address, GetReference(this->page_group), KMemoryState_GeneratedCode));
R_TRY(this->owner->GetPageTable().UnmapPageGroup(address, GetReference(this->page_group), KMemoryState_GeneratedCode));
/* Mark ourselves as unmapped. */
MESOSPHERE_ASSERT(this->is_owner_mapped);