Skip to content
Snippets Groups Projects
  1. Apr 06, 2018
    • Alan Stokes's avatar
      Installd doesn't need to create cgroup files. · 8e8c1093
      Alan Stokes authored
      cgroupfs doesn't allow files to be created, so this can't be needed.
      
      Also remove redundant neverallow and dontaudit rules. These are now
      more broadly handled by domain.te.
      
      Bug: 74182216
      
      Test: Denials remain silenced.
      
      Change-Id: If7eb0e59f567695d987272a2fd36dbc251516e9f
      8e8c1093
  2. Nov 21, 2017
    • Benjamin Gordon's avatar
      sepolicy: Add rules for non-init namespaces · 9b2e0cbe
      Benjamin Gordon authored
      In kernel 4.7, the capability and capability2 classes were split apart
      from cap_userns and cap2_userns (see kernel commit
      8e4ff6f228e4722cac74db716e308d1da33d744f). Since then, Android cannot be
      run in a container with SELinux in enforcing mode.
      
      This change applies the existing capability rules to user namespaces as
      well as the root namespace so that Android running in a container
      behaves the same on pre- and post-4.7 kernels.
      
      This is essentially:
        1. New global_capability_class_set and global_capability2_class_set
           that match capability+cap_userns and capability2+cap2_userns,
           respectively.
        2. s/self:capability/self:global_capability_class_set/g
        3. s/self:capability2/self:global_capability2_class_set/g
        4. Add cap_userns and cap2_userns to the existing capability_class_set
           so that it covers all capabilities.  This set was used by several
           neverallow and dontaudit rules, and I confirmed that the new
           classes are still appropriate.
      
      Test: diff new policy against old and confirm that all new rules add
            only cap_userns or cap2_userns;
            Boot ARC++ on a device with the 4.12 kernel.
      Bug: crbug.com/754831
      
      Change-Id: I4007eb3a2ecd01b062c4c78d9afee71c530df95f
      9b2e0cbe
  3. Oct 27, 2017
    • Calin Juravle's avatar
      Allow installd to read system_data_file:lnk_file · 97b08903
      Calin Juravle authored
      The permission was removed in
      https://android-review.googlesource.com/#/c/platform/system/sepolicy/+/433615/
      but is still needed in order to optimize application code.
      
      Denial example:
      
      10-26 16:29:51.234   894  1469 D PackageManager.DexOptimizer: Running
      dexopt on: /data/user/0/com.google.android.gms/snet/installed/snet.jar
      pkg=com.google.android.gms isa=[arm64]
      dexoptFlags=boot_complete,public,secondary,force,storage_ce
      target-filter=quicken
      
      10-26 16:29:51.253  2148  2148 W Binder:695_5: type=1400 audit(0.0:39):
      avc: denied { read } for name="0" dev="sda35" ino=917506
      scontext=u:r:installd:s0 tcontext=u:object_r:system_data_file:s0
      tclass=lnk_file permissive=0
      
      Test: adb shell cmd package reconcile-secondary-dex-files
      com.google.android.googlequicksearchbox
      adb shell cmd package compile -m speed --secondary-dex
      com.google.android.gms
      
      Change-Id: I694d1a780e58fa953d9ebda807f5f5293dbb0d56
      97b08903
  4. Jul 24, 2017
    • Jeff Vander Stoep's avatar
      Move domain_deprecated into private policy · 7c34e83f
      Jeff Vander Stoep authored
      This attribute is being actively removed from policy. Since
      attributes are not being versioned, partners must not be able to
      access and use this attribute. Move it from private and verify in
      the logs that rild and tee are not using these permissions.
      
      Bug: 38316109
      Test: build and boot Marlin
      Test: Verify that rild and tee are not being granted any of these
            permissions.
      Merged-In: I31beeb5bdf3885195310b086c1af3432dc6a349b
      Change-Id: I31beeb5bdf3885195310b086c1af3432dc6a349b
      (cherry picked from commit 76aab82c)
      7c34e83f
  5. Jul 23, 2017
    • Jeff Vander Stoep's avatar
      domain_deprecate: remove system_data_file access · 2b75437d
      Jeff Vander Stoep authored
      scontext=installd
      avc: granted { getattr } for comm="Binder:1153_7" path="/data/user/0"
      dev="sda13" ino=1097730 scontext=u:r:installd:s0
      tcontext=u:object_r:system_data_file:s0 tclass=lnk_file
      
      scontext=runas
      avc: granted { getattr } for comm="run-as" path="/data/user/0"
      dev="sda35" ino=942082 scontext=u:r:runas:s0
      tcontext=u:object_r:system_data_file:s0 tclass=lnk_file
      
      scontext=vold
      avc: granted { getattr } for comm="vold" path="/data/data" dev="sda45"
      ino=12 scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
      tclass=lnk_file
      avc: granted { read } for comm="secdiscard"
      name="3982c444973581d4.spblob" dev="sda45" ino=4620302
      scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
      tclass=file
      
      Bug: 28760354
      Test: Build
      Change-Id: Id16c43090675572af35f1ad9defd4c368abc906b
      2b75437d
  6. Jul 03, 2017
    • Jeff Sharkey's avatar
      Allow installd to delete files via sdcardfs. · dd57e698
      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
      (cherry picked from commit 72f4c619)
      dd57e698
  7. May 15, 2017
    • Jeff Vander Stoep's avatar
      Move domain_deprecated into private policy · 76aab82c
      Jeff Vander Stoep authored
      This attribute is being actively removed from policy. Since
      attributes are not being versioned, partners must not be able to
      access and use this attribute. Move it from private and verify in
      the logs that rild and tee are not using these permissions.
      
      Bug: 38316109
      Test: build and boot Marlin
      Test: Verify that rild and tee are not being granted any of these
            permissions.
      Change-Id: I31beeb5bdf3885195310b086c1af3432dc6a349b
      76aab82c
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. Feb 06, 2017
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. Nov 12, 2016
  22. 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
  23. Oct 07, 2016
  24. 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
  25. 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
  26. Sep 10, 2016
  27. Sep 09, 2016
  28. Aug 29, 2016
  29. 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
  30. 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
  31. Jun 06, 2016
  32. Jun 01, 2016
  33. 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
  34. Mar 11, 2016
  35. 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
  36. Feb 19, 2016
  37. Feb 05, 2016
  38. Nov 25, 2015
  39. Nov 16, 2015
Loading