mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
Kernel: Fix 64-bit address truncation in MemoryManager::ensure_pte()
This commit is contained in:
parent
ed25a6ad0d
commit
f0c4941beb
Notes:
sideshowbarker
2024-07-18 08:48:25 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/f0c4941beb4 Pull-request: https://github.com/SerenityOS/serenity/pull/8795 Reviewed-by: https://github.com/Hendiadyoin1
@ -552,7 +552,8 @@ PageTableEntry* MemoryManager::ensure_pte(PageDirectory& page_directory, Virtual
|
||||
pde.set_global(&page_directory == m_kernel_page_directory.ptr());
|
||||
// Use page_directory_table_index and page_directory_index as key
|
||||
// This allows us to release the page table entry when no longer needed
|
||||
auto result = page_directory.m_page_tables.set(vaddr.get() & ~0x1fffff, move(page_table));
|
||||
auto result = page_directory.m_page_tables.set(vaddr.get() & ~(FlatPtr)0x1fffff, move(page_table));
|
||||
// If you're hitting this VERIFY on x86_64 chances are a 64-bit pointer was truncated somewhere
|
||||
VERIFY(result == AK::HashSetResult::InsertedNewEntry);
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ private:
|
||||
#else
|
||||
RefPtr<PhysicalPage> m_directory_pages[4];
|
||||
#endif
|
||||
HashMap<u32, RefPtr<PhysicalPage>> m_page_tables;
|
||||
HashMap<FlatPtr, RefPtr<PhysicalPage>> m_page_tables;
|
||||
RecursiveSpinLock m_lock;
|
||||
bool m_valid { false };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user