Skip to content
Snippets Groups Projects
  1. Jul 05, 2017
  2. Jun 19, 2017
    • Jin Qian's avatar
      allow recovery to run mke2fs tools · 7e577318
      Jin Qian authored
      recovery exec /system/bin/{mke2fs,e2fsdroid} to format userdata
      
      Bug: 35219933
      Change-Id: I77e75c2dc55d4bea7984707f27bc215de186c4d1
      7e577318
  3. Jun 14, 2017
    • Jeff Vander Stoep's avatar
      recovery: clean up audit logspam · ea1d6e7d
      Jeff Vander Stoep authored
      avc: granted { search } scontext=u:r:recovery:s0 tcontext=u:object_r:cache_file:s0 tclass=dir
      avc: granted { getattr } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read open } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      avc: granted { read } scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      avc: granted { read open } scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      avc: granted { search } scontext=u:r:recovery:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir
      
      Fixes: 62619253
      Test: policy builds, no more "granted" messages in dmesg for recovery.
      Change-Id: I3f6d8ceee80307a01a8fd40cb4f8362a9825b1a3
      ea1d6e7d
  4. Jun 08, 2017
  5. May 25, 2017
  6. 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
  7. May 10, 2017
    • Tao Bao's avatar
      recovery.te: Allow setting sys.usb.ffs.ready. · ce5ca4d0
      Tao Bao authored
      This is needed for devices using configfs, where init listens for
      sys.usb.ffs.ready=1 to config usb_gadget. When recovery starts
      sideloading, minadbd (forked from recovery) sets the property to trigger
      that action.
      
      avc:  denied  { set } for property=sys.usb.ffs.ready pid=541 uid=0 gid=0
      scontext=u:r:recovery:s0 tcontext=u:object_r:ffs_prop:s0
      tclass=property_service
      
      Bug: 35803743
      Test: Device shows up in sideload mode.
      Change-Id: Ie7f1224d3a8650160ac29811f73b8286fbced4f4
      ce5ca4d0
  8. Apr 19, 2017
  9. Apr 14, 2017
    • Tianjie Xu's avatar
      Allow recovery to read thermal info on sailfish · 71bccc7a
      Tianjie Xu authored
      Encountered more denials on sailfish:
      
      avc:  denied  { read } for  pid=439 comm="recovery" name="thermal"
      dev="sysfs" ino=28516 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=0
      
      avc:  denied  { read } for  pid=441 comm="recovery"
      name="thermal_zone9" dev="sysfs" ino=40364 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=lnk_file permissive=0
      
      Bug: 36920500
      Test: sideload a package in sailfish
      (cherry picked from commit b4e4565d)
      
      Change-Id: I46b14babd47168e87c0d30ec06281aaa237563bf
      71bccc7a
    • Tianjie Xu's avatar
      Allow recovery to read thermal info on sailfish · b4e4565d
      Tianjie Xu authored
      Encountered more denials on sailfish:
      
      avc:  denied  { read } for  pid=439 comm="recovery" name="thermal"
      dev="sysfs" ino=28516 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=0
      
      avc:  denied  { read } for  pid=441 comm="recovery"
      name="thermal_zone9" dev="sysfs" ino=40364 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=lnk_file permissive=0
      
      Bug: 36920500
      Test: sideload a package in sailfish
      Change-Id: Ib4e89ba48cdc383318e5f3b7b15f542434e43564
      b4e4565d
  10. Apr 07, 2017
    • Tianjie Xu's avatar
      Allow recovery to read thermal info · 15bf1b52
      Tianjie Xu authored
      We want to track temperature metrics during an OTA update.
      
      denial message:
      denied  { search } for  pid=349 comm="recovery" name="thermal"
      dev="sysfs" ino=18029 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=0
      
      denied  { read } for  pid=326 comm="recovery" name="temp"
      dev="sysfs" ino=18479 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=0
      
      Bug: 36920500
      Bug: 32518487
      Test: temperature logs on angler
      Change-Id: Ib70c1c7b4e05f91a6360ff134a11c80537d6015e
      (cherry picked from commit 3da2f21f)
      15bf1b52
  11. Apr 06, 2017
    • Tianjie Xu's avatar
      Allow recovery to read thermal info · 3da2f21f
      Tianjie Xu authored
      We want to track temperature metrics during an OTA update.
      
      denial message:
      denied  { search } for  pid=349 comm="recovery" name="thermal"
      dev="sysfs" ino=18029 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=0
      
      denied  { read } for  pid=326 comm="recovery" name="temp"
      dev="sysfs" ino=18479 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=0
      
      Bug: 36920500
      Bug: 32518487
      Test: temperature logs on angler
      Change-Id: Ib70c1c7b4e05f91a6360ff134a11c80537d6015e
      3da2f21f
  12. Mar 29, 2017
    • 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
  13. Mar 20, 2017
    • Alex Klyubin's avatar
      Recovery can use HALs only in passthrough mode · 00a03d42
      Alex Klyubin authored
      This adjusts the grants for recovery to make it explicit that recovery
      can use the Boot Control HAL only in passthrough mode.
      
      Test: Device boots up, no new denials
      Test: Reboot into recovery, sideload OTA update succeeds
      Test: Apply OTA update via update_engine:
            1. make dist
            2. Ensure device has network connectivity
            3. ota_call.py -s <serial here> out/dist/sailfish-ota-*.zip
      Bug: 34170079
      
      Change-Id: I0888816eca4d77939a55a7816e6cae9176713ee5
      00a03d42
  14. Mar 18, 2017
    • Alex Klyubin's avatar
      Switch Boot Control HAL policy to _client/_server · 09d13e73
      Alex Klyubin authored
      This switches Boot Control HAL policy to the design which enables us
      to conditionally remove unnecessary rules from domains which are
      clients of Boot Control HAL.
      
      Domains which are clients of Boot Control HAL, such as update_server,
      are granted rules targeting hal_bootctl only when the Boot Control HAL
      runs in passthrough mode (i.e., inside the client's process). When the
      HAL runs in binderized mode (i.e., in another process/domain, with
      clients talking to the HAL over HwBinder IPC), rules targeting
      hal_bootctl are not granted to client domains.
      
      Domains which offer a binderized implementation of Boot Control HAL,
      such as hal_bootctl_default domain, are always granted rules targeting
      hal_bootctl.
      
      P. S. This commit removes direct access to Boot Control HAL from
      system_server because system_server is not a client of this HAL. This
      commit also removes bootctrl_block_device type which is no longer
      used. Finally, boot_control_hal attribute is removed because it is now
      covered by the hal_bootctl attribute.
      
      Test: Device boots up, no new denials
      Test: Reboot into recovery, sideload OTA update succeeds
      Test: Apply OTA update via update_engine:
            1. make dist
            2. Ensure device has network connectivity
            3. ota_call.py -s <serial here> out/dist/sailfish-ota-*.zip
      Bug: 34170079
      Change-Id: I9c410c092069e431a3852b66c04c4d2a9f1a25cf
      09d13e73
  15. Jan 31, 2017
    • Calin Juravle's avatar
      Remove SElinux audit to libart_file · 01ee59a7
      Calin Juravle authored
      Since it was introduced it caused quite a few issues and it spams the
      SElinux logs unnecessary.
      
      The end goal of the audit was to whitelist the access to the
      interpreter. However that's unfeasible for now given the complexity.
      
      Test: devices boots and everything works as expected
            no more auditallow logs
      
      Bug: 29795519
      Bug: 32871170
      Change-Id: I9a7a65835e1e1d3f81be635bed2a3acf75a264f6
      01ee59a7
  16. Jan 30, 2017
  17. Jan 11, 2017
  18. Dec 27, 2016
    • Alex Klyubin's avatar
      Fix warning in recovery.te · 9d8e3ab6
      Alex Klyubin authored
      SELinux policy compiler complained about a quote inside the
      recovery_only section of recovery.te. This section's contents are
      inside quotes and thus can't contain quotes.
      
      Test: mmm system/sepolicy produces no warnings
      Bug: 33700679
      Change-Id: I5bf943166f4f514d04472f7e59b025a9723eb1b8
      9d8e3ab6
  19. Dec 22, 2016
    • Alex Klyubin's avatar
      Restrict access to ro.serialno and ro.boot.serialno · 20151072
      Alex Klyubin authored
      This restricts access to ro.serialno and ro.boot.serialno, the two
      system properties which contain the device's serial number, to a
      select few SELinux domains which need the access. In particular, this
      removes access to these properties from Android apps. Apps can access
      the serial number via the public android.os.Build API. System
      properties are not public API for apps.
      
      The reason for the restriction is that serial number is a globally
      unique identifier which cannot be reset by the user. Thus, it can be
      used as a super-cookie by apps. Apps need to wean themselves off of
      identifiers not resettable by the user.
      
      Test: Set up fresh GMS device, install some apps via Play, update some apps, use Chrome
      Test: Access the device via ADB (ADBD exposes serial number)
      Test: Enable MTP over USB, use mtp-detect to confirm that serial number is reported in MTP DeviceInfo
      Bug: 31402365
      Bug: 33700679
      Change-Id: I4713133b8d78dbc63d8272503e80cd2ffd63a2a7
      20151072
  20. Nov 22, 2016
    • Tao Bao's avatar
      recovery.te: Allow writing to sysfs_devices_system_cpu. · ee7960c0
      Tao Bao authored
      recovery (update_binary) may need to set up cpufreq during an update.
      
      avc:  denied  { write } for  pid=335 comm="update_binary" name="scaling_max_freq" dev="sysfs" ino=7410 scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs_devices_system_cpu:s0 tclass=file permissive=0
      
      Bug: 32463933
      Test: Build a recovery image and apply an OTA package that writes to
            /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq.
      
      Change-Id: Ia90af9dd15e162dd94bcd4722b66aa296e3058c5
      ee7960c0
  21. Oct 14, 2016
  22. 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
  23. Sep 27, 2016
    • Jeff Vander Stoep's avatar
      Audit access to libart · 88cef4df
      Jeff Vander Stoep authored
      Grant access to all processes and audit access. The end goal is to
      whitelist all access to the interpreter. Several processes including
      dex2oat, apps, and zygote were observed using libart, so omit them
      from auditing and explicitly grant them access.
      
      Test: Angler builds and boots
      
      Bug: 29795519
      Change-Id: I9b93c7dbef5c49b95a18fd26307955d05a1c8e88
      88cef4df
  24. Aug 10, 2016
    • Alex Deymo's avatar
      Allow executing update_engine_sideload from recovery. · 27f19427
      Alex Deymo authored
      The recovery flow for A/B devices allows to sideload an OTA downloaded
      to a desktop and apply from recovery. This patch allows the "recovery"
      context to perform all the operations required to apply an update as
      update_engine would do in the background. These rules are now extracted
      into a new attributte called update_engine_common shared between
      recovery and update_engine.
      
      Bug: 27178350
      
      (cherry picked from commit d63084d3)
      
      Change-Id: I1f3e1e83a21e37e09b69cd9c497f87b42b9cbeb1
      27f19427
  25. Aug 09, 2016
    • Alex Deymo's avatar
      Allow executing update_engine_sideload from recovery. · d63084d3
      Alex Deymo authored
      The recovery flow for A/B devices allows to sideload an OTA downloaded
      to a desktop and apply from recovery. This patch allows the "recovery"
      context to perform all the operations required to apply an update as
      update_engine would do in the background. These rules are now extracted
      into a new attributte called update_engine_common shared between
      recovery and update_engine.
      
      Bug: 27178350
      Change-Id: I97b301cb2c039fb002e8ebfb23c3599463ced03a
      d63084d3
  26. Feb 23, 2016
  27. Feb 19, 2016
  28. Jan 26, 2016
  29. 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
  30. 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
  31. Aug 25, 2015
    • Stephen Smalley's avatar
      Only allow toolbox exec where /system exec was already allowed. · a3c97a76
      Stephen Smalley authored
      
      When the toolbox domain was introduced, we allowed all domains to exec it
      to avoid breakage.  However, only domains that were previously allowed the
      ability to exec /system files would have been able to do this prior to the
      introduction of the toolbox domain.  Remove the rule from domain.te and add
      rules to all domains that are already allowed execute_no_trans to system_file.
      Requires coordination with device-specific policy changes with the same Change-Id.
      
      Change-Id: Ie46209f0412f9914857dc3d7c6b0917b7031aae5
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      a3c97a76
  32. Jun 10, 2015
  33. May 15, 2015
    • Jeff Sharkey's avatar
      drop_caches label, vold scratch space on expanded. · c960596c
      Jeff Sharkey authored
      Define an explicit label for /proc/sys/vm/drop_caches and grant to
      the various people who need it, including vold which uses it when
      performing storage benchmarks.
      
      Also let vold create new directories under it's private storage area
      where the benchmarks will be carried out.  Mirror the definition of
      the private storage area on expanded media.
      
      avc: denied { write } for name="drop_caches" dev="proc" ino=20524 scontext=u:r:vold:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=0
      
      Bug: 21172095
      Change-Id: I300b1cdbd235ff60e64064d3ba6e5ea783baf23f
      c960596c
  34. May 07, 2015
    • William Roberts's avatar
      Replace unix_socket_connect() and explicit property sets with macro · 2f5a6a96
      William Roberts authored
      
      A common source of mistakes when authoring sepolicy is properly
      setting up property sets. This is a 3 part step of:
      1. Allowing the unix domain connection to the init/property service
      2. Allowing write on the property_socket file
      3. Allowing the set on class property_service
      
      The macro unix_socket_connect() handled 1 and 2, but could be
      confusing for first time policy authors. 3 had to be explicitly
      added.
      
      To correct this, we introduce a new macros:
      set_prop(sourcedomain, targetprop)
      
      This macro handles steps 1, 2 and 3.
      
      No difference in sediff is expected.
      
      (cherrypicked from commit 625a3526)
      
      Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@linux.intel.com>
      2f5a6a96
    • William Roberts's avatar
      Replace unix_socket_connect() and explicit property sets with macro · 625a3526
      William Roberts authored
      
      A common source of mistakes when authoring sepolicy is properly
      setting up property sets. This is a 3 part step of:
      1. Allowing the unix domain connection to the init/property service
      2. Allowing write on the property_socket file
      3. Allowing the set on class property_service
      
      The macro unix_socket_connect() handled 1 and 2, but could be
      confusing for first time policy authors. 3 had to be explicitly
      added.
      
      To correct this, we introduce a new macros:
      set_prop(sourcedomain, targetprop)
      
      This macro handles steps 1, 2 and 3.
      
      No difference in sediff is expected.
      
      Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@linux.intel.com>
      625a3526
  35. Mar 05, 2015
  36. Dec 09, 2014
  37. Nov 05, 2014
    • Nick Kralevich's avatar
      recovery.te: add /data neverallow rules · a17a266e
      Nick Kralevich authored
      Recovery should never be accessing files from /data.
      In particular, /data may be encrypted, and the files within
      /data will be inaccessible to recovery, because recovery doesn't
      know the decryption key.
      
      Enforce write/execute restrictions on recovery. We can't tighten
      it up further because domain.te contains some /data read-only
      access rules, which shouldn't apply to recovery but do.
      
      Create neverallow_macros, used for storing permission macros
      useful for neverallow rules. Standardize recovery.te and
      property_data_file on the new macros.
      
      Change-Id: I02346ab924fe2fdb2edc7659cb68c4f8dffa1e88
      a17a266e
Loading