summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64
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/hppa64
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/hppa64')
-rw-r--r--sys/arch/hppa64/hppa64/trap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/hppa64/hppa64/trap.c b/sys/arch/hppa64/hppa64/trap.c
index 02472f0d158..8310c42db1b 100644
--- a/sys/arch/hppa64/hppa64/trap.c
+++ b/sys/arch/hppa64/hppa64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.35 2014/04/08 09:34:23 mpi Exp $ */
+/* $OpenBSD: trap.c,v 1.36 2014/04/18 11:51:16 guenther Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -212,6 +212,9 @@ trap(int type, struct trapframe *frame)
ssm(PSL_I, mask);
}
+ if (type & T_USER)
+ refreshcreds(p);
+
switch (type) {
case T_NONEXIST:
case T_NONEXIST | T_USER: