Skip to content
Snippets Groups Projects
  1. May 29, 2014
    • Stephen Smalley's avatar
      Protect /data/property. · ad0d0fc7
      Stephen Smalley authored
      
      /data/property is only accessible by root and is used by the init
      property service for storing persistent property values.  Create
      a separate type for it and only allow init to write to the directory
      and files within it.  Ensure that we do not allow access to other domains
      in future changes or device-specific policy via a neverallow rule.
      
      Change-Id: Iff556b9606c5651c0f1bba902e30b59bdd6f063a
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      ad0d0fc7
  2. May 28, 2014
  3. May 27, 2014
    • Stephen Smalley's avatar
      Remove setting /proc/self/attr/* from unconfined. · f853715d
      Stephen Smalley authored
      
      Change I6a2fb1279318625a80f3ea8e3f0932bdbe6df676 removed
      these permissions from domain.te and added them to specific domains
      as required.  Remove the permissions from unconfineddomain as well
      so that they are only allowed where explicitly allowed.  The earlier
      change already added the necessary permissions to init, kernel,
      and recovery so we do not need to add them here.
      
      Change-Id: Ifeb5438532a7525e64328e1c54b436e9b6f7fd3b
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      f853715d
  4. May 20, 2014
  5. May 09, 2014
    • Nick Kralevich's avatar
      Protect keystore's files. · cd905ec0
      Nick Kralevich authored
      Only keystore itself should be reading / writing it's files.
      Remove keystore file access from other SELinux domains, including
      unconfined. Add neverallow rules to protect against regressions.
      Allow init limited access to recurse into keystore's directory.
      
      Change-Id: I0bb5de7804f4314997c16fac18507933014bcadf
      cd905ec0
  6. Apr 03, 2014
  7. Mar 10, 2014
    • Stephen Smalley's avatar
      Deduplicate neverallow rules on selinuxfs operations. · 853ffaad
      Stephen Smalley authored
      
      We already have neverallow rules for all domains about
      loading policy, setting enforcing mode, and setting
      checkreqprot, so we can drop redundant ones from netd and appdomain.
      Add neverallow rules to domain.te for setbool and setsecparam
      and exclude them from unconfined to allow fully eliminating
      separate neverallow rules on the :security class from anything
      other than domain.te.
      
      Change-Id: I0122e23ccb2b243f4c5376893e0c894f01f548fc
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      853ffaad
  8. Feb 12, 2014
  9. Feb 11, 2014
  10. Jan 30, 2014
    • Stephen Smalley's avatar
      Remove MAC capabilities from unconfined domains. · 04ee5dfb
      Stephen Smalley authored
      
      Linux defines two capabilities for Mandatory Access Control (MAC)
      security modules, CAP_MAC_OVERRIDE (override MAC access restrictions)
      and CAP_MAC_ADMIN (allow MAC configuration or state changes).
      SELinux predates these capabilities and did not originally use them,
      but later made use of CAP_MAC_ADMIN as a way to control the ability
      to set security context values unknown to the currently loaded
      SELinux policy on files.  That facility is used in Linux for e.g.
      livecd creation where a file security context that is being set
      on a generated filesystem is not known to the build host policy.
      Internally, files with such labels are treated as having the unlabeled
      security context for permission checking purposes until/unless the
      context is later defined through a policy reload.
      
      CAP_MAC_OVERRIDE is never checked by SELinux, so it never needs
      to be allowed.  CAP_MAC_ADMIN is only checked if setting an
      unknown security context value; the only legitimate use I can see
      in Android is the recovery console, where a context may need to be set
      on /system that is not defined in the recovery policy.
      
      Remove these capabilities from unconfined domains, allow
      mac_admin for the recovery domain, and add neverallow rules.
      
      Change-Id: Ief673e12bc3caf695f3fb67cabe63e68f5f58150
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      04ee5dfb
  11. Jan 27, 2014
    • Nick Kralevich's avatar
      Remove transition / dyntransition from unconfined · fed8a2a4
      Nick Kralevich authored
      Require all domain transitions or dyntransitions to be
      explicitly specified in SELinux policy.
      
      healthd: Remove healthd_exec / init_daemon_domain().
      Healthd lives on the rootfs and has no unique file type.
      It should be treated consistent with other similar domains.
      
      Change-Id: Ief3c1167379cfb5383073fa33c9a95710a883b29
      fed8a2a4
  12. Jan 13, 2014
  13. Jan 10, 2014
  14. Jan 08, 2014
  15. Jan 04, 2014
    • Nick Kralevich's avatar
      Don't allow zygote init:binder call · a730e50b
      Nick Kralevich authored
      init can't handle binder calls. It's always incorrect
      to allow init:binder call, and represents a binder call
      to a service without an SELinux domain. Adding this
      allow rule was a mistake; the dumpstate SELinux domain didn't
      exist at the time this rule was written, and dumpstate was
      running under init's domain.
      
      Add a neverallow rule to prevent the reintroduction of
      this bug.
      
      Change-Id: I78d35e675fd142d880f15329471778c18972bf50
      a730e50b
  16. Dec 09, 2013
    • Stephen Smalley's avatar
      Restrict mapping low memory. · e6a7b37d
      Stephen Smalley authored
      
      Label /proc/sys/vm/mmap_min_addr with proc_security to prevent
      writing it by any domain other than init.  Also remove memprotect
      mmap_zero permission from unconfineddomain so that it cannot pass
      the SELinux check over mapping low memory.
      
      Change-Id: Idc189feeb325a4aea26c93396fd0fa7225e79586
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      e6a7b37d
    • Stephen Smalley's avatar
      Restrict ptrace access by debuggerd and unconfineddomain. · 95e0842e
      Stephen Smalley authored
      
      Remove init, ueventd, watchdogd, healthd and adbd from the set of
      domains traceable by debuggerd.  bionic/linker/debugger.cpp sets up
      handlers for all dynamically linked programs in Android but this
      should not apply for statically linked programs.
      
      Exclude ptrace access from unconfineddomain.
      
      Prohibit ptrace access to init via neverallow.
      
      Change-Id: I70d742233fbe40cb4d1772a4e6cd9f8f767f2c3a
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      95e0842e
  17. Dec 06, 2013
    • Stephen Smalley's avatar
      Restrict the ability to set usermodehelpers and proc security settings. · 7adb999e
      Stephen Smalley authored
      
      Limit the ability to write to the files that configure kernel
      usermodehelpers and security-sensitive proc settings to the init domain.
      Permissive domains can also continue to set these values.
      
      The current list is not exhaustive, just an initial set.
      Not all of these files will exist on all kernels/devices.
      Controlling access to certain kernel usermodehelpers, e.g. cgroup
      release_agent, will require kernel changes to support and cannot be
      addressed here.
      
      Expected output on e.g. flo after the change:
      ls -Z /sys/kernel/uevent_helper /proc/sys/fs/suid_dumpable /proc/sys/kernel/core_pattern /proc/sys/kernel/dmesg_restrict /proc/sys/kernel/hotplug /proc/sys/kernel/kptr_restrict /proc/sys/kernel/poweroff_cmd /proc/sys/kernel/randomize_va_space /proc/sys/kernel/usermodehelper
      -rw-r--r-- root     root              u:object_r:usermodehelper:s0 uevent_helper
      -rw-r--r-- root     root              u:object_r:proc_security:s0 suid_dumpable
      -rw-r--r-- root     root              u:object_r:usermodehelper:s0 core_pattern
      -rw-r--r-- root     root              u:object_r:proc_security:s0 dmesg_restrict
      -rw-r--r-- root     root              u:object_r:usermodehelper:s0 hotplug
      -rw-r--r-- root     root              u:object_r:proc_security:s0 kptr_restrict
      -rw-r--r-- root     root              u:object_r:usermodehelper:s0 poweroff_cmd
      -rw-r--r-- root     root              u:object_r:proc_security:s0 randomize_va_space
      -rw------- root     root              u:object_r:usermodehelper:s0 bset
      -rw------- root     root              u:object_r:usermodehelper:s0 inheritable
      
      Change-Id: I3f24b4bb90f0916ead863be6afd66d15ac5e8de0
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      7adb999e
  18. Dec 02, 2013
  19. Nov 08, 2013
  20. Oct 21, 2013
  21. Jul 16, 2013
  22. Jul 11, 2013
    • Nick Kralevich's avatar
      domain.te: Add backwards compatibility for unlabeled files · 0c9708b2
      Nick Kralevich authored
      For unlabeled files, revert to DAC rules. This is for backwards
      compatibility, as files created before SELinux was in place may
      not be properly labeled.
      
      Over time, the number of unlabeled files will decrease, and we can
      (hopefully) remove this rule in the future.
      
      To prevent inadvertantly introducing the "relabelto" permission, add
      a neverallow domain, and add apps which have a legitimate need to
      relabel to this domain.
      
      Bug: 9777552
      Change-Id: I71b0ff8abd4925432062007c45b5be85f6f70a88
      0c9708b2
  23. May 22, 2013
  24. May 20, 2013
    • repo sync's avatar
      Make all domains unconfined. · 77d4731e
      repo sync authored
      This prevents denials from being generated by the base policy.
      Over time, these rules will be incrementally tightened to improve
      security.
      
      Change-Id: I4be1c987a5d69ac784a56d42fc2c9063c402de11
      77d4731e
  25. Mar 21, 2013
  26. Mar 19, 2013
    • Stephen Smalley's avatar
      Update binder-related policy. · 9ce99e39
      Stephen Smalley authored
      
      The binder_transfer_binder hook was changed in the kernel, obsoleting
      the receive permission and changing the target of the transfer permission.
      Update the binder-related policy to match the revised permission checking.
      
      Change-Id: I1ed0dadfde2efa93296e967eb44ca1314cf28586
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      9ce99e39
  27. Apr 04, 2012
    • Stephen Smalley's avatar
      Add policy for property service. · 124720a6
      Stephen Smalley authored
      New property_contexts file for property selabel backend.
      New property.te file with property type declarations.
      New property_service security class and set permission.
      Allow rules for setting properties.
      124720a6
  28. Jan 04, 2012
Loading