diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-11-30 01:07:59 +0200 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-12-01 21:44:11 +0200 |
commit | 40f64d7379e7cc138304f5069006ce9b8e981c87 (patch) | |
tree | 0bcc7eb03236c393309c13295f7954d3317a9188 /Kernel/Memory | |
parent | f415218afe008ba2de123040781c550f3cf48352 (diff) | |
download | serenity-40f64d7379e7cc138304f5069006ce9b8e981c87.zip |
Kernel: Dispatch handle-able signals instead of crashing if possible
This matches the behaviour of the other *nixs and allows processes to
try and recover from such signals in userland.
Diffstat (limited to 'Kernel/Memory')
-rw-r--r-- | Kernel/Memory/MemoryManager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Memory/MemoryManager.cpp b/Kernel/Memory/MemoryManager.cpp index 42cd4e34f3..54b0adfb01 100644 --- a/Kernel/Memory/MemoryManager.cpp +++ b/Kernel/Memory/MemoryManager.cpp @@ -654,7 +654,7 @@ void MemoryManager::validate_syscall_preconditions(AddressSpace& space, Register VirtualAddress userspace_sp = VirtualAddress { regs.userspace_sp() }; if (!MM.validate_user_stack_no_lock(space, userspace_sp)) { dbgln("Invalid stack pointer: {}", userspace_sp); - unlock_and_handle_crash("Bad stack on syscall entry", SIGSEGV); + return unlock_and_handle_crash("Bad stack on syscall entry", SIGSEGV); } } @@ -663,17 +663,17 @@ void MemoryManager::validate_syscall_preconditions(AddressSpace& space, Register auto* calling_region = MM.find_user_region_from_vaddr_no_lock(space, ip); if (!calling_region) { dbgln("Syscall from {:p} which has no associated region", ip); - unlock_and_handle_crash("Syscall from unknown region", SIGSEGV); + return unlock_and_handle_crash("Syscall from unknown region", SIGSEGV); } if (calling_region->is_writable()) { dbgln("Syscall from writable memory at {:p}", ip); - unlock_and_handle_crash("Syscall from writable memory", SIGSEGV); + return unlock_and_handle_crash("Syscall from writable memory", SIGSEGV); } if (space.enforces_syscall_regions() && !calling_region->is_syscall_region()) { dbgln("Syscall from non-syscall region"); - unlock_and_handle_crash("Syscall from non-syscall region", SIGSEGV); + return unlock_and_handle_crash("Syscall from non-syscall region", SIGSEGV); } } } |