Author: markj
Date: Mon Jul 13 16:42:30 2020
New Revision: 363160
URL: https://svnweb.freebsd.org/changeset/base/363160

Log:
  MFC r362968:
  Allow accesses of the caller's CPU and domain sets in capability mode.

Modified:
  stable/12/sys/kern/kern_cpuset.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_cpuset.c
==============================================================================
--- stable/12/sys/kern/kern_cpuset.c    Mon Jul 13 16:41:58 2020        
(r363159)
+++ stable/12/sys/kern/kern_cpuset.c    Mon Jul 13 16:42:30 2020        
(r363160)
@@ -1595,7 +1595,9 @@ cpuset_check_capabilities(struct thread *td, cpulevel_
                        return (ECAPMODE);
                if (which != CPU_WHICH_TID && which != CPU_WHICH_PID)
                        return (ECAPMODE);
-               if (id != -1)
+               if (id != -1 &&
+                   !(which == CPU_WHICH_TID && id == td->td_tid) &&
+                   !(which == CPU_WHICH_PID && id == td->td_proc->p_pid))
                        return (ECAPMODE);
        }
        return (0);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to