diff options
author | peter <peter@FreeBSD.org> | 2003-05-08 00:05:00 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2003-05-08 00:05:00 +0000 |
commit | 068f75971f64344d1cb4e2cc5fefffb205dc2f50 (patch) | |
tree | e62d0c99ece0484a3cb4bfca5ea25d923a525779 /sys/amd64 | |
parent | c0c9e857817ea4cd7f136f335f31a0b397354ff0 (diff) | |
download | FreeBSD-src-068f75971f64344d1cb4e2cc5fefffb205dc2f50.zip FreeBSD-src-068f75971f64344d1cb4e2cc5fefffb205dc2f50.tar.gz |
Fix a preemption race. I was reenabling interrupts in the fast system
call handler before it was safe. It was possible for to lose context
and for something else to clobber the PCPU scratch variable. This
moves the interrupt enable *way* too late, but its better safe than
sorry for the moment.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/exception.S | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 064725b..375d178 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -202,7 +202,6 @@ IDTVEC(fast_syscall) #swapgs movq %rsp,PCPU(SCRATCH_RSP) movq common_tss+COMMON_TSS_RSP0,%rsp - sti /* Now emulate a trapframe. Ugh. */ subq $TF_SIZE,%rsp movq $KUDSEL,TF_SS(%rsp) @@ -226,6 +225,7 @@ IDTVEC(fast_syscall) movq %r15,TF_R15(%rsp) /* C preserved */ movq PCPU(SCRATCH_RSP),%r12 /* %r12 already saved */ movq %r12,TF_RSP(%rsp) /* user stack pointer */ + sti call syscall movq PCPU(CURPCB),%rax testq $PCB_FULLCTX,PCB_FLAGS(%rax) |