svn commit: r183846 - head/sys/kern

Roman Divacky rdivacky at FreeBSD.org
Mon Oct 13 21:04:52 UTC 2008


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,


More information about the svn-src-all mailing list