mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
Kernel: Returning from a signal handler reset the signal mask correctly.
We were setting the handled signal number as the new signal mask, oops.
This commit is contained in:
parent
251293f2e1
commit
9e1fcb74a2
Notes:
sideshowbarker
2024-07-19 15:33:05 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9e1fcb74a24
1 changed files with 2 additions and 0 deletions
|
@ -970,6 +970,7 @@ ShouldUnblockProcess Process::dispatch_signal(byte signal)
|
|||
auto* region = allocate_region(LinearAddress(), PAGE_SIZE, "signal_trampoline", true, true);
|
||||
m_return_to_ring3_from_signal_trampoline = region->laddr();
|
||||
byte* code_ptr = m_return_to_ring3_from_signal_trampoline.as_ptr();
|
||||
*code_ptr++ = 0x58; // pop eax (Skip over signal argument)
|
||||
*code_ptr++ = 0x5a; // pop edx
|
||||
*code_ptr++ = 0xb8; // mov eax, <dword>
|
||||
*(dword*)code_ptr = Syscall::SC_restore_signal_mask;
|
||||
|
@ -983,6 +984,7 @@ ShouldUnblockProcess Process::dispatch_signal(byte signal)
|
|||
*code_ptr++ = 0x0b;
|
||||
|
||||
m_return_to_ring0_from_signal_trampoline = LinearAddress((dword)code_ptr);
|
||||
*code_ptr++ = 0x58; // pop eax (Skip over signal argument)
|
||||
*code_ptr++ = 0x5a; // pop edx
|
||||
*code_ptr++ = 0xb8; // mov eax, <dword>
|
||||
*(dword*)code_ptr = Syscall::SC_restore_signal_mask;
|
||||
|
|
Loading…
Add table
Reference in a new issue