diff options
author | marcel <marcel@FreeBSD.org> | 2000-11-30 05:23:49 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2000-11-30 05:23:49 +0000 |
commit | 75c76bdc6b73745ecfa9955e547ca6ba4fd7d328 (patch) | |
tree | c43af70e24691529e40621dabcaf4913d9d353f4 /sys/i386/include/cpu.h | |
parent | 673e30eadab9fe762d23631609edf13e018f59c1 (diff) | |
download | FreeBSD-src-75c76bdc6b73745ecfa9955e547ca6ba4fd7d328.zip FreeBSD-src-75c76bdc6b73745ecfa9955e547ca6ba4fd7d328.tar.gz |
Don't use p->p_sigstk.ss_flags to keep state of whether the
process is on the alternate stack or not. For compatibility
with sigstack(2) state is being updated if such is needed.
We now determine whether the process is on the alternate
stack by looking at its stack pointer. This allows a process
to siglongjmp from a signal handler on the alternate stack
to the place of the sigsetjmp on the normal stack. When
maintaining state, this would have invalidated the state
information and causing a subsequent signal to be delivered
on the normal stack instead of the alternate stack.
PR: 22286
Diffstat (limited to 'sys/i386/include/cpu.h')
-rw-r--r-- | sys/i386/include/cpu.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 669af64..9293ba2 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -58,7 +58,8 @@ #define cpu_exec(p) /* nothing */ #define cpu_swapin(p) /* nothing */ -#define cpu_setstack(p, ap) ((p)->p_md.md_regs[SP] = (ap)) +#define cpu_getstack(p) ((p)->p_md.md_regs->tf_esp) +#define cpu_setstack(p, ap) ((p)->p_md.md_regs->tf_esp = (ap)) #define CLKF_USERMODE(framep) \ ((ISPL((framep)->cf_cs) == SEL_UPL) || (framep->cf_eflags & PSL_VM)) |