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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to