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

Kernel: Don't consider kernel memory regions for syscall origin check

We should never enter the syscall handler from a kernel address.
This commit is contained in:
Andreas Kling 2021-04-20 21:01:13 +02:00
parent d71f64b97f
commit c6b7b98b64
3 changed files with 6 additions and 6 deletions

View file

@ -190,7 +190,7 @@ void syscall_handler(TrapFrame* trap)
handle_crash(regs, "Bad stack on syscall entry", SIGSTKFLT);
}
auto* calling_region = MM.find_region_from_vaddr(process.space(), VirtualAddress(regs.eip));
auto* calling_region = MM.find_user_region_from_vaddr(process.space(), VirtualAddress(regs.eip));
if (!calling_region) {
dbgln("Syscall from {:p} which has no associated region", regs.eip);
handle_crash(regs, "Syscall from unknown region", SIGSEGV);