From 231f708c62bb2939dff269875316bbebcac59e37 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Mon, 22 Jan 2024 07:24:15 +0900 Subject: [PATCH] x86_64: Use 0x516 as magic signal return address --- kernel/arch/x86_64/idt.c | 4 ++-- kernel/arch/x86_64/user.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/arch/x86_64/idt.c b/kernel/arch/x86_64/idt.c index e3fbef74..7120b1f9 100644 --- a/kernel/arch/x86_64/idt.c +++ b/kernel/arch/x86_64/idt.c @@ -499,8 +499,8 @@ static void _page_fault(struct regs * r) { uintptr_t faulting_address; asm volatile("mov %%cr2, %0" : "=r"(faulting_address)); - /* 8DEADBEEFh is the magic ret-from-sig address. */ - if (faulting_address == 0x8DEADBEEF) { + /* magic ret-from-sig address */ + if (faulting_address == 0x516) { return_from_signal_handler(r); return; } diff --git a/kernel/arch/x86_64/user.c b/kernel/arch/x86_64/user.c index d8ba1e88..1c9ea9b6 100644 --- a/kernel/arch/x86_64/user.c +++ b/kernel/arch/x86_64/user.c @@ -138,7 +138,7 @@ void arch_enter_signal_handler(uintptr_t entrypoint, int signum, struct regs *r) PUSH(ret.rsp, uint64_t, this_core->current_process->thread.fp_regs[i]); } - PUSH(ret.rsp, uintptr_t, 0x00000008DEADBEEF); + PUSH(ret.rsp, uintptr_t, 0x516); update_process_times_on_exit();