mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
Kernel: Don't assert on PT_PEEK with kernelspace address
We were casting the address to Userspace<T> without validating it first which is no good and will trap an assertion soon after. Let's catch this sooner with an ASSERT in the Userspace<T> constructor and update the PT_PEEK and PT_POKE handlers to avoid it. Fixes #4505.
This commit is contained in:
parent
c25cf5fb56
commit
eaa63fdda5
2 changed files with 10 additions and 9 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
|
@ -59,6 +60,7 @@ public:
|
|||
Userspace(FlatPtr ptr)
|
||||
: m_ptr(ptr)
|
||||
{
|
||||
ASSERT(m_ptr < 0xc0000000);
|
||||
}
|
||||
|
||||
FlatPtr ptr() const { return m_ptr; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue