mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
Kernel: Sanity check the VM range when constructing a Region
This should help us catch bogus VM ranges ending up in a process's address space sooner.
This commit is contained in:
parent
62f0f73bf0
commit
a5def4e98c
Notes:
sideshowbarker
2024-07-18 22:22:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a5def4e98ca
@ -49,6 +49,10 @@ Region::Region(const Range& range, NonnullRefPtr<VMObject> vmobject, size_t offs
|
||||
, m_cacheable(cacheable)
|
||||
, m_kernel(kernel)
|
||||
{
|
||||
ASSERT(m_range.base().is_page_aligned());
|
||||
ASSERT(m_range.size());
|
||||
ASSERT((m_range.size() % PAGE_SIZE) == 0);
|
||||
|
||||
m_vmobject->ref_region();
|
||||
register_purgeable_page_ranges();
|
||||
MM.register_region(*this);
|
||||
|
Loading…
Reference in New Issue
Block a user