Skip to content
Snippets Groups Projects
  1. Jan 05, 2017
    • Alex Klyubin's avatar
      Move priv_app policy to private · 92295ef8
      Alex Klyubin authored
      This leaves the existence of priv_app domain as public API. All other
      rules are implementation details of this domain's policy and are thus
      now private.
      
      Test: No change to policy according to sesearch, except for
            disappearance of all allow rules from priv_app_current
            attribute (as expected) except for
            allow priv_app_current update_engine_current:binder transfer;
            which is caused by public update_engine.te rules and will go
            away once update_engine rules go private.
      Bug: 31364497
      
      Change-Id: Iea583127fbf0a19c37dd42bf1ef2ae0454793391
      92295ef8
  2. Dec 19, 2016
    • Nick Kralevich's avatar
      priv_app.te: drop app_data_file:file execute_no_trans; · 8fb4cb8b
      Nick Kralevich authored
      auditallow (added in commit 758e6b36)
      has been in place for about 2 weeks now, and no hits. Remove
      execute_no_trans.
      
      The net effect of this change is that priv_apps won't be able to exec()
      a file from their home directory, but dlopen() and friends will still
      work.
      
      Test: Compiles and boots successfully.
      Test: No auditallow messages received via SELinux denial collection.
      Change-Id: I60fcdc260d12e1bcc2355ca4dd912de7e6d0a145
      8fb4cb8b
  3. Dec 13, 2016
    • Jeff Sharkey's avatar
      Partially revert "mediaprovider" SELinux domain. · 52da39d9
      Jeff Sharkey authored
      The new domain wasn't fully tested, and it caused many regressions
      on the daily build.  Revert back to using "priv_app" domain until we
      can fully test and re-land the new domain.
      
      Temporarily add the USB functionfs capabilities to priv_app domain
      to keep remainder of MtpService changes working; 33574909 is tracking
      removing that from the priv_app domain.
      
      Test: builds, boots, verified UI and downloads
      Bug: 33569176, 33568261, 33574909
      Change-Id: I1bd0561d52870df0fe488e59ae8307b89978a9cb
      52da39d9
  4. Dec 12, 2016
    • Jerry Zhang's avatar
      Move MediaProvider to its own domain, add new MtpServer permissions · f921dd9c
      Jerry Zhang authored
      Also move necessary priv_app permissions into MediaProvider domain and
      remove MediaProvider specific permissions from priv_app.
      
      The new MtpServer permissions fix the following denials:
      
      avc: denied { write } for comm=6D747020666673206F70656E name="ep0" dev="functionfs" ino=12326 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:functionfs:s0 tclass=file permissive=1
      
      denial from setting property sys.usb.ffs.mtp.ready, context priv_app
      
      Bug: 30976142
      Test: Manual, verify permissions are allowed
      Change-Id: I4e66c5a8b36be21cdb726b5d00c1ec99c54a4aa4
      f921dd9c
  5. Dec 08, 2016
    • dcashman's avatar
      Restore app_domain macro and move to private use. · 3e8dbf01
      dcashman authored
      app_domain was split up in commit: 2e00e637 to
      enable compilation by hiding type_transition rules from public policy.  These
      rules need to be hidden from public policy because they describe how objects are
      labeled, of which non-platform should be unaware.  Instead of cutting apart the
      app_domain macro, which non-platform policy may rely on for implementing new app
      types, move all app_domain calls to private policy.
      
      (cherry-pick of commit: 76035ea0)
      
      Bug: 33428593
      Test: bullhead and sailfish both boot. sediff shows no policy change.
      Change-Id: I4beead8ccc9b6e13c6348da98bb575756f539665
      3e8dbf01
  6. Dec 07, 2016
    • Nick Kralevich's avatar
      priv_app.te: Drop auditallow app_data_file:file execute · 57475e5e
      Nick Kralevich authored
      This functionality is being used by priv_apps shipped as part of
      Android. Don't drop execute_no_trans as we haven't seen any denials here
      yet.
      
      Addresses the following auditallow messages:
      
      avc: granted { execute } for comm="GELServices-0"
      path="/data/data/com.google.android.googlequicksearchbox/files/velour/dex_cache/Ji1opKyKASKEOKNQUu1QyWw_1.jar/Ji1opKyKASKEOKNQUu1QyWw_1.dex"
      dev="dm-2" ino=1196939 scontext=u:r:priv_app:s0:c512,c768
      tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file
      
      avc: granted { execute } for comm="CTION_IDLE_MODE"
      path="/data/data/com.google.android.gms/snet/dalvik-cache/snet.dex"
      dev="dm-2" ino=1114262 scontext=u:r:priv_app:s0:c512,c768
      tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file
      
      avc: granted { execute } for comm="lowpool[3]"
      path="/data/data/com.google.android.gms/files/libAppDataSearchExt_arm64_v8a.so"
      dev="dm-2" ino=1688320 scontext=u:r:priv_app:s0:c512,c768
      tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file
      
      avc: granted { execute } for comm="Binder:9196_2"
      path="/data/data/com.google.android.gms/app_dg_cache/1FECE961A655634046D6AB5E18FE6F74212FBEA6/lib/libdC14BB7282EA1.so"
      dev="dm-2" ino=1893474 scontext=u:r:priv_app:s0:c512,c768
      tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file
      
      avc: granted { execute } for comm="Binder:13170_1"
      path="/data/data/com.google.android.gms/app_fb/f.dex" dev="dm-2"
      ino=1810720 scontext=u:r:priv_app:s0:c512,c768
      tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file
      
      Test: policy compiles.
      Change-Id: I63358697b07c8f620b999e666791f4f385bab776
      57475e5e
  7. Dec 06, 2016
    • dcashman's avatar
      sepolicy: add version_policy tool and version non-platform policy. · 2e00e637
      dcashman authored
      In order to support platform changes without simultaneous updates from
      non-platform components, the platform and non-platform policies must be
      split.  In order to provide a guarantee that policy written for
      non-platform objects continues to provide the same access, all types
      exposed to non-platform policy are versioned by converting them and the
      policy using them into attributes.
      
      This change performs that split, the subsequent versioning and also
      generates a mapping file to glue the different policy components
      together.
      
      Test: Device boots and runs.
      Bug: 31369363
      Change-Id: Ibfd3eb077bd9b8e2ff3b2e6a0ca87e44d78b1317
      2e00e637
  8. Dec 05, 2016
    • Daniel Micay's avatar
      auditallow priv_app app_data_file execution · 758e6b36
      Daniel Micay authored
      In general, apps shouldn't be executing data from their writable data
      directories. Allowing this is a security risk and use cases for this are
      almost always anti-patterns where saner alternatives are available such
      as using one of the standard systems for shipping libraries (extracted
      by the package manager or aligned/uncompressed in the apk) or using the
      existing package system to handle plugins. It's reasonable for the
      untrusted_app domain to have this (not just for backwards compatibility)
      for priv_app should be held to a higher standard.
      
      Ideally, untrusted apps would be able to opt-in to disabling this and
      then the default could then be switched at a new API level. It could do
      more than just hardening apps not requiring it by having documentation
      explain the risks and offer alternatives to reduce 'legitimate' use. The
      base system could disable it for all of the bundled untrusted apps.
      
      Change-Id: I4efcfaf01c6b6c33c39e98c22a1934e8892e2147
      758e6b36
  9. Nov 15, 2016
  10. Oct 06, 2016
    • dcashman's avatar
      Split general policy into public and private components. · cc39f637
      dcashman authored
      Divide policy into public and private components.  This is the first
      step in splitting the policy creation for platform and non-platform
      policies.  The policy in the public directory will be exported for use
      in non-platform policy creation.  Backwards compatibility with it will
      be achieved by converting the exported policy into attribute-based
      policy when included as part of the non-platform policy and a mapping
      file will be maintained to be included with the platform policy that
      maps exported attributes of previous versions to the current platform
      version.
      
      Eventually we would like to create a clear interface between the
      platform and non-platform device components so that the exported policy,
      and the need for attributes is minimal.  For now, almost all types and
      avrules are left in public.
      
      Test: Tested by building policy and running on device.
      
      Change-Id: Idef796c9ec169259787c3f9d8f423edf4ce27f8c
      cc39f637
  11. Sep 13, 2016
    • Tao Bao's avatar
      Add ota_package_file label for OTA packages. · e06ed7d0
      Tao Bao authored
      (cherry picked from commit 6c3f2831)
      
      Allow priv_app, uncrypt, update_engine to access the OTA packages at
      /data/ota_package (both A/B and non-A/B). GMSCore (priv_app) checks
      the existence of the folder, and downloads the package there if present.
      
      Bug: 28944800
      Change-Id: I3c0717861fce7f93b33874a99f6a4a55567612a5
      e06ed7d0
  12. Sep 10, 2016
  13. Aug 29, 2016
  14. Jun 06, 2016
    • Tao Bao's avatar
      Add ota_package_file label for OTA packages. · 6c3f2831
      Tao Bao authored
      Allow priv_app, uncrypt, update_engine to access the OTA packages at
      /data/ota_package (both A/B and non-A/B). GMSCore (priv_app) checks
      the existence of the folder, and downloads the package there if present.
      
      Bug: 28944800
      Change-Id: I3c0717861fce7f93b33874a99f6a4a55567612a5
      6c3f2831
  15. May 24, 2016
    • Fyodor Kupolov's avatar
      SELinux policies for /data/preloads directory · 49ac2a3d
      Fyodor Kupolov authored
      A new directory is created in user data partition that contains preloaded
      content such as a retail mode demo video and pre-loaded APKs.
      
      The new directory is writable/deletable by system server. It can only be
      readable (including directory list) by privileged or platform apps
      
      Bug: 28855287
      Change-Id: I3816cd3a1ed5b9a030965698a66265057214f037
      49ac2a3d
  16. Apr 11, 2016
    • Peng Xu's avatar
      Allow all apps to discover contexthub_service · 7df44d82
      Peng Xu authored
      This allows system app, regular app as well as test app to access
      ContextHubManager API. Additional "signature|privilige" permission
      requirement (LOCATION_HARDWARE) still exist to prevent security
      issues, misuse and abuse.
      
      Change-Id: I47f3d243a3de7f1202c933fc715a935c43cf319b
      7df44d82
  17. Mar 30, 2016
  18. Mar 16, 2016
  19. Mar 15, 2016
    • Peng Xu's avatar
      Create SELinux label for contexhub_service · 1c50994e
      Peng Xu authored
      SELinux label is created for contexthub_service system service.
      
      ContextHub service manages all available context hubs and serves fulfil communication between apps
      and underlying context hub hardware.
      
      Change-Id: I8470fedd9c79a00012e1cdb9b548a1b632ba7de6
      1c50994e
  20. Mar 09, 2016
    • Jeff Vander Stoep's avatar
      priv_app: allow access to mediadrmserver_service · 7aed1b25
      Jeff Vander Stoep authored
      Addresses:
      avc:  denied  { find } for service=media.drm pid=6030 uid=10012
      scontext=u:r:priv_app:s0:c512,c768
      tcontext=u:object_r:mediadrmserver_service:s0 tclass=service_manager
      
      Bug: 27553530
      Change-Id: I060de7ee1f66c7a545076b7de8363bebaac61f2c
      7aed1b25
  21. Mar 02, 2016
    • Jeff Sharkey's avatar
      Allow Phone to write cached ringtones. · 8c09b65d
      Jeff Sharkey authored
      avc: denied { write } for path="/data/system_de/0/ringtones/ringtone_cache" dev="mmcblk0p44" ino=1602501 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:ringtone_file:s0 tclass=file permissive=0
      
      Bug: 27366059
      Change-Id: I120a69ac4f58c64db6f169ae4f9942ce357b0b1f
      8c09b65d
  22. Feb 22, 2016
    • Tao Bao's avatar
      Add recovery service. · 45f8e4af
      Tao Bao authored
      RecoverySystemService is separated from PowerManagerService as a
      dedicated system service to handle recovery related requests (such as
      invoking uncrypt to uncrypt an OTA package on /data or to set up /
      clear the bootloader control block (i.e. /misc) and etc).
      
      The matching CL in frameworks/base is in:
        Change-Id: Ic606fcf5b31c54ce54f0ab12c1768fef0fa64560.
      
      Bug: 26830925
      Change-Id: Iee0583c458f784bfa422d0f7af5d1f2681d9609e
      (cherry picked from commit 65b5fde9)
      45f8e4af
    • Tao Bao's avatar
      Add recovery service. · 65b5fde9
      Tao Bao authored
      RecoverySystemService is separated from PowerManagerService as a
      dedicated system service to handle recovery related requests (such as
      invoking uncrypt to uncrypt an OTA package on /data or to set up /
      clear the bootloader control block (i.e. /misc) and etc).
      
      The matching CL in frameworks/base is in:
        Change-Id: Ic606fcf5b31c54ce54f0ab12c1768fef0fa64560.
      
      Bug: 26830925
      Change-Id: Iee0583c458f784bfa422d0f7af5d1f2681d9609e
      65b5fde9
  23. Feb 10, 2016
    • dcashman's avatar
      Make voiceinteractionservice app_api_service. · 8f5a891f
      dcashman authored
      Address the following denial from 3rd party voice interaction test:
      SELinux : avc:  denied  { find } for service=voiceinteraction pid=30281 uid=10139 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:voiceinteraction_service:s0 tclass=service_manager permissive=0
      
      Bug: 27105570
      Change-Id: Ib87d364673cbc883df017bcda7fe1e854a76654f
      8f5a891f
  24. Feb 09, 2016
  25. Feb 05, 2016
    • Daichi Hirono's avatar
      Add SELinux label for app fuse. · e178ac5a
      Daichi Hirono authored
      The labels for filesystem and files are assigned by vold with using
      context= mount option.
      
      Change-Id: I8a9d701a46a333093a27107fc3c52b17a2af1a94
      e178ac5a
  26. Jan 28, 2016
  27. Jan 27, 2016
  28. Jan 26, 2016
    • dcashman's avatar
      Reduce accessibility of voiceinteraction_service. · aedf2236
      dcashman authored
      The services under this label are not meant to be exposed to all apps.
      Currently only priv_app needs access.
      
      Bug: 26799206
      Change-Id: I07c60752d6ba78f27f90bf5075bcab47eba90b55
      aedf2236
    • Tao Bao's avatar
      Allow update_engine to use Binder IPC. · dce317cf
      Tao Bao authored
      Register service with servicemanager and name the context.
      
      avc: denied { call } for scontext=u:r:update_engine:s0 tcontext=u:r:servicemanager:s0 tclass=binder
      avc: denied { add } for service=android.os.IUpdateEngine scontext=u:r:update_engine:s0 tcontext=u:object_r:update_engine_service:s0 tclass=service_manager
      
      Also allow priv_app to communicate with update_engine.
      
      avc: denied { find } for service=android.os.IUpdateEngine scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:update_engine_service:s0 tclass=service_manager
      avc: denied { call } for scontext=u:r:priv_app:s0:c512,c768 tcontext=u:r:update_engine:s0 tclass=binder
      avc: denied { call } for scontext=u:r:update_engine:s0 tcontext=u:r:priv_app:s0 tclass=binder
      
      Change-Id: Ib4498717c1a72f5faab5ea04c636924ee4eb412c
      dce317cf
  29. Jan 22, 2016
  30. Jan 16, 2016
    • Nick Kralevich's avatar
      priv_app.te: drop auditallows on cache_recovery_file · b8d794a1
      Nick Kralevich authored
      This is actually used. Addresses the following SELinux audit logs:
      
        avc: granted { create } for comm="Thread-157" name="uncrypt_file" scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:cache_recovery_file:s0:c512,c768 tclass=file
        avc: granted { add_name } for comm="Thread-157" name="uncrypt_file" scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:cache_recovery_file:s0 tclass=dir
        avc: granted { write } for comm="Thread-157" path="/cache/recovery/uncrypt_file" dev="mmcblk0p38" ino=22 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:cache_recovery_file:s0:c512,c768 tclass=file
        avc: granted { write } for comm="Thread-157" path="/cache/recovery/command" dev="mmcblk0p38" ino=23 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:cache_recovery_file:s0:c512,c768 tclass=file
        avc: granted { setattr } for comm="Thread-157" name="uncrypt_file" dev="mmcblk0p38" ino=22 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:cache_recovery_file:s0:c512,c768 tclass=file
      
      Change-Id: Idab00ebc8eacd7d8bb793b9342249227f91986a1
      b8d794a1
  31. Jan 08, 2016
    • Nick Kralevich's avatar
      priv_app.te: refine cache_recovery_file auditallow rules · eb6656ce
      Nick Kralevich authored
      priv_app reads from /cache/recovery, but I'm still not sure if
      it writes. Eliminate the read auditallow rules and allow the
      writes to show up (if any).
      
      Eliminates the following auditallow messages:
      
        avc: granted { search } for comm="IntentService[S" name="recovery" dev="mmcblk0p38" ino=12 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:cache_recovery_file:s0 tclass=dir
        avc: granted { getattr } for comm="Thread-1" path="/cache/recovery/last_install" dev="mmcblk0p27" ino=29891 scontext=u:r:priv_app:s0:c525,c768 tcontext=u:object_r:cache_recovery_file:s0 tclass=file
        avc: granted { read open } for comm="Thread-1" name="recovery" dev="mmcblk0p27" ino=29889 scontext=u:r:priv_app:s0:c525,c768 tcontext=u:object_r:cache_recovery_file:s0 tclass=dir
      
      Change-Id: Ibc0640f5366aae50e3fd09d17657374390b24a5c
      eb6656ce
  32. Jan 06, 2016
  33. Jan 04, 2016
    • Felipe Leme's avatar
      Creates a new permission for /cache/recovery · 549ccf77
      Felipe Leme authored
      This permission was created mostly for dumpstate (so it can include
      recovery files on bugreports when an OTA fails), but it was applied to
      uncrypt and recovery as well (since it had a wider access before).
      
      Grant access to cache_recovery_file where we previously granted access
      to cache_file. Add auditallow rules to determine if this is really
      needed.
      
      BUG: 25351711
      Change-Id: I07745181dbb4f0bde75694ea31b3ab79a4682f18
      549ccf77
    • dcashman's avatar
      Create sysfs_zram label. · 36f255ff
      dcashman authored
      Address following denials:
      avc: denied { getattr } for path="/sys/devices/virtual/block/zram0/disksize" dev="sysfs" ino=14958 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_zram:s0 tclass=file permissive=0
      avc: denied { search } for name="zram0" dev="sysfs" ino=14903 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_zram:s0 tclass=dir permissive=0
      avc: denied { read } for name="mem_used_total" dev="sysfs" ino=14970 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_zram:s0 tclass=file permissive=0
      avc: denied { write } for name="uevent" dev="sysfs" ino=14904 scontext=u:r:ueventd:s0 tcontext=u:object_r:sysfs_zram:s0 tclass=file permissive=0
      avc: denied { open } for path="/sys/devices/virtual/block/zram0/uevent" dev="sysfs" ino=14904 scontext=u:r:ueventd:s0 tcontext=u:object_r:sysfs_zram:s0 tclass=file permissive=0
      avc: denied { read } for pid=348 comm="vold" name="zram0" dev="sysfs" ino=15223 scontext=u:r:vold:s0 tcontext=u:object_r:sysfs_zram:s0 tclass=dir permissive=0
      avc: denied { search } for pid=3494 comm="ContactsProvide" name="zram0"dev="sysfs" ino=15223 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:sysfs_zram:s0 tclass=dir permissive=0
      
      Bug: 22032619
      Change-Id: I40cf918b7cafdba6cb3d42b04b1616a84e4ce158
      36f255ff
  34. Dec 24, 2015
    • Daichi Hirono's avatar
      Add new rules for appfuse. · a20802dd
      Daichi Hirono authored
      The new rules are used to allow to mount FUSE file system for priv-app.
      
      Change-Id: I5ce2d261be501e2b3fef09b7666f1e5d1cddbe52
      a20802dd
  35. Dec 08, 2015
  36. Dec 03, 2015
  37. 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
Loading