diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-04-18 11:51:18 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-04-18 11:51:18 +0000 |
commit | 0a8d233b5a2f60bcd449b707cc466d17560dec34 (patch) | |
tree | 2e60f99714a1681f8961c7ac537c7791334ec02e /sys/arch/m88k | |
parent | c69678059df7cbd9d0d400a81c0b2430847a6436 (diff) |
Have each thread keeps its own (counted!) reference to the process's ucreds
to avoid possible use-after-free references when swapping ids in threaded
processes. "Do I have the right creds?" checks are always made with the
threads creds.
Inspired by FreeBSD and NetBSD
"right time" deraadt@
Diffstat (limited to 'sys/arch/m88k')
-rw-r--r-- | sys/arch/m88k/m88k/trap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index e9c90127a41..b60fcff358e 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.89 2014/03/26 05:23:42 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.90 2014/04/18 11:51:17 guenther Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -245,6 +245,7 @@ m88100_trap(u_int type, struct trapframe *frame) if (USERMODE(frame->tf_epsr)) { type += T_USER; p->p_md.md_tf = frame; /* for ptrace/signals */ + refreshcreds(p); } fault_type = SI_NOINFO; fault_code = 0; @@ -713,6 +714,7 @@ m88110_trap(u_int type, struct trapframe *frame) if (USERMODE(frame->tf_epsr)) { type += T_USER; p->p_md.md_tf = frame; /* for ptrace/signals */ + refreshcreds(p); } if (sig != 0) |