From owner-svn-src-head@FreeBSD.ORG Sat Dec 3 12:35:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F79B106564A; Sat, 3 Dec 2011 12:35:13 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F6EC8FC16; Sat, 3 Dec 2011 12:35:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3CZDvG039508; Sat, 3 Dec 2011 12:35:13 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3CZDGv039506; Sat, 3 Dec 2011 12:35:13 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201112031235.pB3CZDGv039506@svn.freebsd.org> From: Peter Holm Date: Sat, 3 Dec 2011 12:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228221 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 12:35:13 -0000 Author: pho Date: Sat Dec 3 12:35:13 2011 New Revision: 228221 URL: http://svn.freebsd.org/changeset/base/228221 Log: Use umtx_copyin_timeout() to copy and check timeout parameter. In collaboration with: kib MFC after: 1 week Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sat Dec 3 12:33:17 2011 (r228220) +++ head/sys/kern/kern_thr.c Sat Dec 3 12:35:13 2011 (r228221) @@ -450,8 +450,7 @@ sys_thr_suspend(struct thread *td, struc tsp = NULL; if (uap->timeout != NULL) { - error = copyin((const void *)uap->timeout, (void *)&ts, - sizeof(struct timespec)); + error = umtx_copyin_timeout(uap->timeout, &ts); if (error != 0) return (error); tsp = &ts; @@ -474,9 +473,6 @@ kern_thr_suspend(struct thread *td, stru } if (tsp != NULL) { - if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 || - tsp->tv_nsec > 1000000000) - return (EINVAL); if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) error = EWOULDBLOCK; else {