Protect the per-process itimerval structs with a mutex. We update these
authorkettenis <kettenis@openbsd.org>
Tue, 28 Apr 2015 20:54:18 +0000 (20:54 +0000)
committerkettenis <kettenis@openbsd.org>
Tue, 28 Apr 2015 20:54:18 +0000 (20:54 +0000)
commit05ffb7cef019f60b14cb1c941cb654f894700e2a
tree33e8c61026116667aecdc96f38a5748b8c4df21b
parentaed4e36e1b78fd49143677f9b77bf45f3b73c8c3
Protect the per-process itimerval structs with a mutex.  We update these
from hardclock() which runs without grabbing the kernel lock.  This means
that two threads could concurrently update the struct which could lead to
corruption of the value which in turn could stop the timer.  It could also
result in getitimer(2) returning a non-normalized value.

With help from guenther@.

ok deraadt@, guenther@
sys/kern/kern_time.c