summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-07-09 07:29:01 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-07-09 07:29:01 +0000
commit7c39e7eb9d02a4350f387096c98e25e4096ebfc3 (patch)
tree4fc81f7a16a2971f44e7b7d9dd0160fbf061465d /sys/arch/amd64
parent163e621a2980bfdad3947546dae7b9d31fafb686 (diff)
Fix boot -d. refreshcreds() should be called when trapping from userspace,
but I flipped the test on i386/amd64, thus breaking kernel traps before enough proc0 bits were set up. In theory, this could have resulted in a NFS read for a page fault being done with a process's old credentials. pointed out by Patrick Wildt of bitrig
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/trap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index 5c336f7704a..67e2ec884a3 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.40 2014/06/15 11:43:24 sf Exp $ */
+/* $OpenBSD: trap.c,v 1.41 2014/07/09 07:29:00 guenther Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@@ -175,8 +175,8 @@ trap(struct trapframe *frame)
if (!KERNELMODE(frame->tf_cs, frame->tf_rflags)) {
type |= T_USER;
p->p_md.md_regs = frame;
- } else /* if (type != T_NMI) */
refreshcreds(p);
+ }
switch (type) {