From 7c39e7eb9d02a4350f387096c98e25e4096ebfc3 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Wed, 9 Jul 2014 07:29:01 +0000 Subject: 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 --- sys/arch/amd64/amd64/trap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/arch/amd64') 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) { -- cgit v1.2.3