aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-02-22 19:35:20 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-02-22 19:35:20 +0000
commitfeb43c5f37d221250d4a5d8a407b1e56a455a50b (patch)
tree0393e011a98c40a848bf9f0f9d78ff251f2a918f /sys/kern/subr_trap.c
parentd1885c41cc45afda2c3b5d49cef01abc634166aa (diff)
downloadsrc-feb43c5f37d221250d4a5d8a407b1e56a455a50b.tar.gz
src-feb43c5f37d221250d4a5d8a407b1e56a455a50b.zip
The p_md.md_regs member of proc is used in signal handling to reference
the the original trapframe of the syscall, trap, or interrupt that entered the kernel. Before SMPng, ast's were handled via a psuedo trap at the end of doerti. With the SMPng commit, ast's were broken out into a separate ast() function that was called from doreti to match the behavior of other architectures. Unfortunately, when this was done, the p_md.md_regs member of curproc was not updateda in ast(), thus when signals are handled by userret() after an interrupt that returns to userland, we end up using a stale trapframe that will result in the registers from the old trapframe overwriting the real trapframe and smashing all the registers right before we return to usermode. The saved %cs:%eip from where we were in usermode are saved in the trapframe for example.
Notes
Notes: svn path=/head/; revision=72917
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 820ffca0958a..b418c0497366 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -1289,6 +1289,7 @@ ast(framep)
}
sticks = p->p_sticks;
+ p->p_md.md_regs = framep;
astoff(p);
cnt.v_soft++;