Skip to content
Snippets Groups Projects
  1. Dec 16, 2016
    • Jeff Sharkey's avatar
      Allow installd to measure size of dexopt links. · 86c76890
      Jeff Sharkey authored
      avc: denied { getattr } for path="/data/dalvik-cache/arm64/system@framework@boot-core-libart.oat" dev="sda35" ino=1581062 scontext=u:r:installd:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=lnk_file permissive=0
      
      Test: builds, boots, quota stats match manual stats
      Bug: 27948817
      Change-Id: I65fb581a4732e03c46ac705f6693080c5f3be184
      86c76890
  2. Dec 15, 2016
    • Jeff Sharkey's avatar
      Allow installd to get/set filesystem quotas. · fe1de046
      Jeff Sharkey authored
      To support upcoming disk usage calculation optimizations, this change
      grants installd access to work with filesystem quotas.
      
      avc: denied { search } for name="block" dev="tmpfs" ino=15279 scontext=u:r:installd:s0 tcontext=u:object_r:block_device:s0 tclass=dir permissive=0
      avc: denied { sys_admin } for capability=21 scontext=u:r:installd:s0 tcontext=u:r:installd:s0 tclass=capability permissive=1
      avc: denied { quotaget } for scontext=u:r:installd:s0 tcontext=u:object_r:labeledfs:s0 tclass=filesystem permissive=1
      
      Test: builds
      Bug: 27948817
      Change-Id: Ic166e8ced30e15ce84223576729888a824037691
      fe1de046
  3. 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
  4. Dec 05, 2016
    • Jeff Sharkey's avatar
      Rules for new installd Binder interface. · e160d14e
      Jeff Sharkey authored
      Most of this CL mirrors what we've already done for the "netd" Binder
      interface, while sorting a few lists alphabetically.
      
      Migrating installd to Binder will allow us to get rid of one of
      the few lingering text-based command protocols, improving system
      maintainability and security.
      
      Test: builds, boots
      Bug: 13758960, 30944031
      Change-Id: I59b89f916fd12e22f9813ace6673be38314c97b7
      e160d14e
  5. Nov 12, 2016
  6. Nov 08, 2016
    • Nick Kralevich's avatar
      installd: r_dir_file(installd, system_file) · 68f23364
      Nick Kralevich authored
      Allow installd to read through files, directories, and symlinks
      on /system. This is needed to support installd using files in
      /system/app and /system/priv-app
      
      Addresses the following auditallow spam:
      
      avc: granted { getattr } for comm="installd"
      path="/system/app/Bluetooth/lib/arm/libbluetooth_jni.so"
      dev="mmcblk0p41" ino=19 scontext=u:r:installd:s0
      tcontext=u:object_r:system_file:s0 tclass=lnk_file
      
      avc: granted { getattr } for comm="installd"
      path="/system/priv-app/MtpDocumentsProvider/lib/arm64/libappfuse_jni.so"
      dev="dm-0" ino=2305 scontext=u:r:installd:s0
      tcontext=u:object_r:system_file:s0 tclass=lnk_file
      
      avc: granted { read open } for comm="installd"
      path="/system/priv-app/TelephonyProvider" dev="mmcblk0p43" ino=1839
      scontext=u:r:installd:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      avc: granted { read } for comm="installd" name="Velvet" dev="mmcblk0p43"
      ino=1841 scontext=u:r:installd:s0 tcontext=u:object_r:system_file:s0
      tclass=dir
      
      avc: granted { read open } for comm="installd"
      path="/system/priv-app/GoogleOneTimeInitializer" dev="mmcblk0p43"
      ino=1778 scontext=u:r:installd:s0 tcontext=u:object_r:system_file:s0
      tclass=dir
      
      avc: granted { read open } for comm="installd"
      path="/system/app/PlayAutoInstallConfig" dev="mmcblk0p43" ino=112
      scontext=u:r:installd:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      Test: policy compiles
      Change-Id: I5d14ea2cd7d281f949d0651b9723d5b7fae2e1f2
      68f23364
  7. Oct 07, 2016
  8. 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
  9. Sep 12, 2016
    • Andreas Gampe's avatar
      Sepolicy: Adapt for new A/B OTA flow · 03daf853
      Andreas Gampe authored
      (cherry picked from commit d47c1e93)
      
      To include target slot names in the naming of A/B OTA artifacts,
      and new path has been implemented. Instead of passing through
      the system server and forking off of installd, otapreopt_chroot
      is now driven directly from the otapreopt script.
      
      Change the selinux policy accordingly: allow a transition from
      postinstall to otapreopt_chroot, and let otapreopt_chroot inherit
      the file descriptors that update_engine had opened (it will close
      them immediately, do not give rights to the downstream executables
      otapreopt and dex2oat).
      
      Bug: 25612095
      Bug: 28069686
      Change-Id: I6b476183572c85e75eda4d52f60e4eb5d8f48dbb
      03daf853
  10. Sep 10, 2016
  11. Aug 29, 2016
  12. Jul 11, 2016
    • Andreas Gampe's avatar
      Sepolicy: Adapt for new A/B OTA flow · d47c1e93
      Andreas Gampe authored
      To include target slot names in the naming of A/B OTA artifacts,
      and new path has been implemented. Instead of passing through
      the system server and forking off of installd, otapreopt_chroot
      is now driven directly from the otapreopt script.
      
      Change the selinux policy accordingly: allow a transition from
      postinstall to otapreopt_chroot, and let otapreopt_chroot inherit
      the file descriptors that update_engine had opened (it will close
      them immediately, do not give rights to the downstream executables
      otapreopt and dex2oat).
      
      Bug: 25612095
      Bug: 28069686
      Change-Id: I6b476183572c85e75eda4d52f60e4eb5d8f48dbb
      d47c1e93
  13. Jun 15, 2016
    • Amith Yamasani's avatar
      Allow installd to delete the foreign-dex folder · a4e2aa13
      Amith Yamasani authored
      Grant installd the policies to recursively delete
      the foreign-dex folder when removing a user. Otherwise
      the user cleanup will partially fail and cause a boot loop
      when the userId is reused as some later point.
      
      Bug: 29285673
      Change-Id: I023f150cffbeb10b6014f48bca9eb0922c2d630a
      a4e2aa13
  14. Jun 01, 2016
  15. Apr 22, 2016
    • Andreas Gampe's avatar
      Selinux: Policies for otapreopt_chroot and postinstall_dexopt · e5d8a947
      Andreas Gampe authored
      Give mount & chroot permissions to otapreopt_chroot related to
      postinstall.
      
      Add postinstall_dexopt for otapreopt in the B partition. Allow
      the things installd can do for dexopt. Give a few more rights
      to dex2oat for postinstall files.
      
      Allow postinstall files to call the system server.
      
      Bug: 25612095
      Change-Id: If7407473d50c9414668ff6ef869c2aadd14264e7
      e5d8a947
  16. Mar 11, 2016
  17. Mar 01, 2016
    • Calin Juravle's avatar
      Add SElinux policies to allow foreign dex usage tracking. · 837bc42f
      Calin Juravle authored
      This is a special profile folder where apps will leave profile markers
      for the dex files they load and don't own. System server will read the
      markers and decide which apk should be fully compiled instead of
      profile guide compiled.
      
      Apps need only to be able to create (touch) files in this directory.
      System server needs only to be able to check wheter or not a file with a
      given name exists.
      
      Bug: 27334750
      Bug: 26080105
      
      Change-Id: I2256e4aba1ec0e5117de6497123223b9a74f404e
      837bc42f
  18. Feb 19, 2016
  19. Feb 05, 2016
  20. Nov 25, 2015
  21. Nov 16, 2015
  22. 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
  23. Oct 03, 2015
    • Jeff Vander Stoep's avatar
      grant installd rx perms on toybox · 628e7f7c
      Jeff Vander Stoep authored
      Installd uses cp when relocating apps to sdcard.
      
      avc: denied { execute } for name="toybox" dev="mmcblk0p10" ino=315 scontext=u:r:installd:s0 tcontext=u:object_r:toolbox_exec:s0 tclass=file
      
      Bug: 24617685
      Change-Id: Id1a3039bbfc187c074aa50d426278964c40e4bde
      628e7f7c
  24. Jun 19, 2015
    • Stephen Smalley's avatar
      Run idmap in its own domain. · b335e384
      Stephen Smalley authored
      
      Run idmap in its own domain rather than leaving it in installd's domain.
      This prevents misuse of installd's permissions by idmap.
      
      zygote also needs to run idmap.  For now, just run it in zygote's
      domain as it was previously since that is what is done for dex2oat
      invocation by zygote.  zygote appears to run idmap with system uid
      while installd runs it with app UIDs, so using different domains
      seems appropriate.
      
      Remove system_file execute_no_trans from both installd and zygote;
      this should no longer be needed with explicit labels for dex2oat and
      idmap.
      
      Change-Id: If47e2c1326b84c20e94a20f5e699300dce12bdfe
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      b335e384
  25. Jun 16, 2015
    • Jeff Sharkey's avatar
      installd restorecon now requires getattr. · f8fd5ab2
      Jeff Sharkey authored
      avc: denied { getattr } for path="/mnt/expand" dev="tmpfs" ino=3146 scontext=u:r:installd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
      
      Bug: 21856349
      Change-Id: Ib9984182a71408d5cb803d453f148856b68569e3
      f8fd5ab2
  26. Jun 05, 2015
  27. May 01, 2015
    • Jeff Sharkey's avatar
      Allow installd to move APKs. · ecc82e0f
      Jeff Sharkey authored
      As an optimization, installd is now moving previously-installed
      applications between attached storage volumes.  This is effectively
      copying to the new location, then deleting the old location.
      
      Since OAT files can now live under /data/app directories, we also
      need the ability to relabel those files.
      
      avc: denied { create } for name="base.apk" scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
      avc: denied { write } for path="/data/app/com.example.playground-2/base.apk" dev="mmcblk0p16" ino=40570 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
      avc: denied { setattr } for name="base.apk" dev="mmcblk0p16" ino=40570 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
      avc: denied { relabelfrom } for name="base.odex" dev="mmcblk0p16" ino=40574 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
      avc: denied { relabelto } for name="base.odex" dev="mmcblk0p16" ino=40574 scontext=u:r:installd:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file permissive=1
      
      (Cherry-pick of 8f821db7)
      
      Bug: 19993667, 20275578
      Change-Id: I52bb29ed9f57b3216657eb757d78b06eeaf53458
      ecc82e0f
  28. Apr 30, 2015
    • Jeff Sharkey's avatar
      Allow installd to move APKs. · 8f821db7
      Jeff Sharkey authored
      As an optimization, installd is now moving previously-installed
      applications between attached storage volumes.  This is effectively
      copying to the new location, then deleting the old location.
      
      Since OAT files can now live under /data/app directories, we also
      need the ability to relabel those files.
      
      avc: denied { create } for name="base.apk" scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
      avc: denied { write } for path="/data/app/com.example.playground-2/base.apk" dev="mmcblk0p16" ino=40570 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
      avc: denied { setattr } for name="base.apk" dev="mmcblk0p16" ino=40570 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
      avc: denied { relabelfrom } for name="base.odex" dev="mmcblk0p16" ino=40574 scontext=u:r:installd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
      avc: denied { relabelto } for name="base.odex" dev="mmcblk0p16" ino=40574 scontext=u:r:installd:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file permissive=1
      
      Bug: 19993667, 20275578
      Change-Id: I52bb29ed9f57b3216657eb757d78b06eeaf53458
      8f821db7
  29. Apr 10, 2015
    • Jeff Sharkey's avatar
      Allow installd to move around private app data. · 8da7876b
      Jeff Sharkey authored
      Add rules that allow installd to move private app data between
      internal and expanded storage devices.  For now we'll be reusing
      the "cp" binary using android_fork_execvp(), so grant access to
      devpts.
      
      avc: denied { read write } for name="14" dev="devpts" ino=17 scontext=u:r:installd:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=1
      avc: denied { open } for path="/dev/pts/14" dev="devpts" ino=17 scontext=u:r:installd:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=1
      
      avc: denied { read } for name="com.android.opengl.shaders_cache" dev="mmcblk0p16" ino=114672 scontext=u:r:installd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file permissive=1
      avc: denied { open } for path="/data/data/com.example.playground/code_cache/com.android.opengl.shaders_cache" dev="mmcblk0p16" ino=114672 scontext=u:r:installd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file permissive=1
      avc: denied { create } for name="com.android.opengl.shaders_cache" scontext=u:r:installd:s0 tcontext=u:object_r:app_data_file:s0 tclass=file permissive=1
      avc: denied { read write open } for path="/mnt/expand/57f8f4bc-abf4-655f-bf67-946fc0f9f25b/user/0/com.example.playground/code_cache/com.android.opengl.shaders_cache" dev="dm-0" ino=64518 scontext=u:r:installd:s0 tcontext=u:object_r:app_data_file:s0 tclass=file permissive=1
      
      Bug: 19993667
      Change-Id: I5188e660c8b5e97eab8f0c74147499ec688f3f19
      8da7876b
  30. Apr 07, 2015
    • Jeff Sharkey's avatar
      Allow installd to dexopt apps on expanded storage. · 44c95e9a
      Jeff Sharkey authored
      avc: denied { search } for name="expand" dev="tmpfs" ino=3130 scontext=u:r:installd:s0 tcontext=u:object_r:mnt_expand_file:s0 tclass=dir permissive=0
      
      Bug: 19993667
      Change-Id: Ie53df62aa79ae14cd56d7c6f2429b4be382164d1
      44c95e9a
  31. Apr 02, 2015
  32. Mar 07, 2015
  33. 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
  34. Jul 15, 2014
  35. 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
  36. Jun 16, 2014
    • Nick Kralevich's avatar
      Fix SELinux policies to allow resource overlays. · fad4d5fb
      Nick Kralevich authored
      The following commits added support for runtime resource overlays.
      
        New command line tool 'idmap'
        * 65a05fd56dbc9fd9c2511a97f49c445a748fb3c5
        Runtime resource overlay, iteration 2
        * 48d22323ce39f9aab003dce74456889b6414af55
        Runtime resource overlay, iteration 2, test cases
        * ad6ed950dbfa152c193dd7e49c369d9e831f1591
      
      During SELinux tightening, support for these runtime resource
      overlays was unknowingly broken. Fix it.
      
      This change has been tested by hackbod and she reports that
      everything is working after this change. I haven't independently
      verified the functionality.
      
      Test cases are available for this by running:
        * python frameworks/base/core/tests/overlaytests/testrunner.py
      
      Change-Id: I1c70484011fd9041bec4ef34f93f7a5509906f40
      fad4d5fb
  37. Jun 14, 2014
    • Stephen Smalley's avatar
      Allow installd to stat asec files and /data/media files. · 2fbecbba
      Stephen Smalley authored
      
      Addresses denials such as:
      avc: denied { getattr } for comm="installd" path="/data/app-asec/com.vectorunit.red-1.asec" dev="dm-0" ino=578229 scontext=u:r:installd:s0 tcontext=u:object_r:asec_image_file:s0 tclass=file
      
      avc:  denied  { getattr } for  pid=262 comm="installd" path="/data/media/0/Android/data/com.google.android.apps.maps/cache/cache_vts_tran_base_GMM.m" dev="dm-0" ino=124930 scontext=u:r:installd:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file
      
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      
      (cherry picked from commit d2622fda)
      
      Change-Id: Iac46236ee583dee11a7e6518a9e8eca25c59e9ba
      2fbecbba
  38. Jun 12, 2014
    • Nick Kralevich's avatar
      Remove world-read access to /data/dalvik-cache/profiles · 86703051
      Nick Kralevich authored
      Remove /data/dalvik-cache/profiles from domain. Profiling information
      leaks data about how people interact with apps, so we don't want
      the data to be available in all SELinux domains.
      
      Add read/write capabilities back to app domains, since apps need to
      read/write profiling data.
      
      Remove restorecon specific rules. The directory is now created by
      init, not installd, so installd doesn't need to set the label.
      
      Change-Id: Ic1b44009faa30d704855e97631006c4b990a4ad3
      86703051
  39. Jun 11, 2014
    • Stephen Smalley's avatar
      Allow installd to chown/chmod app data files. · 89b9ff7e
      Stephen Smalley authored
      
      Addresses denials such as:
      avc: denied { setattr } for comm="installd" name="com.android.calendar_preferences_no_backup.xml" dev="mmcblk0p28" ino=1499393 scontext=u:r:installd:s0 tcontext=u:object_r:app_data_file:s0 tclass=file                                        avc: denied { setattr } for comm="installd" name="calendar_alerts.xml" dev="mmcblk0p28" ino=1499463 scontext=u:r:installd:s0 tcontext=u:object_r:app_data_file:s0 tclass=file
      avc: denied { setattr } for comm="installd" name="_has_set_default_values.xml" dev="mmcblk0p28" ino=1499428 scontext=u:r:installd:s0 tcontext=u:object_r:app_data_file:s0 tclass=file
      
      Change-Id: I0622f1a9d2b10e28be2616f91edf33bc048b4ac7
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      89b9ff7e
  40. Jun 04, 2014
    • Stephen Smalley's avatar
      Allow installd to stat asec files and /data/media files. · d2622fda
      Stephen Smalley authored
      
      Addresses denials such as:
      avc: denied { getattr } for comm="installd" path="/data/app-asec/com.vectorunit.red-1.asec" dev="dm-0" ino=578229 scontext=u:r:installd:s0 tcontext=u:object_r:asec_image_file:s0 tclass=file
      
      avc:  denied  { getattr } for  pid=262 comm="installd" path="/data/media/0/Android/data/com.google.android.apps.maps/cache/cache_vts_tran_base_GMM.m" dev="dm-0" ino=124930 scontext=u:r:installd:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file
      
      Change-Id: I406f1bea32736e2277adae1629a879fac0d714b6
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      d2622fda
Loading