mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 17:47:18 +00: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user