Date: Mon, 13 Oct 2008 21:04:52 +0000 (UTC) From: Roman Divacky <rdivacky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r183846 - head/sys/kern Message-ID: <200810132104.m9DL4qxE086381@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810132104.m9DL4qxE086381>