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:	d247611467 ("exec: Introduce the PROC_PS_STRINGS() macro")
This commit is contained in:
Jessica Clarke 2023-01-31 01:27:50 +00:00
parent a82b1ca603
commit d00a638bfd

View file

@ -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);
}