From d00a638bfd668fea9608fa14cbcea3df783e9be5 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Tue, 31 Jan 2023 01:27:50 +0000 Subject: [PATCH] mips: Fix sendsig for stack layout randomisation PS_STRINGS doesn't account for the stack gap, we need to use the new PROC_PS_STRINGS macro to correctly point at the trampoline. This is a direct commit to stable/13 as mips no longer exists in main. Fixes: d247611467e0 ("exec: Introduce the PROC_PS_STRINGS() macro") --- sys/mips/mips/pm_machdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/mips/mips/pm_machdep.c b/sys/mips/mips/pm_machdep.c index 7a9db29b6ff..9fcbef14f60 100644 --- a/sys/mips/mips/pm_machdep.c +++ b/sys/mips/mips/pm_machdep.c @@ -175,7 +175,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* * Signal trampoline code is at base of user stack. */ - regs->ra = (register_t)(intptr_t)PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->ra = (register_t)(intptr_t)PROC_PS_STRINGS(p) - + *(p->p_sysent->sv_szsigcode); PROC_LOCK(p); mtx_lock(&psp->ps_mtx); }