1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

Kernel: Panic on sys$get_stack_bounds() in stack-less process

This commit is contained in:
Andreas Kling 2021-02-14 10:49:16 +01:00
parent 3131281747
commit cc341c95aa

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <Kernel/Panic.h>
#include <Kernel/Process.h>
#include <Kernel/VM/Region.h>
@ -34,8 +35,7 @@ int Process::sys$get_stack_bounds(FlatPtr* user_stack_base, size_t* user_stack_s
FlatPtr stack_pointer = Thread::current()->get_register_dump_from_stack().userspace_esp;
auto* stack_region = space().find_region_containing(Range { VirtualAddress(stack_pointer), 1 });
if (!stack_region) {
ASSERT_NOT_REACHED();
return -EINVAL;
PANIC("sys$get_stack_bounds: No stack region found for process");
}
FlatPtr stack_base = stack_region->range().base().get();