Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Mar 2018 00:50:40 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330676 - head/sys/kern
Message-ID:  <201803090050.w290oebi098444@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Fri Mar  9 00:50:40 2018
New Revision: 330676
URL: https://svnweb.freebsd.org/changeset/base/330676

Log:
  Copyout a whole int to cpuset_domain's policy pointer.
  
  The previous code only copied 16-bits and corrupted the target int.
  
  Reviewed by:	kib, markj
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14611

Modified:
  head/sys/kern/kern_cpuset.c

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c	Fri Mar  9 00:08:43 2018	(r330675)
+++ head/sys/kern/kern_cpuset.c	Fri Mar  9 00:50:40 2018	(r330676)
@@ -1972,8 +1972,8 @@ kern_cpuset_getdomain(struct thread *td, cpulevel_t le
 	if (error == 0)
 		error = copyout(mask, maskp, domainsetsize);
 	if (error == 0)
-		error = copyout(&outset.ds_policy, policyp,
-		    sizeof(outset.ds_policy));
+		if (suword32(policyp, outset.ds_policy) != 0)
+			error = EFAULT;
 out:
 	free(mask, M_TEMP);
 	return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803090050.w290oebi098444>