mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Kernel: Convert RangeAllocator VERIFY to proper error handling
If a user allocates above 0x0 and below the allowable usermode virtual address space, we need to return error instead of asserting. Fixes: #8484
This commit is contained in:
parent
a5a62f99c5
commit
dbc77148c9
1 changed files with 3 additions and 1 deletions
|
@ -143,7 +143,9 @@ Optional<Range> RangeAllocator::allocate_specific(VirtualAddress base, size_t si
|
|||
VERIFY((size % PAGE_SIZE) == 0);
|
||||
|
||||
Range const allocated_range(base, size);
|
||||
VERIFY(m_total_range.contains(allocated_range));
|
||||
if (!m_total_range.contains(allocated_range)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
ScopedSpinLock lock(m_lock);
|
||||
for (auto it = m_available_ranges.begin(); !it.is_end(); ++it) {
|
||||
|
|
Loading…
Add table
Reference in a new issue