From bc767742f75839ada08a74b1ac0cb06b8c86a628 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 12 Jul 2020 18:53:45 -0700 Subject: [PATCH] kern: fix unaligned map alias buffers --- libraries/libmesosphere/source/kern_k_page_table_base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libmesosphere/source/kern_k_page_table_base.cpp b/libraries/libmesosphere/source/kern_k_page_table_base.cpp index c9b197b0d..5ca227324 100644 --- a/libraries/libmesosphere/source/kern_k_page_table_base.cpp +++ b/libraries/libmesosphere/source/kern_k_page_table_base.cpp @@ -2180,7 +2180,7 @@ namespace ams::kern { this->memory_block_manager.Update(std::addressof(allocator), dst_addr, aligned_src_size / PageSize, dst_state, test_perm, KMemoryAttribute_None); /* Set the output address. */ - *out_addr = dst_addr; + *out_addr = dst_addr + (src_start - aligned_src_start); /* We succeeded. */ cleanup_guard.Cancel();