mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 18:07:34 +00: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);
|
VERIFY((size % PAGE_SIZE) == 0);
|
||||||
|
|
||||||
Range const allocated_range(base, size);
|
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);
|
ScopedSpinLock lock(m_lock);
|
||||||
for (auto it = m_available_ranges.begin(); !it.is_end(); ++it) {
|
for (auto it = m_available_ranges.begin(); !it.is_end(); ++it) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue