From 2195d075538ce466c030e9d6dcc122b37c492476 Mon Sep 17 00:00:00 2001 From: tedu Date: Mon, 4 Jul 2016 16:12:52 +0000 Subject: [PATCH] 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(-) 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; -- 2.20.1