mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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: a5def4e98c
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue