Skip to content
Snippets Groups Projects
  1. May 05, 2017
    • Jeff Sharkey's avatar
      Allow installd to delete files via sdcardfs. · 72f4c619
      Jeff Sharkey authored
      When installd clears cached files on external storage, the sdcardfs
      kernel filesystem needs to be kept in the loop to release any cached
      dentries that it's holding onto.  (Otherwise the underlying disk
      space isn't actually released.)
      
      installd can already delete the underlying files directly (via the
      media_rw_data_file rules), so this technically isn't expanding its
      capabilities.
      
      avc: granted { search } for name="/" dev="tmpfs" ino=6897 scontext=u:r:installd:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir
      avc: denied { open } for path="/mnt/runtime/default/emulated/0/Android/data" dev="sdcardfs" ino=589830 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=1
      avc: denied { write } for name="com.google.android.inputmethod.japanese" dev="sdcardfs" ino=590040 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=0
      avc: denied { remove_name } for name="cache_r.m" dev="sdcardfs" ino=589868 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=0
      avc: denied { getattr } for path="/mnt/runtime/default/emulated/0/Android/data/.nomedia" dev="sdcardfs" ino=589831 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=1
      
      Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
      Bug: 37486230
      Change-Id: Icfd00a9ba379b1f50c48fe85849304cf9859bcb2
      72f4c619
  2. Apr 21, 2017
    • Jaekyun Seok's avatar
      Allow installd to read vendor_overlay_file · aeada247
      Jaekyun Seok authored
      installd needs to check whether idmap is outdated or not compared to
      vendor overlay file.
      
      Test: building succeeded and tested on sailfish.
      Bug: 37179531
      Change-Id: I934c1ae39e3f806bca1e3d68cf8190addeebb499
      aeada247
  3. Apr 06, 2017
    • Sandeep Patil's avatar
      sepolicy: restrict /vendor/app from most coredomains · 1b5f81a2
      Sandeep Patil authored
      
      The change makes 'vendor_app_file' accessible only to few platform
      domains like dex2oat, idmap, installd, system_server and appdomain.
      
      Bug: 36681210
      Test: Boot sailfish (treble device) from wiped flashall
      Test: Connect to wifi and launch chrome to load few websites.
      Test: Launch camera and record + playback video
      
      Change-Id: Ib8757fedbf2e19c8381c8cd0f8f2693b2345534b
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      1b5f81a2
  4. Mar 29, 2017
    • Sandeep Patil's avatar
      seapp_context: explicitly label all seapp context files · 1e149967
      Sandeep Patil authored
      
      seapp_context files need to be explicitly labeled as they are now split
      cross system and vendor and won't have the generic world readable
      'system_file' label.
      
      Bug: 36002414
      Test: no new 'seapp_context' denials at boot complete on sailfish
      Test: successfully booted into recovery without denials and sideloaded
            OTA update.
      Test: ./cts-tradefed run singleCommand cts --skip-device-info \
            --skip-preconditions --skip-connectivity-check --abi \
            arm64-v8a --module CtsSecurityHostTestCases -t \
            android.security.cts.SELinuxHostTest#testAospSeappContexts
      Test: Launch 'chrome' and succesfully load a website.
      Test: Launch Camera and take a picture.
      Test: Launch Camera and record a video, succesfully playback recorded
            video
      
      Change-Id: I19b3e50c6a7c292713d3e56ef0448acf6e4270f7
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      1e149967
    • Sandeep Patil's avatar
      file_context: explicitly label all file context files · c9cf7361
      Sandeep Patil authored
      
      file_context files need to be explicitly labeled as they are now split
      across system and vendor and won't have the generic world readable
      'system_file' label.
      
      Bug: 36002414
      Test: no new 'file_context' denials at boot complete on sailfish
      Test: successfully booted into recovery without denials and sideloaded
      OTA update.
      Test: ./cts-tradefed run singleCommand cts --skip-device-info \
             --skip-preconditions --skip-connectivity-check --abi \
             arm64-v8a --module CtsSecurityHostTestCases -t \
             android.security.cts.SELinuxHostTest#testAospFileContexts
      
      Change-Id: I603157e9fa7d1de3679d41e343de397631666273
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      c9cf7361
  5. Mar 15, 2017
    • Fyodor Kupolov's avatar
      Split preloads into media_file and data_file · b238fe66
      Fyodor Kupolov authored
      Untrusted apps should only access /data/preloads/media and demo directory.
      
      Bug: 36197686
      Test: Verified retail mode.
            Checked non-privileged APK cannot access /data/preloads
      Change-Id: I8e9c21ff6aba799aa31bf06893cdf60dafc04446
      b238fe66
  6. Mar 07, 2017
    • Calin Juravle's avatar
      SElinux: Clean up code related to foreign dex use · 2b291121
      Calin Juravle authored
      We simplified the way we track whether or not a dex file is used by
      other apps. DexManager in the framework keeps track of the data and we
      no longer need file markers on disk.
      
      Test: device boots, foreign dex markers are not created anymore
      
      Bug: 32871170
      Change-Id: I464ed6b09439cf0342020ee07596f9aa8ae53b62
      2b291121
  7. Feb 23, 2017
    • Fyodor Kupolov's avatar
      Allow installd to delete from preloads/file_cache · a64b6850
      Fyodor Kupolov authored
      When clearing cache, installd should be able to search for and delete
      files in /data/preloads/file_cache
      
      Test: Manually trigger installd freeCache
      Bug: 31008665
      Change-Id: I4c345cc8b0f7a6a8702a55f4720d21283c9d502a
      a64b6850
  8. Feb 06, 2017
  9. Jan 26, 2017
    • William Roberts's avatar
      te_macros: introduce add_service() macro · 606d2fd6
      William Roberts authored
      
      Introduce the add_service() macro which wraps up add/find
      permissions for the source domain with a neverallow preventing
      others from adding it. Only a particular domain should
      add a particular service.
      
      Use the add_service() macro to automatically add a neverallow
      that prevents other domains from adding the service.
      
      mediadrmserver was adding services labeled mediaserver_service.
      Drop the add permission as it should just need the find
      permission.
      
      Additionally, the macro adds the { add find } permission which
      causes some existing neverallow's to assert. Adjust those
      neverallow's so "self" can always find.
      
      Test: compile and run on hikey and emulator. No new denials were
      found, and all services, where applicable, seem to be running OK.
      
      Change-Id: Ibbd2a5304edd5f8b877bc86852b0694732be993c
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      606d2fd6
  10. 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
  11. 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
  12. 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
  13. 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
  14. Nov 12, 2016
  15. 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
  16. Oct 07, 2016
  17. 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
  18. 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
  19. Sep 10, 2016
  20. Sep 09, 2016
  21. Aug 29, 2016
  22. 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
  23. 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
  24. Jun 06, 2016
  25. Jun 01, 2016
  26. 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
  27. Mar 11, 2016
  28. 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
  29. Feb 19, 2016
  30. Feb 05, 2016
  31. Nov 25, 2015
  32. Nov 16, 2015
  33. 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
  34. 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
  35. 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
  36. 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
  37. Jun 05, 2015
  38. 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
  39. 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
Loading