Skip to content
Snippets Groups Projects
  1. Feb 04, 2015
    • Christopher Ferris's avatar
      Dumpstate runs the same from shell as service. · 5ec38c49
      Christopher Ferris authored
      Without this change, any selinux warning you might get when running
      dumpstate from init do not show up when running from the shell
      as root. This change makes them run the same.
      
      Change-Id: I6b74e0f6f48f47952a2dbe7728b1853008f60dbb
      5ec38c49
  2. Jan 29, 2015
    • Nick Kralevich's avatar
      appdomain: relax netlink_socket neverallow rule · d31936f8
      Nick Kralevich authored
      Relax the neverallow netlink restrictions for app domains.
      In particular, some non-AOSP app domains may use netlink sockets
      to communicate with a kernel driver.
      
      Continue to neverallow generic netlink sockets for untrusted_app.
      The intention here is that only app domains which explicitly need
      this functionality should be able to request it.
      
      This change does not add or remove any SELinux rules. Rather, it
      just changes SELinux compile time assertions, as well as allowing
      this behavior in CTS.
      
      Modify other neverallow rules to use "domain" instead of "self".
      Apps shouldn't be able to handle netlink sockets, even those
      created in other SELinux domains.
      
      Change-Id: I40de0ae28134ce71e808e5ef4a39779b71897571
      d31936f8
  3. Jan 21, 2015
  4. 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
  5. Dec 02, 2014
  6. Nov 12, 2014
  7. Oct 17, 2014
    • Nick Kralevich's avatar
      Revert "Do not allow isolated_app to directly open app data files." · 44cb98a7
      Nick Kralevich authored
      This is causing the version of Chrome in Android's tree to crash. The
      version of Chrome in Android's tree does not have the following patch:
      https://codereview.chromium.org/630123003
      
      Until Chrome updates the version in Android's tree, we need to revert.
      
      Works around the following denials:
      
      audit(0.0:19): avc: denied { search } for name="com.android.chrome" dev="mmcblk0p28" ino=1474658 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir
      audit(0.0:20): avc: denied { getattr } for path="/data/data/com.android.chrome" dev="mmcblk0p28" ino=1474658 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir
      audit(0.0:21): avc: denied { getattr } for path="/data/data/com.android.chrome" dev="mmcblk0p28" ino=1474658 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir
      
      This reverts commit 669a9773.
      
      Bug: 18006219
      Change-Id: Id44137ec6a0dfe4a597b34ab3dad9e3feecc2a5e
      44cb98a7
  8. Oct 16, 2014
    • Stephen Smalley's avatar
      Exclude isolated_app from ptrace self. · e9623d8f
      Stephen Smalley authored
      
      Change-Id: I29136a805d2329806afc9d5d81af934a1803d8e0
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      e9623d8f
    • Nick Kralevich's avatar
      Fix compile time / CTS gps_data_files neverallow assertion · 38936af0
      Nick Kralevich authored
      Currently, zygote spawned apps are prohibited from modifying GPS
      data files. If someone tries to allow GPS access to any app domain,
      it generates a compile time / CTS exception.
      
      Relax the rules slightly for system_app. These apps run with UID=system,
      and shouldn't be banned from handling gps data files.
      
      This change doesn't add or remove any SELinux rules. Rather, it just
      relaxes a compile time assertion, allow partners to create SELinux
      rules allowing the access if they desire.
      
      (cherrypick from commit 480374e4)
      
      Bug: 18021422
      Change-Id: Iad0c6a3627efe129246e2c817f6f71d2735eba93
      38936af0
    • Nick Kralevich's avatar
      Fix compile time / CTS gps_data_files neverallow assertion · 480374e4
      Nick Kralevich authored
      Currently, zygote spawned apps are prohibited from modifying GPS
      data files. If someone tries to allow GPS access to any app domain,
      it generates a compile time / CTS exception.
      
      Relax the rules slightly for system_app. These apps run with UID=system,
      and shouldn't be banned from handling gps data files.
      
      This change doesn't add or remove any SELinux rules. Rather, it just
      relaxes a compile time assertion, allow partners to create SELinux
      rules allowing the access if they desire.
      
      Bug: 18021422
      Change-Id: Iad0c6a3627efe129246e2c817f6f71d2735eba93
      480374e4
  9. Oct 15, 2014
    • Robin Lee's avatar
      Pull keychain-data policy out of system-data · 51bfecf4
      Robin Lee authored
      Migrators should be allowed to write to /data/misc/keychain in order
      to remove it. Similarly /data/misc/user should be writable by system
      apps.
      
      TODO: Revoke zygote's rights to read from /data/misc/keychain on
      behalf of some preloaded security classes.
      
      Bug: 17811821
      Change-Id: I9e9c6883cff1dca3755732225404909c16a0e547
      51bfecf4
  10. Oct 06, 2014
  11. Sep 26, 2014
  12. Sep 25, 2014
    • Martijn Coenen's avatar
      Allow NFC to read/write nfc. system properties. · 05383ebf
      Martijn Coenen authored
      Bug: 17298769
      Change-Id: I1994ff9f9da9b13249099f6c9bcec88dcdc2bb97
      05383ebf
    • Nick Kralevich's avatar
      allow apps to read the contents of mounted OBBs · 826bc5d6
      Nick Kralevich authored
      Apps should be able to read the contents of mounted OBBs.
      
      Steps to reproduce:
      
        1) Install com.namcobandaigames.soulcaliburgp (SoulCalibur)
        2) Attempt to run the app.
      
      Expected:
        App runs successfully.
      
      Actual:
        App crashes. See denials below.
      
      This can also be reproduced by running the newly introduced CTS
      test in I2018b63b0236ce6b5aee4094e40473315b1948c3
      
      Addresses the following denials:
      
        avc: denied { read } for pid=4133 comm="roidJUnitRunner" name="test1.txt" dev="loop0" ino=23 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:vfat:s0 tclass=file
        avc: denied { open } for pid=4133 comm="roidJUnitRunner" name="test1.txt" dev="loop0" ino=23 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:vfat:s0 tclass=file
        avc: denied { getattr } for pid=4133 comm="roidJUnitRunner" path="/mnt/obb/f73da56689d166b5389d49ad31ecbadb/test1.txt" dev="loop0" ino=23 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:vfat:s0 tclass=file
        avc: denied { search } for name="/" dev="loop0" ino=1 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:vfat:s0 tclass=dir permissive=0
      
      (cherrypick of commit 62083414)
      
      Bug: 17633509
      Change-Id: I49b722b24c1c7d9ab084ebee7c1e349d8d660ffa
      826bc5d6
  13. Sep 24, 2014
    • Nick Kralevich's avatar
      allow apps to read the contents of mounted OBBs · 62083414
      Nick Kralevich authored
      Apps should be able to read the contents of mounted OBBs.
      
      Steps to reproduce:
      
        1) Install com.namcobandaigames.soulcaliburgp (SoulCalibur)
        2) Attempt to run the app.
      
      Expected:
        App runs successfully.
      
      Actual:
        App crashes. See denials below.
      
      This can also be reproduced by running the newly introduced CTS
      test in I2018b63b0236ce6b5aee4094e40473315b1948c3
      
      Addresses the following denials:
      
        avc: denied { read } for pid=4133 comm="roidJUnitRunner" name="test1.txt" dev="loop0" ino=23 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:vfat:s0 tclass=file
        avc: denied { open } for pid=4133 comm="roidJUnitRunner" name="test1.txt" dev="loop0" ino=23 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:vfat:s0 tclass=file
        avc: denied { getattr } for pid=4133 comm="roidJUnitRunner" path="/mnt/obb/f73da56689d166b5389d49ad31ecbadb/test1.txt" dev="loop0" ino=23 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:vfat:s0 tclass=file
        avc: denied { search } for name="/" dev="loop0" ino=1 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:vfat:s0 tclass=dir permissive=0
      
      Bug: 17633509
      Change-Id: I49b722b24c1c7d9ab084ebee7c1e349d8d660ffa
      62083414
  14. Sep 23, 2014
    • Nick Kralevich's avatar
      relax appdomain efs_file neverallow rules [DO NOT MERGE] · a8b651bf
      Nick Kralevich authored
      During factory provisioning, some manufacturers may need to pull files
      from /factory (label efs_file and bluetooth_efs_file) to collect
      device specific identifiers such as the mac address, using commands
      similar to the following:
      
        adb shell cat /factory/ssn
        adb shell cat /factory/bt/bd_addr.conf
        adb shell cat /factory/wifi/mac.txt
        adb shell cat /factory/60isn
      
      read-only access to these files is currently disallowed by a
      neverallow rule. Relax the rules to allow read-only access to the
      shell user if desired.
      
      No new SELinux rules are added or deleted by this change. This is
      only a relaxation in what's allowed for vendor specific policy.
      
      Bug: 17600278
      
      (cherry picked from commit 200a9f0e)
      
      Change-Id: I2e277b1068a35cc06e0973df994ec3a49f2c26e7
      a8b651bf
  15. Sep 22, 2014
    • Nick Kralevich's avatar
      relax appdomain efs_file neverallow rules · 200a9f0e
      Nick Kralevich authored
      During factory provisioning, some manufacturers may need to pull files
      from /factory (label efs_file and bluetooth_efs_file) to collect
      device specific identifiers such as the mac address, using commands
      similar to the following:
      
        adb shell cat /factory/ssn
        adb shell cat /factory/bt/bd_addr.conf
        adb shell cat /factory/wifi/mac.txt
        adb shell cat /factory/60isn
      
      read-only access to these files is currently disallowed by a
      neverallow rule. Relax the rules to allow read-only access to the
      shell user if desired.
      
      No new SELinux rules are added or deleted by this change. This is
      only a relaxation in what's allowed for vendor specific policy.
      
      Bug: 17600278
      Change-Id: I13f33f996c077918dce70a5cff31a87eac436678
      200a9f0e
    • Nick Kralevich's avatar
      relax neverallow rules on NETLINK_KOBJECT_UEVENT sockets · 36fb1f1b
      Nick Kralevich authored
      Netlink uevent sockets are used by the kernel to inform userspace
      when certain events occur, for example, when new hardware is added
      or removed. This allows userspace to take some action based on those
      messages.
      
      Relax the neverallow rule for NETLINK_KOBJECT_UEVENT sockets.
      Certain device specific app domains, such as system_app, may have a
      need to receive messages from this socket type.
      
      Continue to neverallow NETLINK_KOBJECT_UEVENT sockets for untrusted_app.
      These sockets have been the source of rooting attacks in Android
      in the past, and it doesn't make sense to expose this to untrusted_apps.
      
      No new SELinux rules are introduced by this change. This is an
      adjustment of compile time assertions only.
      
      Bug: 17525863
      
      (cherry picked from commit 642b8042)
      
      Change-Id: I35f3dc8b1ead9f427645a13fb202e760d1e68e64
      36fb1f1b
    • Nick Kralevich's avatar
      relax neverallow rules on NETLINK_KOBJECT_UEVENT sockets · 642b8042
      Nick Kralevich authored
      Netlink uevent sockets are used by the kernel to inform userspace
      when certain events occur, for example, when new hardware is added
      or removed. This allows userspace to take some action based on those
      messages.
      
      Relax the neverallow rule for NETLINK_KOBJECT_UEVENT sockets.
      Certain device specific app domains, such as system_app, may have a
      need to receive messages from this socket type.
      
      Continue to neverallow NETLINK_KOBJECT_UEVENT sockets for untrusted_app.
      These sockets have been the source of rooting attacks in Android
      in the past, and it doesn't make sense to expose this to untrusted_apps.
      
      No new SELinux rules are introduced by this change. This is an
      adjustment of compile time assertions only.
      
      Bug: 17525863
      Change-Id: I3e538dc8096dc23b9678bcd20e3c1e742c21c967
      642b8042
  16. Sep 11, 2014
  17. Sep 09, 2014
  18. Sep 01, 2014
    • Mark Salyzyn's avatar
      logd: permit app access to clear logs · bcdff890
      Mark Salyzyn authored
      I/auditd(19949): type=1400 audit(0.0:71): avc:  denied  { write } for  comm="logcat" name="logd" dev="tmpfs" ino=5924 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:logd_socket:s0 tclass=sock_file
      
      (cherry picked from 60f0be84)
      
      Bug: 17323719
      Change-Id: Id8399195196ffad884eef98030d544c68ed0596f
      bcdff890
    • Mark Salyzyn's avatar
      logd: permit app access to clear logs · 60f0be84
      Mark Salyzyn authored
      I/auditd(19949): type=1400 audit(0.0:71): avc:  denied  { write } for  comm="logcat" name="logd" dev="tmpfs" ino=5924 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:logd_socket:s0 tclass=sock_file
      
      Bug: 17323719
      Change-Id: Id8399195196ffad884eef98030d544c68ed0596f
      60f0be84
  19. Aug 27, 2014
    • dcashman's avatar
      Add permissive domains check to sepolicy-analyze. · c30dd63f
      dcashman authored
      Also enable global reading of kernel policy file. Motivation for this is to
      allow read access to the kernel version of the binary selinux policy.
      
      Bug: 17288791
      
      Change-Id: I1eefb457cea1164a8aa9eeb7683b3d99ee56ca99
      c30dd63f
    • dcashman's avatar
      Allow appdomain read perms on apk_data_files. · 711895db
      dcashman authored
      Address:
      type=1400 audit(0.0:103): avc: denied { read } for name="arm" dev="mmcblk0p28" ino=195471 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir
      
      Bug: 16204150
      Change-Id: I8bf0172b26b780c110c0d95c691785143acd7dd2
      711895db
  20. Aug 25, 2014
    • Nick Kralevich's avatar
      remove appdomain's ability to examine all of /proc · 0d3f7ddc
      Nick Kralevich authored
      Remove the CTS specific rule which allows appdomain processes
      to view /proc entries for the rest of the system. With this change,
      an SELinux domain will only be able to view it's own /proc
      entries, e.g. untrusted_app can only view /proc entries for other
      untrusted_app, system_app can only view /proc entries for other
      system_apps, etc.
      
      /proc contains sensitive information, and we want to avoid
      leaking this information between app security domains.
      
      Bug: 17254920
      Change-Id: I59da37dde00107a5ab123df3b79a84afa855339f
      0d3f7ddc
  21. Aug 22, 2014
    • dcashman's avatar
      Add permissive domains check to sepolicy-analyze. · 9793ea7a
      dcashman authored
      Also enable global reading of kernel policy file. Motivation for this is to
      allow read access to the kernel version of the binary selinux policy.
      
      Change-Id: I1eefb457cea1164a8aa9eeb7683b3d99ee56ca99
      9793ea7a
  22. Jul 30, 2014
    • Stephen Smalley's avatar
      Fix neverallow rules to eliminate CTS SELinuxTest warnings. · d990a78f
      Stephen Smalley authored
      
      Fix two neverallow rules that yield Invalid SELinux context
      warnings from the CTS SELinuxTest.
      
      For transitions from app domains, we only need to check
      { domain -appdomain } (i.e. domains other than app domains),
      not ~appdomain (i.e. all types other than app domains).  Otherwise
      SELinuxTest tries to generate contexts with the r role and
      non-domain types for testing since the target class is process,
      and such contexts are invalid.
      
      For keeping file_type and fs_type exclusive, we only need to
      check associate permission, not all filesystem permissions, as
      only associate takes a file type as the source context.  Otherwise
      SELinuxTest tries to generate contexts with the r role and
      non-domain types for testing filesystem permissions other than
      associate, since the source of such checks is normally a process
      context.
      
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      
      (cherry picked from commit 21ada26d)
      
      Change-Id: I3346584da9b89f352864dcc30dde06d6bf42e98e
      d990a78f
  23. Jul 29, 2014
    • Stephen Smalley's avatar
      Fix neverallow rules to eliminate CTS SELinuxTest warnings. · 21ada26d
      Stephen Smalley authored
      
      Fix two neverallow rules that yield Invalid SELinux context
      warnings from the CTS SELinuxTest.
      
      For transitions from app domains, we only need to check
      { domain -appdomain } (i.e. domains other than app domains),
      not ~appdomain (i.e. all types other than app domains).  Otherwise
      SELinuxTest tries to generate contexts with the r role and
      non-domain types for testing since the target class is process,
      and such contexts are invalid.
      
      For keeping file_type and fs_type exclusive, we only need to
      check associate permission, not all filesystem permissions, as
      only associate takes a file type as the source context.  Otherwise
      SELinuxTest tries to generate contexts with the r role and
      non-domain types for testing filesystem permissions other than
      associate, since the source of such checks is normally a process
      context.
      
      Change-Id: I6c2f63f4786d75294a6938613ba14b64212fc802
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      21ada26d
  24. Jul 15, 2014
  25. Jul 10, 2014
    • Nick Kralevich's avatar
      Put dex2oat in it's own sandbox · 75d63fcf
      Nick Kralevich authored
      Currently, dex2oat runs in the installd sandbox, and has
      all the SELinux capabilities that installd does. That's too
      excessive.
      
      dex2oat handles untrusted user data, so we want to put it in
      it's own tighter sandbox.
      
      Bug: 15358102
      Change-Id: I08083b84b9769e24d6dad6dbd12401987cb006be
      75d63fcf
  26. Jul 08, 2014
    • Stephen Smalley's avatar
      Rename sdcard_internal/external types. · 374b2a19
      Stephen Smalley authored
      
      Rename sdcard_internal/external types to fuse and vfat
      respectively to make it clear that they are assigned to any
      fuse or vfat filesystem by default (absent a context= mount option)
      and do not necessarily represent the SDcard.
      
      The sdcard_type attribute is still assigned to both types and
      can still be used in allow rules to permit access to either the
      internal or external SDcard.
      
      Define type aliases for the old names to preserve compatibility
      on policy reload and for device-specific policies that may not yet
      be updated.
      
      Change-Id: I8d91a8c4c1342b94e4f1bb62ca7ffd2ca4b06ba1
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      374b2a19
  27. Jul 04, 2014
    • Nick Kralevich's avatar
      Remove -unconfineddomain from neverallow rules · be660697
      Nick Kralevich authored
      Many of the neverallow rules have -unconfineddomain. This was
      intended to allow us to support permissive_or_unconfined(), and
      ensure that all domains were enforcing at least a minimal set of
      rules.
      
      Now that all the app domains are in enforcing / confined, there's
      no need to allow for these exceptions. Remove them.
      
      Change-Id: Ieb29872dad415269f7fc2fe5be5a3d536d292d4f
      be660697
  28. Jul 01, 2014
  29. Jun 26, 2014
    • Riley Spahn's avatar
      Adding policies for KeyStore MAC. · 1196d2a5
      Riley Spahn authored
      Add keystore_key class and an action for each action supported
      by keystore. Add policies that replicate the access control that
      already exists in keystore. Add auditallow rules for actions
      not known to be used frequently. Add macro for those domains
      wishing to access keystore.
      
      Change-Id: Iddd8672b9e9b72b45ee208e6eda608cc9dc61edc
      1196d2a5
Loading