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

Kernel: Skip generic region lookup in sys$futex and sys$get_stack_bounds

Just ask the process space directly instead of using the generic region
lookup that also checks for kernel regions.
This commit is contained in:
Andreas Kling 2021-02-08 20:14:33 +01:00
parent b31a514cce
commit b1c9f93fa3
2 changed files with 6 additions and 11 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -25,14 +25,14 @@
*/
#include <Kernel/Process.h>
#include <Kernel/VM/MemoryManager.h>
#include <Kernel/VM/Region.h>
namespace Kernel {
int Process::sys$get_stack_bounds(FlatPtr* user_stack_base, size_t* user_stack_size)
{
FlatPtr stack_pointer = Thread::current()->get_register_dump_from_stack().userspace_esp;
auto* stack_region = MM.find_region_from_vaddr(space(), VirtualAddress(stack_pointer));
auto* stack_region = space().find_region_containing(Range { VirtualAddress(stack_pointer), 1 });
if (!stack_region) {
ASSERT_NOT_REACHED();
return -EINVAL;