From 1825d89c3ab07b143659087032099479f5c9353c Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Tue, 31 May 2005 11:32:48 +0000 Subject: 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 --- sys/kern/kern_time.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/kern') 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); -- cgit v1.2.3