summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2005-05-31 11:32:48 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2005-05-31 11:32:48 +0000
commit1825d89c3ab07b143659087032099479f5c9353c (patch)
tree9039b729b9c4ceea28bc4b4c2f5422b72063eed2 /sys/kern
parentd3d99eec567bb7cc282077f5817ca1a1a1150958 (diff)
Protect p_timer with splclock. It can be fiddled with in hardclock (but
only for curproc, that's why no SCHED_LOCK or similar is necessary). miod@ "appears to be harmless" markus@ ok
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_time.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 237b20a2f09..8fa57ea24ed 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.47 2005/05/29 03:20:41 deraadt Exp $ */
+/* $OpenBSD: kern_time.c,v 1.48 2005/05/31 11:32:47 art Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -560,8 +560,12 @@ sys_setitimer(p, v, retval)
}
p->p_realtimer = aitv;
} else {
+ int s;
+
itimerround(&aitv.it_interval);
+ s = splclock();
p->p_stats->p_timer[SCARG(uap, which)] = aitv;
+ splx(s);
}
return (0);