diff options
author | 2014-07-09 07:29:00 +0000 | |
---|---|---|
committer | 2014-07-09 07:29:00 +0000 | |
commit | 582bc37d90ba283515a7132430decfb355e76ecb (patch) | |
tree | 2b55fb1ddb3ed341535687da5a76c1f59c19d90b | |
parent | Fix backtraces through _dl_bind_start by adding dwarf annotations for (diff) | |
download | wireguard-openbsd-582bc37d90ba283515a7132430decfb355e76ecb.tar.xz wireguard-openbsd-582bc37d90ba283515a7132430decfb355e76ecb.zip |
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
-rw-r--r-- | sys/arch/amd64/amd64/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/trap.c | 4 |
2 files changed, 4 insertions, 4 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) { diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index 4454ae00b00..c291d221983 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.116 2014/05/11 00:12:44 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.117 2014/07/09 07:29:00 guenther Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -155,8 +155,8 @@ trap(struct trapframe *frame) if (!KERNELMODE(frame->tf_cs, frame->tf_eflags)) { type |= T_USER; p->p_md.md_regs = frame; - } else if (type != T_NMI) refreshcreds(p); + } switch (type) { |