Skip to content
Snippets Groups Projects
  1. Dec 16, 2015
  2. Dec 08, 2015
  3. Dec 03, 2015
    • Tom Cherry's avatar
      Support fine grain read access control for properties · 949d7cbc
      Tom Cherry authored
      Properties are now broken up from a single /dev/__properties__ file into
      multiple files, one per property label.  This commit provides the
      mechanism to control read access to each of these files and therefore
      sets of properties.
      
      This allows full access for all domains to each of these new property
      files to match the current permissions of /dev/__properties__.  Future
      commits will restrict the access.
      
      Bug: 21852512
      
      Change-Id: Ie9e43968acc7ac3b88e354a0bdfac75b8a710094
      949d7cbc
  4. Nov 03, 2015
    • Jeff Vander Stoep's avatar
      Create attribute for moving perms out of domain · d22987b4
      Jeff Vander Stoep authored
      Motivation: Domain is overly permissive. Start removing permissions
      from domain and assign them to the domain_deprecated attribute.
      Domain_deprecated and domain can initially be assigned to all
      domains. The goal is to not assign domain_deprecated to new domains
      and to start removing domain_deprecated where it is not required or
      reassigning the appropriate permissions to the inheriting domain
      when necessary.
      
      Bug: 25433265
      Change-Id: I8b11cb137df7bdd382629c98d916a73fe276413c
      d22987b4
  5. Sep 22, 2015
  6. Aug 24, 2015
  7. Aug 22, 2015
  8. Aug 03, 2015
  9. Aug 02, 2015
    • Nick Kralevich's avatar
      init.te: delete kernel load policy support · 356df327
      Nick Kralevich authored
      Remove the ability to dynamically update SELinux policy on the
      device.
      
      1) This functionality has never been used, so we have no idea if
      it works or not.
      
      2) If system_server is compromised, this functionality allows a
      complete bypass of the SELinux policy on the device. In particular,
      an attacker can force a regression of the following patch
        * https://android-review.googlesource.com/138510
      see also https://code.google.com/p/android/issues/detail?id=181826
      
      3) Dynamic policy update can be used to bypass neverallow protections
      enforced in CTS, by pushing a policy to the device after certification.
      Such an updated policy could bring the device out of compliance or
      deliberately introduce security weaknesses.
      
      Bug: 22885422
      Bug: 8949824
      Change-Id: Id98b5e09d79254816d920b92003efe8dcbe6cd2e
      356df327
  10. Jul 27, 2015
  11. Jul 14, 2015
    • Nick Kralevich's avatar
      neverallow service_manager / service_manager_type · f2c4e128
      Nick Kralevich authored
      Init never uses / add service manager services. It doesn't make
      sense to allow these rules to init. Adding a rule of this type
      is typically caused by a process inappropriately running in init's
      SELinux domain, and the warning message:
      
        Warning!  Service %s needs a SELinux domain defined; please fix!
      
      is ignored.
      
      In addition, add neverallow rules to domain.te which prevent
      nonsense SELinux service_manager rules from being added.
      
      Change-Id: Id04a50d1826fe451a9ed216aa7ab249d0393cc57
      f2c4e128
  12. Jun 02, 2015
    • Mark Salyzyn's avatar
      logd: logpersistd · 7e0838aa
      Mark Salyzyn authored
      (cherry pick from commit 0d22c6ce)
      
      - Enable logpersistd to write to /data/misc/logd
      - Enable logpersistd to read from pstore to help complete any content
        lost by reboot disruption
      - Enable shell readonly ability logpersistd files in /data/misc/logd
      - Enable logcat -f when placed into logd context to act as a
        logpersistd (nee logcatd) agent, restrict access to run only in
        userdebug or eng
      
      Bug: 19608716
      Change-Id: I3209582bc796a1093c325c90068a48bf268e5ab5
      7e0838aa
    • Mark Salyzyn's avatar
      logd: logpersistd · 0d22c6ce
      Mark Salyzyn authored
      - Enable logpersistd to write to /data/misc/logd
      - Enable logpersistd to read from pstore to help complete any content
        lost by reboot disruption
      - Enable shell readonly ability logpersistd files in /data/misc/logd
      - Enable logcat -f when placed into logd context to act as a
        logpersistd (nee logcatd) agent, restrict access to run only in
        userdebug or eng
      
      Bug: 19608716
      Change-Id: I3209582bc796a1093c325c90068a48bf268e5ab5
      0d22c6ce
  13. May 29, 2015
  14. Apr 29, 2015
  15. Apr 28, 2015
  16. Apr 27, 2015
  17. Apr 25, 2015
  18. Apr 24, 2015
  19. Apr 01, 2015
    • Jeff Sharkey's avatar
      Directory for vold to store private data. · 4423ecdb
      Jeff Sharkey authored
      Creates new directory at /data/misc/vold for storing key material
      on internal storage.  Only vold should have access to this label.
      
      Change-Id: I7f2d1314ad3b2686e29e2037207ad83d2d3bf465
      4423ecdb
  20. Mar 27, 2015
    • Paul Lawrence's avatar
      Adding e4crypt support · 38af1da1
      Paul Lawrence authored
      Add selinux rules to allow file level encryption to work
      
      Change-Id: I1e4bba23e99cf5b2624a7df843688fba6f3c3209
      38af1da1
  21. Mar 13, 2015
    • Paul Lawrence's avatar
      Adding e4crypt support · 8138401d
      Paul Lawrence authored
      Add selinux rules to allow file level encryption to work
      
      Change-Id: I1e4bba23e99cf5b2624a7df843688fba6f3c3209
      8138401d
  22. Mar 05, 2015
    • Sami Tolvanen's avatar
      Allow init to set up dm-verity · 35f537c7
      Sami Tolvanen authored
      Allow init to
      
       1. Access device mapper to set up dm-verity devices
      
          avc:  denied  { write } for  pid=156 comm="init" name="device-mapper" dev="tmpfs" ino=6229 scontext=u:r:init:s0 tcontext=u:object_r:dm_device:s0 tclass=chr_file permissive=0
      
       2. Access the metadata partition to load and store dm-verity state
      
          avc:  denied  { write } for  pid=1 comm="init" name="mmcblk0p25" dev="tmpfs" ino=6408 scontext=u:r:init:s0 tcontext=u:object_r:metadata_block_device:s0 tclass=blk_file permissive=0
      
       3. Read /sys/fs/pstore/console-ramoops to detect restarts triggered
          by dm-verity
      
          avc:  denied  { getattr } for  pid=1 comm="init" path="/sys/fs/pstore/console-ramoops" dev="pstore" ino=9911 scontext=u:r:init:s0 tcontext=u:object_r:pstorefs:s0 tclass=file permissive=0
      
      These can be reproduced using the following steps:
      
       1. Add fs_mgr flag verify to the system partition in fstab
      
       2. Add a device specific init.rc handler for the init action that
          calls the built-in command verity_load_state.
      
      Change-Id: Id8790ae4b204ca66e671eefd3820d649f1d1e7ba
      35f537c7
  23. Feb 28, 2015
  24. Feb 27, 2015
    • Nick Kralevich's avatar
      allow init tmpfs:dir relabelfrom · 543faccc
      Nick Kralevich authored
      When encrypting a device, or when an encrypted device boots,
      a tmpfs is mounted in place of /data, so that a pseudo filesystem
      exists to start system_server and related components. SELinux labels
      need to be applied to that tmpfs /data so the system boots
      properly.
      
      Allow init to relabel a tmpfs /data.
      
      Addresses the following denial:
      
      [    6.294896] type=1400 audit(29413651.850:4): avc:  denied  { relabelfrom } for  pid=1 comm="init" name="/" dev="tmpfs" ino=6360 scontext=u:r:init:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir
      
      Steps to reproduce:
        1) Go into Settings > Security > Encrypt Phone
        2) Encrypt phone
        3) See denial
        4) reboot phone
        5) See denial on boot
      
      Bug: 19050686
      Change-Id: Ie57864fe1079d9164d5cfea44683a97498598e41
      543faccc
  25. Feb 26, 2015
    • Sami Tolvanen's avatar
      Allow init to execute /sbin/slideshow · 9d87c647
      Sami Tolvanen authored
      Add rules to allow /sbin/slideshow to access framebuffer and input
      devices at early stages of boot, and rules to allow init to execute
      the program (from init.rc using exec).
      
      Needed by changes from
        I58c79a7f3ac747eec0d73a10f018d3d8ade9df7d
      
      Change-Id: I1d5018feb7025853f0bf81651f497fef8c3a6ab0
      9d87c647
  26. Feb 25, 2015
    • Nick Kralevich's avatar
      Revert /proc/net related changes · 5cf3994d
      Nick Kralevich authored
      Revert the tightening of /proc/net access. These changes
      are causing a lot of denials, and I want additional time to
      figure out a better solution.
      
      Addresses the following denials (and many more):
      
        avc: denied { read } for comm="SyncAdapterThre" name="stats" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="facebook.katana" name="iface_stat_fmt" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="IntentService[C" name="if_inet6" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="dumpstate" name="iface_stat_all" dev="proc" ino=X scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      This reverts commit 0f0324cc
      and commit 99940d1a
      
      Bug: 9496886
      Bug: 19034637
      Change-Id: I436a6e3638ac9ed49afbee214e752fe2b0112868
      5cf3994d
  27. Feb 23, 2015
  28. Feb 08, 2015
    • Nick Kralevich's avatar
      allow init fs_type:dir search · fcd86911
      Nick Kralevich authored
      We allow chmod/chown of files / directories by init, but don't allow
      init to search into subdirectories. Feels wrong.
      
      Addresses the following denial:
      
        avc:  denied  { search } for  pid=1 comm="init" name="/" dev="pstore" ino=5570 scontext=u:r:init:s0 tcontext=u:object_r:pstorefs:s0 tclass=dir permissive=1
      
      which results from the following init.rc statement:
      
        # pstore/ramoops previous console log
        mount pstore pstore /sys/fs/pstore
        chown system log /sys/fs/pstore/console-ramoops
        chmod 0440 /sys/fs/pstore/console-ramoops
        chown system log /sys/fs/pstore/pmsg-ramoops-0
        chmod 0440 /sys/fs/pstore/pmsg-ramoops-0
      
      Bug: 19050686
      Change-Id: I0528ecb17686891b66262de1f3c229cc68a56830
      fcd86911
  29. Feb 07, 2015
  30. Jan 14, 2015
    • Nick Kralevich's avatar
      remove /proc/net read access from domain.te · 99940d1a
      Nick Kralevich authored
      SELinux domains wanting read access to /proc/net need to
      explicitly declare it.
      
      TODO: fixup the ListeningPortsTest cts test so that it's not
      broken.
      
      Bug: 9496886
      Change-Id: Ia9f1214348ac4051542daa661d35950eb271b2e4
      99940d1a
  31. Jan 05, 2015
    • Nick Kralevich's avatar
      init.te: remove unactionable auditallow statements · 30707a45
      Nick Kralevich authored
      Commit 0d08d472 added two auditallow
      statements. The intented purpose of the auditallow statement was:
      
        auditallow accesses by init to files
        and character devices left in the generic device type so we can monitor
        what is being left there, although it is not necessarily a problem unless
        the file or device should be accessible to others.
      
      As currently written, the auditallow rules aren't actionable. It's not
      a problem by itself for init to access a /dev file or chr_file.
      Rather, we care about when other domains access such files.
      
      Currently, this generates a number of (expected) audit statements on
      boot, which causes unnecessary confusion and makes people believe
      that something is broken.
      
      Remove the unactionable auditallow statements.
      
      Change-Id: Ibfe33976505a7dc3f8d15c9eb203c044a39da426
      30707a45
  32. Dec 24, 2014
    • Nick Kralevich's avatar
      init: allow rootfs symlink removal · 8809341c
      Nick Kralevich authored
      On the Nexus 9, init.rc creates the /vendor -> /system/vendor
      symlink, then a bit later removes the symlink, creates a
      proper directory, and mounts /vendor on the directory.
      
      The current permissive SELinux policy doesn't allow init to
      remove the /vendor symlink, which eventually causes the following
      errors:
      
        avc:  denied  { unlink } for  pid=136 comm="init" name="vendor" dev="rootfs" ino=6454 scontext=u:r:init:s0 tcontext=u:object_r:rootfs:s0 tclass=lnk_file permissive=1
        fs_mgr: Failed to mount an un-encryptable or wiped partition on/dev/block/platform/sdhci-tegra.3/by-name/VNR at /vendor options: (null) error: Too many symbolic links encountered
      
      There was an attempt to reorder some of these operations so
      we didn't have to create / delete the symlink, but it
      doesn't seem to have gone well.
      https://android.googlesource.com/platform/system/core/+/f67d6bd3c0fb41d167c675b9d2b5d377b6f38a74
      
      Change-Id: I4d01661d4228e44e18465fe16ce4a70fe2a83042
      8809341c
  33. Nov 10, 2014
    • Stephen Smalley's avatar
      Allow init to chown/chmod character devices. · 1c16abd3
      Stephen Smalley authored
      
      init.rc files can potentially chown/chmod any character device, so
      allow it for everything except for kmem (prohibited by neverallow).
      While we could whitelist each of the device types, doing so would also
      require device-specific changes for the device-specific types and
      may be difficult to maintain.
      
      Resolves (permissive) denials such as:
      avc:  denied  { read } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1
      
      avc:  denied  { open } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1
      
      avc:  denied  { setattr } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1
      
      avc:  denied  { read } for  pid=1 comm="init" name="smd7" dev="tmpfs" ino=6181 scontext=u:r:init:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file
      
      avc:  denied  { open } for  pid=1 comm="init" name="smd7" dev="tmpfs" ino=6181 scontext=u:r:init:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file
      
      avc:  denied  { read } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file
      
      avc:  denied  { open } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file
      
      avc:  denied  { setattr } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file
      
      Change-Id: If8d14e9e434fab645d43db12cc1bdbfd3fc5d354
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      1c16abd3
Loading