Sepolicy: Move dac_override checks to private

In preparation for moving other components to private, so that
private-only components can stay private.

Bug: 125474642
Test: m
Change-Id: Iff1ecabc4f45051d06e062b3338a117c09b39ff9
diff --git a/private/domain.te b/private/domain.te
index 5ca2441..97cccb9 100644
--- a/private/domain.te
+++ b/private/domain.te
@@ -227,3 +227,38 @@
   -zygote
   -otapreopt_slot
 } dalvikcache_data_file:dir no_w_dir_perms;
+
+# Minimize dac_override and dac_read_search.
+# Instead of granting them it is usually better to add the domain to
+# a Unix group or change the permissions of a file.
+define(`dac_override_allowed', `{
+  dnsmasq
+  dumpstate
+  init
+  installd
+  install_recovery
+  userdebug_or_eng(`llkd')
+  lmkd
+  netd
+  perfprofd
+  postinstall_dexopt
+  recovery
+  rss_hwm_reset
+  sdcardd
+  tee
+  ueventd
+  uncrypt
+  vendor_init
+  vold
+  vold_prepare_subdirs
+  zygote
+}')
+neverallow ~dac_override_allowed self:global_capability_class_set dac_override;
+# Since the kernel checks dac_read_search before dac_override, domains that
+# have dac_override should also have dac_read_search to eliminate spurious
+# denials.  Some domains have dac_read_search without having dac_override, so
+# this list should be a superset of the one above.
+neverallow ~{
+  dac_override_allowed
+  traced_probes
+} self:global_capability_class_set dac_read_search;
diff --git a/public/domain.te b/public/domain.te
index 9a66a62..e363c1f 100644
--- a/public/domain.te
+++ b/public/domain.te
@@ -1350,41 +1350,6 @@
   } vendor_file:file { no_w_file_perms no_x_file_perms open };
 ')
 
-# Minimize dac_override and dac_read_search.
-# Instead of granting them it is usually better to add the domain to
-# a Unix group or change the permissions of a file.
-define(`dac_override_allowed', `{
-  dnsmasq
-  dumpstate
-  init
-  installd
-  install_recovery
-  userdebug_or_eng(`llkd')
-  lmkd
-  netd
-  perfprofd
-  postinstall_dexopt
-  recovery
-  rss_hwm_reset
-  sdcardd
-  tee
-  ueventd
-  uncrypt
-  vendor_init
-  vold
-  vold_prepare_subdirs
-  zygote
-}')
-neverallow ~dac_override_allowed self:global_capability_class_set dac_override;
-# Since the kernel checks dac_read_search before dac_override, domains that
-# have dac_override should also have dac_read_search to eliminate spurious
-# denials.  Some domains have dac_read_search without having dac_override, so
-# this list should be a superset of the one above.
-neverallow ~{
-  dac_override_allowed
-  traced_probes
-} self:global_capability_class_set dac_read_search;
-
 # If an already existing file is opened with O_CREAT, the kernel might generate
 # a false report of a create denial. Silence these denials and make sure that
 # inappropriate permissions are not granted.