Skip to content
Snippets Groups Projects
  1. Jun 05, 2015
    • Jeff Vander Stoep's avatar
      restrict app access to socket ioctls · de9b5301
      Jeff Vander Stoep authored
      Create a macro of unprivileged ioctls including
      - All common socket ioctls except MAC address
      - All wireless extensions ioctls except get/set ESSID
      - Some commonly used tty ioctls
      
      Bug: 21657002
      Change-Id: Ib08be9cb70d08c1fa2c8bddbae519e7c2df5293c
      de9b5301
  2. May 19, 2015
    • Jeff Sharkey's avatar
      Allow MediaProvider to traverse /mnt/media_rw. · 6e1f405c
      Jeff Sharkey authored
      As an optimization, platform components like MediaProvider may choose
      to shortcut past the FUSE daemon and return open file descriptors
      directly pointing at the underlying storage device.
      
      Now that we have a specific label for /mnt/media_rw, we need to grant
      search access to untrusted apps like MediaProvider.  The actual
      access control is still managed by POSIX permissions on that
      directory.
      
      avc: denied { search } for name="media_rw" dev="tmpfs" ino=4150 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:mnt_media_rw_file:s0 tclass=dir permissive=0
      
      Bug: 21017105
      Change-Id: I6d51939668b39b43b91b1f0c24c98bc2205bf511
      6e1f405c
  3. May 15, 2015
  4. May 13, 2015
  5. May 06, 2015
  6. May 05, 2015
  7. Apr 29, 2015
    • Alex Klyubin's avatar
      Expand access to gatekeeperd. · ab5cf668
      Alex Klyubin authored
      This enables access to gatekeeperd for anybody who invokes Android
      framework APIs. This is necessary because the AndroidKeyStore
      abstraction offered by the framework API occasionally communicates
      with gatekeeperd from the calling process.
      
      (cherry picked from commit effcac7d)
      
      Bug: 20526234
      Change-Id: I450242cd085259b3f82f36f359ee65ff27bebd13
      ab5cf668
  8. Apr 18, 2015
  9. Apr 09, 2015
    • dcashman's avatar
      Enforce more specific service access. · bd7f5803
      dcashman authored
      Move the remaining services from tmp_system_server_service to appropriate
      attributes and remove tmp_system_server and associated logging:
      
      registry
      restrictions
      rttmanager
      scheduling_policy
      search
      sensorservice
      serial
      servicediscovery
      statusbar
      task
      textservices
      telecom_service
      trust_service
      uimode
      updatelock
      usagestats
      usb
      user
      vibrator
      voiceinteraction
      wallpaper
      webviewupdate
      wifip2p
      wifi
      window
      
      Bug: 18106000
      Change-Id: Ia0a6d47099d82c53ba403af394537db6fbc71ca0
      bd7f5803
  10. Apr 08, 2015
    • dcashman's avatar
      Enforce more specific service access. · 03a6f64f
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      network_management
      network_score
      notification
      package
      permission
      persistent
      power
      print
      processinfo
      procstats
      
      Bug: 18106000
      Change-Id: I9dfb41fa41cde72ef0059668410a2e9eb1af491c
      03a6f64f
  11. Apr 07, 2015
    • dcashman's avatar
      Enforce more specific service access. · 91b7c67d
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      jobscheduler
      launcherapps
      location
      lock_settings
      media_projection
      media_router
      media_session
      mount
      netpolicy
      netstats
      
      Bug: 18106000
      Change-Id: Ia82d475ec41f658851f945173c968f4abf57e7e1
      91b7c67d
    • dcashman's avatar
      Enforce more specific service access. · 3cc6fc5f
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      diskstats
      display
      dreams
      dropbox
      ethernet
      fingerprint
      graphicstats
      hardware
      hdmi_control
      input_method
      input_service
      
      Bug: 18106000
      Change-Id: Iadd8aab9e78d9d39fb00cf0b5a95fa1927d02095
      3cc6fc5f
    • dcashman's avatar
      Enforce more specific service access. · d4c78f4b
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      battery
      bluetooth_manager
      clipboard
      commontime_management
      connectivity
      content
      country_detector
      device_policy
      deviceidle
      
      Bug: 18106000
      Change-Id: I0d0f2a075c0509a783631d88ba453ac13399cdf2
      d4c78f4b
  12. Apr 06, 2015
    • dcashman's avatar
      Assign app_api_service attribute to services. · 4cdea7fc
      dcashman authored
      Assign the alarm, appwidget, assetatlas, audio, backup and batterystats services
      the appropriate service access levels and move into enforcing.
      
      Bug: 18106000
      Change-Id: If3210bb25f3076edfdb6eec36ef6521ace1bd8d7
      4cdea7fc
  13. Apr 03, 2015
    • dcashman's avatar
      Assign app_api_service attribute to services. · b075338d
      dcashman authored
      Move accessibility, account, appops and activity services into enforcing with
      app_api_service level of access, with additional grants to mediaserver and
      isolated app.
      
      Bug: 18106000
      Change-Id: I1d5a79b9223026415f1690e8e9325ec4c270e3dd
      b075338d
    • dcashman's avatar
      Add system_api_service and app_api_service attributes. · d12993f0
      dcashman authored
      System services differ in designed access level.  Add attributes reflecting this
      distinction and label services appropriately.  Begin moving access to the newly
      labeled services by removing them from tmp_system_server_service into the newly
      made system_server_service attribute.  Reflect the move of system_server_service
      from a type to an attribute by removing access to system_server_service where
      appropriate.
      
      Change-Id: I7fd06823328daaea6d6f96e4d6bd00332382230b
      d12993f0
  14. Apr 01, 2015
    • dcashman's avatar
      Record observed service accesses. · 8af4e9cb
      dcashman authored
      Get ready to switch system_server service lookups into enforcing.
      
      Bug: 18106000
      Change-Id: Iefd4b2eee6cdd680f5ab423d15cc72a2a30e27cf
      8af4e9cb
  15. Mar 27, 2015
    • John Reck's avatar
      Add graphicsstats service · e8064afb
      John Reck authored
      Change-Id: I156b139b57f46c695ece35b7b26a3087d87b25df
      e8064afb
    • Nick Kralevich's avatar
      Don't grant hard link capabilities by default. · 85ce2c70
      Nick Kralevich authored
      Modify create_file_perms and create_dir_perms so it doesn't have
      the "link" permission. This permission controls whether hard links
      are allowed or not on the given file label. Hard links are a common
      source of security bugs, and isn't something we want to support by
      default.
      
      Get rid of link_file_perms and move the necessary permissions into
      create_file_perms and create_dir_perms. Nobody is using this macro,
      so it's pointless to keep it around.
      
      Get rid of unlink on directories. It returns EISDIR if you attempt to
      do it, independent of SELinux permissions.
      
      SELinux domains which have a need for hard linking for a particular
      file type can add it back to their permission set on an as-needed basis.
      
      Add a compile time assertion (neverallow rule) for untrusted_app.
      It's particularly dangerous for untrusted_app to ever have hard
      link capabilities, and the neverallow rule will prevent regressions.
      
      Bug: 19953790
      Change-Id: I5e9493d2bf5da460d074f0bc5ad8ba7c14dec6e0
      85ce2c70
  16. Mar 13, 2015
    • Stephen Smalley's avatar
      neverallow untrusted_app as a mlstrustedsubject. · eaece936
      Stephen Smalley authored
      
      Assigning mlstrustedsubject to untrusted_app would undermine
      the per-user isolation model being enforced via levelFrom=user
      in seapp_contexts and the mls constraints.  There is no direct
      way to specify a neverallow on attribute assignment, but this
      makes use of a particular property of the fork permission to
      prevent ever adding mlstrustedsubject to untrusted_app.
      
      A similar restriction for app_data_file and mlstrustedobject
      is also important for the same reason, but cannot be expressed
      as a neverallow.
      
      Change-Id: I5170cadc55cc614aef0cd5f6491de8f69a4fa2a0
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      eaece936
    • Stephen Smalley's avatar
      Move allow rules before neverallow rules. · b8caf7fd
      Stephen Smalley authored
      
      There were a few instances where allow rules were appended
      after the neverallow rules stanza in the .te file.  Also
      there were some regular allow rules inserted into the CTS-specific
      rules section of app.te.  Just move the rules as appropriate.
      Should be no change in policy.
      
      Change-Id: Iec76f32d4b531d245bbf5dd9f621a71ff5c71f3e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      b8caf7fd
  17. Mar 06, 2015
    • dcashman's avatar
      Record observed bluetooth service access. · bb3cef44
      dcashman authored
      Bug: 18106000
      Change-Id: I80b574f73d53439dd710ccdb8f05cc2f9e9a10b4
      bb3cef44
    • Nick Kralevich's avatar
      allow untrusted_app read /data/anr/traces.txt · 1aafc4c7
      Nick Kralevich authored
      The GMS core feedback agent runs as untrusted_app, and needs
      the ability to read /data/anr/traces.txt to report ANR information.
      
      Allow all untrusted_apps to read /data/anr/traces.txt so that GMS core
      can access it.
      
      Longer term, we need to move GMS core into it's own domain, but that's
      a longer term change.
      
      Addresses the following denial:
      
      W/ndroid.feedback(17825): type=1400 audit(0.0:68004): avc: denied { read } for name="traces.txt" dev="mmcblk0p28" ino=325762 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      
      (cherrypick from commit e2547c3b)
      
      Bug: 18504118
      Bug: 18340553
      Change-Id: I8b472b6ab7dfe2a73154033e0a088b8e26396fa8
      1aafc4c7
  18. Mar 05, 2015
  19. Mar 03, 2015
    • dcashman's avatar
      Record observed system_server servicemanager service requests. · 23f33615
      dcashman authored
      Also formally allow dumpstate access to all services and grant system_server
      access to address the following non-system_server_service entries:
      
      avc:  granted  { find } for service=drm.drmManager scontext=u:r:system_server:s0 tcontext=u:object_r:drmserver_service:s0 tclass=service_manager
      avc:  granted  { find } for service=nfc scontext=u:r:system_server:s0 tcontext=u:object_r:nfc_service:s0 tclass=service_manager
      
      Bug: 18106000
      Change-Id: Iad16b36acf44bce52c4824f8b53c0e7731c25602
      23f33615
  20. Mar 02, 2015
    • dcashman's avatar
      Allow platform_app access to keystore. · 6a2451b5
      dcashman authored
      Encountered when certinstaller tries to talk to keystore:
      ComponentInfo{com.android.certinstaller/com.android.certinstaller.CertInstaller}: java.lang.NullPointerException: Attempt to invoke interface method 'int android.security.IKeystoreService.test()' on a null object reference
      
      Address the following denial:
      avc:  denied  { find } for service=android.security.keystore scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:keystore_service:s0 tclass=service_manager
      
      Bug: 19347232
      Change-Id: I35b46da3c78b384cf04216be937c6b5bfa86452d
      6a2451b5
  21. Feb 05, 2015
    • Nick Kralevich's avatar
      appdomain: relax netlink_socket neverallow rule · 87f3802a
      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.
      
      (cherry picked from commit d31936f8)
      
      Change-Id: I4763cb0c9510220693c506636dbb7584712b67e2
      87f3802a
  22. Jan 29, 2015
    • Nick Kralevich's avatar
      appdomain: relax netlink_socket neverallow rule · bf626ce9
      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.
      
      (cherry picked from commit d31936f8)
      
      Bug: 19198997
      Change-Id: Icfed1ee66f082df1117b090341f62981f01bc849
      bf626ce9
    • 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
  23. Jan 17, 2015
    • dcashman's avatar
      Record service accesses. · 566e8fe2
      dcashman authored
      Reduce logspam and record further observed service connections.
      
      Bug: 18106000
      Change-Id: I9a57e4bb8f1c8e066861719fb208c691498842a8
      566e8fe2
  24. Jan 15, 2015
    • dcashman's avatar
      Remove known system_server service accesses from auditing. · c631ede7
      dcashman authored
      Address observed  audit logs of the form:
      granted  { find } for service=XXX scontext=u:r:YYY:s0:c512,c768 tcontext=u:object_r:XXX_service:s0 tclass=service_manager
      
      in order to record existing relationships with services.
      
      Bug: 18106000
      Change-Id: I99a68f329c17ba67ebf3b87729b8405bdc925ef4
      c631ede7
  25. Jan 14, 2015
    • dcashman's avatar
      Make system_server_service an attribute. · 4a89cdfa
      dcashman authored
      Temporarily give every system_server_service its own
      domain in preparation for splitting it and identifying
      special services or classes of services.
      
      Change-Id: I81ffbdbf5eea05e0146fd7fd245f01639b1ae0ef
      4a89cdfa
  26. Dec 15, 2014
    • dcashman's avatar
      Restrict service_manager find and list access. · cd82557d
      dcashman authored
      All domains are currently granted list and find service_manager
      permissions, but this is not necessary.  Pare the permissions
      which did not trigger any of the auditallow reporting.
      
      Bug: 18106000
      Change-Id: Ie0ce8de2af8af2cbe4ce388a2dcf4534694c994a
      cd82557d
  27. Dec 12, 2014
    • Pawit Pornkitprasan's avatar
      sepolicy: allow system apps to access ASEC · 9d942049
      Pawit Pornkitprasan authored
      Required for Settings to show name/icon of apps on sd card
      (permission copied from untrusted_app)
      
      Also removed duplicate permission (from domain) in untrusted_app
      
      (cherry picked from commit c06ed8f7)
      
      Bug: 18730865
      Change-Id: I725d088d1d4a1256e3bfe49bc32796a54889f925
      9d942049
    • Pawit Pornkitprasan's avatar
      sepolicy: allow system apps to access ASEC · c06ed8f7
      Pawit Pornkitprasan authored
      Required for Settings to show name/icon of apps on sd card
      (permission copied from untrusted_app)
      
      Also removed duplicate permission (from domain) in untrusted_app
      
      Change-Id: Ib2b3bee4dfb54ad5e45b392fd9bfd65add4a00bf
      c06ed8f7
  28. Dec 04, 2014
    • Nick Kralevich's avatar
      allow untrusted_app read /data/anr/traces.txt · e2547c3b
      Nick Kralevich authored
      The GMS core feedback agent runs as untrusted_app, and needs
      the ability to read /data/anr/traces.txt to report ANR information.
      
      Allow all untrusted_apps to read /data/anr/traces.txt so that GMS core
      can access it.
      
      Longer term, we need to move GMS core into it's own domain, but that's
      a longer term change.
      
      Addresses the following denial:
      
      W/ndroid.feedback(17825): type=1400 audit(0.0:68004): avc: denied { read } for name="traces.txt" dev="mmcblk0p28" ino=325762 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      
      Bug: 18504118
      Bug: 18340553
      Change-Id: Ia9fac599befc3a3b6e5282be15ec8fd04bb23385
      e2547c3b
  29. Oct 14, 2014
  30. Sep 22, 2014
    • 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
  31. Aug 07, 2014
    • dcashman's avatar
      Allow untrusted_app access to temporary apk files. · fbbe9e91
      dcashman authored
      Before actual installation, apks are put in a staging area where they are
      scanned by a verifier before completing the install flow.  This verifier runs as
      a priv-app, which is in the untrusted_app domain.  Allow untrusted_app
      read-access to these files.
      
      Bug: 16515815
      
      Change-Id: Ifedc12a33b1f53b62f45013e7b253dbc79b02a4e
      fbbe9e91
Loading