kern: fix bugs in Receive/Exchange ipc buffers

This commit is contained in:
Michael Scire 2020-07-13 10:02:01 -07:00
parent 095fc6b996
commit 84d8634938
2 changed files with 2 additions and 2 deletions

View file

@ -400,7 +400,7 @@ namespace ams::kern {
/* If this is our first lock, update our permissions. */
if (new_lock_count == 1) {
MESOSPHERE_ASSERT(this->original_perm == KMemoryPermission_None);
MESOSPHERE_ASSERT((this->perm | new_perm) == this->perm);
MESOSPHERE_ASSERT((this->perm | new_perm | KMemoryPermission_NotMapped) == (this->perm | KMemoryPermission_NotMapped));
MESOSPHERE_ASSERT((this->perm & KMemoryPermission_UserExecute) != KMemoryPermission_UserExecute || (new_perm == KMemoryPermission_UserRead));
this->original_perm = this->perm;
this->perm = static_cast<KMemoryPermission>((new_perm & KMemoryPermission_IpcLockChangeMask) | (this->original_perm & ~KMemoryPermission_IpcLockChangeMask));

View file

@ -2169,7 +2169,7 @@ namespace ams::kern {
std::memcpy(GetVoidPointer(end_partial_page), GetVoidPointer(GetHeapVirtualAddress(cur_block_addr)), copy_size);
std::memset(GetVoidPointer(end_partial_page + copy_size), fill_val, PageSize - copy_size);
} else {
std::memset(GetVoidPointer(start_partial_page), fill_val, PageSize);
std::memset(GetVoidPointer(end_partial_page), fill_val, PageSize);
}
/* Map the page. */