aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/i386/exec_machdep.c
diff options
context:
space:
mode:
authorKornel Dulęba <kd@FreeBSD.org>2022-06-02 08:45:54 +0000
committerKornel Dulęba <kd@FreeBSD.org>2022-07-18 14:27:26 +0000
commitf6ac79fb12f3c7ad891849d6721a20a100f6a9a9 (patch)
tree159d97b05e205a0a5a72a712ed558ec35d43c4ce /sys/i386/i386/exec_machdep.c
parentddd9004e7a5dbf02c34ef0effcef90f7d5df357d (diff)
downloadsrc-f6ac79fb12f3c7ad891849d6721a20a100f6a9a9.tar.gz
src-f6ac79fb12f3c7ad891849d6721a20a100f6a9a9.zip
Introduce the PROC_SIGCODE() macro
Use a getter macro instead of fetching the sigcode address directly from a sysent of a given process. It assumes that the sigcode is stored in the shared page, which is true in all cases, except for a.out binaries. This will be later useful when the shared page address randomization is introduced. No functional change intended. Approved by: mw(mentor) Sponsored by: Stormshield Obtained from: Semihalf Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D35392
Diffstat (limited to 'sys/i386/i386/exec_machdep.c')
-rw-r--r--sys/i386/i386/exec_machdep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/i386/i386/exec_machdep.c b/sys/i386/i386/exec_machdep.c
index 0463615d96d9..ba85cf9756a9 100644
--- a/sys/i386/i386/exec_machdep.c
+++ b/sys/i386/i386/exec_machdep.c
@@ -238,7 +238,7 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
regs->tf_esp = (int)fp;
if (p->p_sysent->sv_sigcode_base != 0) {
- regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode -
+ regs->tf_eip = PROC_SIGCODE(p) + szsigcode -
szosigcode;
} else {
/* a.out sysentvec does not use shared page */
@@ -363,7 +363,7 @@ freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
}
regs->tf_esp = (int)sfp;
- regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode -
+ regs->tf_eip = PROC_SIGCODE(p) + szsigcode -
szfreebsd4_sigcode;
regs->tf_eflags &= ~(PSL_T | PSL_D);
regs->tf_cs = _ucodesel;
@@ -525,7 +525,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
}
regs->tf_esp = (int)sfp;
- regs->tf_eip = p->p_sysent->sv_sigcode_base;
+ regs->tf_eip = PROC_SIGCODE(p);
if (regs->tf_eip == 0)
regs->tf_eip = PROC_PS_STRINGS(p) - szsigcode;
regs->tf_eflags &= ~(PSL_T | PSL_D);