mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:42:13 +00: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
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