Skip to content
Snippets Groups Projects
  1. Aug 06, 2018
  2. Aug 03, 2018
    • Nick Kralevich's avatar
      Change priv-apps /home/home labels to privapp_data_file · 4df57822
      Nick Kralevich authored
      Currently, both untrusted apps and priv-apps use the SELinux file label
      "app_data_file" for files in their /data/data directory. This is
      problematic, as we really want different rules for such files. For
      example, we may want to allow untrusted apps to load executable code
      from priv-app directories, but disallow untrusted apps from loading
      executable code from their own home directories.
      
      Commit 23c9d91b introduced a new type
      called privapp_data_file and added rules necessary to preserve
      compatibility. However, that change did not relabel any existing files,
      so effectively the change was a no-op.
      
      This change performs the switch, relabeling priv-app's /data/data files
      from app_data_file to privapp_data_file. Due to the compatibility rules
      added in 23c9d91b, there should be no
      noticeable effect from this change.
      
      Test: Factory reset and boot - no problems on fresh install.
      Test: Upgrade to new version and test. No compatibility problems on
            filesystem upgrade.
      
      Merged-In: I9a476726bf01f4bcc7952d11fd57dba803a9fd8d
      Change-Id: I23a26cd3906fc43cbd225c05c3a2abd3cab8bd06
      4df57822
    • Tom Cherry's avatar
      Allow init to execute services marked with seclabel u:r:su:s0 in userdebug/eng · 938ab05d
      Tom Cherry authored
      This is do aid developers pushing debug services to not need to modify
      the underlying SEPolicy
      
      avc: denied { transition } for comm="init" path="/system/bin/awk"
      dev="dm-0" ino=1934 scontext=u:r:init:s0 tcontext=u:r:su:s0
      tclass=process
      avc: denied { rlimitinh } for comm="awk" scontext=u:r:init:s0
      tcontext=u:r:su:s0 tclass=process
      avc: denied { siginh } for comm="awk" scontext=u:r:init:s0
      tcontext=u:r:su:s0 tclass=process
      avc: denied { noatsecure } for comm="awk" scontext=u:r:init:s0
      tcontext=u:r:su:s0 tclass=process
      
      Test: init can execute a system_file marked with seclabel u:r:su:s0
      Change-Id: I85d9528341fe08dbb2fb9a91e34a41f41aa093be
      938ab05d
    • Tom Cherry's avatar
      Move watchdogd out of init and into its own domain · d840374e
      Tom Cherry authored
      Bug: 73660730
      Test: watchdogd still runs
      Change-Id: I31697c7c6fa2f7009731ff48c659af051838e42f
      d840374e
  3. Aug 02, 2018
    • Nick Kralevich's avatar
      Start partitioning off privapp_data_file from app_data_file · 23c9d91b
      Nick Kralevich authored
      Currently, both untrusted apps and priv-apps use the SELinux file label
      "app_data_file" for files in their /data/data directory. This is
      problematic, as we really want different rules for such files. For
      example, we may want to allow untrusted apps to load executable code
      from priv-app directories, but disallow untrusted apps from loading
      executable code from their own home directories.
      
      This change adds a new file type "privapp_data_file". For compatibility,
      we adjust the policy to support access privapp_data_files almost
      everywhere we were previously granting access to app_data_files
      (adbd and run-as being exceptions). Additional future tightening is
      possible here by removing some of these newly added rules.
      
      This label will start getting used in a followup change to
      system/sepolicy/private/seapp_contexts, similar to:
      
        -user=_app isPrivApp=true domain=priv_app type=app_data_file levelFrom=user
        +user=_app isPrivApp=true domain=priv_app type=privapp_data_file levelFrom=user
      
      For now, this newly introduced label has no usage, so this change
      is essentially a no-op.
      
      Test: Factory reset and boot - no problems on fresh install.
      Test: Upgrade to new version and test. No compatibility problems on
            filesystem upgrade.
      
      Change-Id: I9618b7d91d1c2bcb5837cdabc949f0cf741a2837
      23c9d91b
    • Alan Stokes's avatar
      Remove legacy execmod access. · 0f11ffcc
      Alan Stokes authored
      Remove the exemptions for untrusted apps and broaden the neverallow so
      they can't be reinstated. Modifying executable pages is unsafe. Text
      relocations are not supported.
      
      Bug: 111544476
      Test: Builds.
      Change-Id: Ibff4f34d916e000203e38574bb063513e4428bb7
      0f11ffcc
  4. Jul 23, 2018
  5. Jul 20, 2018
    • Tri Vo's avatar
      28 mapping workaround for devices upgrading to P. · 0cc68ea0
      Tri Vo authored
      Bug: 72458734
      Test: Compile current system sepolicy with P vendor sepolicy
      Test: Plug in a P device then do:
      m selinux_policy
      cp $OUT/system/etc/selinux/plat_sepolicy.cil  plat_sepolicy.cil
      cp $ANDROID_BUILD_TOP/system/sepolicy/private/compat/28.0/28.0.cil 28.0.cil
      adb pull /vendor/etc/selinux/plat_pub_versioned.cil
      adb pull /vendor/etc/selinux/vendor_sepolicy.cil
      secilc plat_sepolicy.cil -m -M true -G -N -c 30 28.0.cil \
      plat_pub_versioned.cil vendor_sepolicy.cil
      Change-Id: I399b3a204eb94bee0ba1b5024b1c3463219c678e
      0cc68ea0
    • Alan Stokes's avatar
      Temporarily add auditing of execmod by apps. · 708aa90d
      Alan Stokes authored
      This is so we can get data on which apps are actually doing this.
      
      Bug: 111544476
      Test: Device boots. No audits seen on test device.
      Change-Id: I5f72200ed8606775904d353c4d3d790373fe7dea
      708aa90d
  6. Jul 19, 2018
    • Jae Shin's avatar
      Add mapping files for 28.0.[ignore.]cil · 1fa96348
      Jae Shin authored
      Steps taken to produce the mapping files:
      
      1. Add prebuilts/api/28.0/[plat_pub_versioned.cil|vendor_sepolicy.cil]
      from the /vendor/etc/selinux/[plat_pub_versioned.cil|vendor_sepolicy.cil]
      files built on pi-dev with lunch target aosp_arm64-eng
      
      2. Add new file private/compat/28.0/28.0.cil by doing the following:
      - copy /system/etc/selinux/mapping/28.0.cil from pi-dev aosp_arm64-eng
      device to private/compat/28.0/28.0.cil
      - remove all attribute declaration statement (typeattribute ...) and
      sort lines alphabetically
      - some selinux types were added/renamed/deleted w.r.t 28 sepolicy.
      Find all such types using treble_sepolicy_tests_28.0 test.
      - for all these types figure out where to map them by looking at
      27.0.[ignore.]cil files and add approprite entries to 28.0.[ignore.]cil.
      
      This change also enables treble_sepolicy_tests_28.0 and install 28.0.cil
      mapping onto the device.
      
      Bug: 72458734
      Test: m selinux_policy
      Change-Id: I90e17c0b43af436da4b62c16179c198b5c74002c
      1fa96348
  7. Jul 17, 2018
  8. Jul 14, 2018
    • Steven Thomas's avatar
      Selinux changes for vr flinger vsync service · 7bec9674
      Steven Thomas authored
      Add selinux policy for the new Binder-based vr flinger vsync service.
      
      Bug: 72890037
      
      Test: - Manually confirmed that I can't bind to the new vsync service
      from a normal Android application, and system processes (other than
      vr_hwc) are prevented from connecting by selinux.
      
      - Confirmed the CTS test
        android.security.cts.SELinuxHostTest#testAospServiceContexts, when
        built from the local source tree with this CL applied, passes.
      
      - Confirmed the CTS test
        android.cts.security.SELinuxNeverallowRulesTest#testNeverallowRules521,
        when built from the local source tree with this CL applied, passes.
      
      Change-Id: Ib7a6bfcb1c2ebe1051f3accc18b481be1b188b06
      7bec9674
  9. Jul 03, 2018
  10. Jul 02, 2018
    • Yabin Cui's avatar
      Export more files in proc_perf. · 09464811
      Yabin Cui authored
      Export /proc/sys/kernel/perf_cpu_time_max_percent and
      /proc/sys/kernel/perf_event_mlock_kb in proc_perf. So
      they can be read in shell and written by init.
      
      This is needed by simpleperf to control cpu percent and
      memory used for profiling.
      
      Bug: 110706031
      Test: build and boot hikey960 successfully.
      
      Change-Id: I2a01f583508003ab73427bab30a7982a27dfa677
      09464811
    • Pawin Vongmasa's avatar
      Allow surfaceflinger to call into mediacodec · ff2dccaf
      Pawin Vongmasa authored
      Test: adb logcat | grep "Wrong interface type."
      
      Bug: 77924251
      Change-Id: Idf9d7ae6db0d41bb0c2f94b2183bfe23f0c21155
      ff2dccaf
  11. Jun 29, 2018
    • Todd Poynor's avatar
      remove thermalcallback_hwservice · c6afcb7f
      Todd Poynor authored
      This hwservice isn't registered with hwservicemanager but rather passed
      to the thermal hal, so it doesn't need sepolicy associated with it to
      do so.
      
      Test: manual: boot, inspect logs
      Test: VtsHalThermalV1_1TargetTest
      Bug: 109802374
      Change-Id: Ifb727572bf8eebddc58deba6c0ce513008e01861
      Merged-In: Ifb727572bf8eebddc58deba6c0ce513008e01861
      c6afcb7f
    • Jeff Vander Stoep's avatar
      priv_app: dontaudit read access to default sysfs label · 4894d9fd
      Jeff Vander Stoep authored
      Suppress selinux logspam for non-API files in /sys.
      
      Bug: 110914297
      Test: build
      Change-Id: I9b3bcf2dbf80f282ae5c74b61df360c85d02483c
      4894d9fd
    • Bowgo Tsai's avatar
      Sepolicy for rw mount point for product extensions. · c287032f
      Bowgo Tsai authored
      Bug: 110808288
      Test: device boots with /mnt/product present and selinux label
            mnt_product_file applied correctly.
      
      Change-Id: I596e4b79285fe1a79d31ad1b07f4bcffe6a6cd98
      c287032f
  12. Jun 28, 2018
  13. Jun 27, 2018
  14. Jun 26, 2018
  15. Jun 25, 2018
    • Eino-Ville Talvala's avatar
      Make system property audio.camerasound.force a vendor-writable property, · 3ac71f8d
      Eino-Ville Talvala authored
      This property is read by the audio service in system server to toggle
      camera shutter sound enforcement on a device-specific basis.
      
      Test: Camera shutter sound enforcement works when audio.camerasound.force is set
      Bug: 110126976
      Change-Id: I2720d3c699c4712d1a328f59dde0b16bbf1016f3
      3ac71f8d
    • Neil Fuller's avatar
      Add label for time (zone) system properties · b794ad0f
      Neil Fuller authored
      This adds a label for system properties that will affect system-wide
      time / time detection logic.
      
      The first example will be something like:
      persist.time.detection_impl_version
      
      Bug: 78217059
      Test: build
      Change-Id: I46044f1e28170760001da9acf2496a1e3037e48a
      b794ad0f
  16. Jun 22, 2018
    • Peiyong Lin's avatar
      Allow SurfaceFlinger to use Power HAL. · 02be5975
      Peiyong Lin authored
      When we have wide color gamut content, SurfaceFlinger might want to send a
      PowerHint through Power Hal to boost GPU to higher frequency, to make sure GPU
      composition can finish in time.
      
      BUG: 110112323
      Test: adb shell cat /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq
      Change-Id: If60c13aedc4ff84eaefd3430794dc15a478c5a73
      02be5975
    • Jeff Vander Stoep's avatar
      Update socket ioctl restrictions · 0597ade1
      Jeff Vander Stoep authored
      Grant access to icmp_socket to netdomain. This was previously
      labeled as rawip_socket which apps are allowed to use. Neverallow
      all other new socket types for apps.
      
      Kernels versions > 4.9 redefine ICMP sockets from rawip_socket
      to icmp_socket. To pass neverallow tests, we need to define
      which IOCTLs are allowed (and disallowed).
      
      Note that this does not change behavior on devices with
      kernel versions <=4.9. However, it is necessary (although not
      sufficient) to pass CTS on kernel version 4.14.
      
      Bug: 110520616
      Test: Grant icmp_socket in net.te and build.
      Change-Id: I5c7cb6867d1a4cd1554a8da0d55daa8e06daf803
      0597ade1
  17. Jun 21, 2018
    • Dario Freni's avatar
      Add a rule for /product-services partition. · 53a07637
      Dario Freni authored
      Like /system and /product, /product-services will contain apps that
      should have the same privileges as the one in other system partitions.
      
      Bug: 80741439
      Test: successfully tested e2e on two devices, one with
      /product-services partition and another with /product-services
      symlinking to -> /system/product-services
      Change-Id: Ieee7a9a7641a178f44bb406dbdef39ed46713899
      53a07637
  18. Jun 19, 2018
    • Neil Fuller's avatar
      sepolicy entries for time zone detector service · 1662495a
      Neil Fuller authored
      Add sepolicy entries for the new time zone detector service.
      
      The timezonedetector_service will be called from the
      telephony process.
      
      Bug: 78217059
      Test: make / booted device
      Change-Id: Ib719a4bb444b2af7dd71910fb0bd12992df9d88c
      1662495a
    • Neil Fuller's avatar
      Remove unnecessary permission · 63c90460
      Neil Fuller authored
      There will likely be no need for platform apps
      to call the timedetector_service; it was added
      in error.
      
      Bug: 78217059
      Test: build / boot
      Change-Id: Ie299c92a60f26fe6cb00562219e386a9f13e459f
      63c90460
  19. Jun 14, 2018
    • Mark Salyzyn's avatar
      access to /proc/slabinfo · d6eaed85
      Mark Salyzyn authored
      init, dumpstate and shell
      
      Test: check avc for init is now gone
      Bug: 7232205
      Bug: 109821005
      Change-Id: I299a0ba29bcc97a97047f12a5c48f6056f5e6de5
      d6eaed85
  20. Jun 11, 2018
    • Mark Salyzyn's avatar
      persist.sys.boot.reason is cleared once read by bootstat · a1bce779
      Mark Salyzyn authored
      To ensure a surprise reboot does not take the last boot reason on
      face value especially if coming from more than one boot sessions ago.
      We shift and clear the value from persist.sys.boot.reason to
      sys.boot.reason.last and establish a correct last reboot reason in
      the canonical sys.boot.reason property.  As a result, the power
      manager should read the canonical sys.boot.reason for a definitive
      result rather than relying on the possibly incorrect values in the
      persistent storage.  sys.boot.reason should be a core property as
      it represents the canonical boot reason API.
      
      Test: compile
      Bug: 86671991
      Bug: 63736262
      Change-Id: If3742c487d6c0ab69c464f056bf48c786b66a945
      a1bce779
  21. Jun 08, 2018
    • Jiyong Park's avatar
      adbd is allowed to execute shell in recovery mode · bacf3648
      Jiyong Park authored
      The shell is now available directly in the recovery ramdisk. We no
      longer need to mount system.img to /system as the recovery ramdisk is
      self-contained. However, there is a problem that every file in the
      ramdisk is labeled as rootfs because the ramdisk does not support xattr.
      
      This CL adds several recovery-only rules that are required to make the
      recovery ramdisk self-contained. Most importantly, adbd is allowed to
      domain_trans to shell. Also shell is allowe to execute files of type
      rootfs. Finally, the recovery is allowed to mount on tmpfs since it now
      mounts system.img to /mnt/system.
      
      Bug: 63673171
      Test: `adb reboot recovery; adb devices` shows the device ID
      Test: `adb root && adb shell` and then
      $ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
      the /lib directory.
      
      Change-Id: If21b069aee63541344a5ca8939fb9a46ffef4d3e
      bacf3648
  22. Jun 06, 2018
    • Neil Fuller's avatar
      Remove references to common_time / commontime · c9fa040d
      Neil Fuller authored
      This change removes references to the common time management
      service.
      
      Bug: 80462439
      Test: build / boot
      Merged-In: I2c8fca44fe05e3a35f5580d23e23a4c033075613
      Change-Id: I2c8fca44fe05e3a35f5580d23e23a4c033075613
      c9fa040d
  23. Jun 05, 2018
  24. Jun 04, 2018
    • Neil Fuller's avatar
      selinux changes to add time detector service · e1dd6d07
      Neil Fuller authored
      This commit contains the changes needed to add the new
      time detector system server service.
      
      Bug: 78217059
      Test: make / booted device
      Change-Id: I7cfaac6cac876e4aa73e8af1aa5f837117bb9ad7
      e1dd6d07
    • Jeff Vander Stoep's avatar
      Deprivilege haiku · f45db06c
      Jeff Vander Stoep authored
      Clatd and zygote
      are all overprivileged
      as is storaged
      
      Test: Verify no "granted" messages from dogfooders. Build flash
      aosp_taimen-userdebug. Verify no denials.
      Change-Id: I735adcffed553962ad12072716a7200883930dcf
      f45db06c
  25. Jun 01, 2018
  26. May 30, 2018
    • Steven Moreland's avatar
      Find hal_foo_hwservice -> you are hal_foo_client. · 8fc79818
      Steven Moreland authored
      Before, it was possible to access a hwservice without declaring
      that you were a client.
      
      This introduces the following macro:
      hal_attribute_hwservice_client(hal_foo, hal_foo_hwservice)
      
      which makes sure the above implication holds using a neverallow rule.
      
      Bug: 80319537
      Test: boot + sanity
      Change-Id: Iededae68f14f0f3bd412c1205aa3b650a54d55c6
      8fc79818
Loading