summaryrefslogtreecommitdiff
path: root/sys/arch/vax
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-04-18 11:51:18 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-04-18 11:51:18 +0000
commit0a8d233b5a2f60bcd449b707cc466d17560dec34 (patch)
tree2e60f99714a1681f8961c7ac537c7791334ec02e /sys/arch/vax
parentc69678059df7cbd9d0d400a81c0b2430847a6436 (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/vax')
-rw-r--r--sys/arch/vax/vax/trap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c
index d7e06b1d49d..bcd9a5a609f 100644
--- a/sys/arch/vax/vax/trap.c
+++ b/sys/arch/vax/vax/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.50 2014/03/30 21:54:49 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.51 2014/04/18 11:51:17 guenther Exp $ */
/* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -110,6 +110,7 @@ arithflt(frame)
if ((umode = USERMODE(frame))) {
type |= T_USER;
p->p_addr->u_pcb.framep = frame;
+ refreshcreds(p);
}
type&=~(T_WRITE|T_PTEFETCH);