mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +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
Notes:
sideshowbarker
2024-07-18 08:53:46 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/dbc77148c97 Pull-request: https://github.com/SerenityOS/serenity/pull/8831 Issue: https://github.com/SerenityOS/serenity/issues/8484
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…
Reference in a new issue