From owner-svn-src-head@FreeBSD.ORG Mon Oct 13 21:04:52 2008 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 B1DA910656A0; Mon, 13 Oct 2008 21:04:52 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A032F8FC18; Mon, 13 Oct 2008 21:04:52 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DL4qAU086382; Mon, 13 Oct 2008 21:04:52 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DL4qxE086381; Mon, 13 Oct 2008 21:04:52 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200810132104.m9DL4qxE086381@svn.freebsd.org> From: Roman Divacky Date: Mon, 13 Oct 2008 21:04:52 +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: r183846 - 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: Mon, 13 Oct 2008 21:04:52 -0000 Author: rdivacky Date: Mon Oct 13 21:04:52 2008 New Revision: 183846 URL: http://svn.freebsd.org/changeset/base/183846 Log: Check the result of copyin and in a case of error return one. This prevents setting wrong priority or (more likely) returning EINVAL. Approved by: kib (mentor) Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Mon Oct 13 21:02:19 2008 (r183845) +++ head/sys/kern/kern_thr.c Mon Oct 13 21:04:52 2008 (r183846) @@ -126,6 +126,8 @@ kern_thr_new(struct thread *td, struct t rtpp = NULL; if (param->rtp != 0) { error = copyin(param->rtp, &rtp, sizeof(struct rtprio)); + if (error) + return (error); rtpp = &rtp; } error = create_thread(td, NULL, param->start_func, param->arg,