From c9438304f1897b119cad48232cdf0e4b1506f480 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 4 Jul 2016 16:12:53 +0000 Subject: switch calculuated thrsleep timeout to unsigned to prevent overflow into negative values, which later causes a panic. reported by Tim Newsham at NCC. ok guenther --- sys/kern/kern_synch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 83e7eba33bf..d72e0f5f3c3 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.131 2016/03/29 02:43:47 jsg Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.132 2016/07/04 16:12:52 tedu Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -491,7 +491,7 @@ thrsleep(struct proc *p, struct sys___thrsleep_args *v) long ident = (long)SCARG(uap, ident); struct timespec *tsp = (struct timespec *)SCARG(uap, tp); void *lock = SCARG(uap, lock); - long long to_ticks = 0; + unsigned long long to_ticks = 0; int abort, error; clockid_t clock_id = SCARG(uap, clock_id) & 0x7; int lockflags = SCARG(uap, clock_id) & 0x8; -- cgit v1.2.3