Skip to content
Snippets Groups Projects
  1. Apr 16, 2017
    • Martijn Coenen's avatar
      Remove mediacodec from binder violators. · fc80f480
      Martijn Coenen authored
      The new binder_call() lines had to be added
      because this change removes mediacodec from
      binderservicedomain (on full-treble), hence
      domains that could previously reach mediacodec
      with binder_call(domain, binderservicedomain)
      now need explicit calls instead.
      
      Test: Youtube, Netflix, Maps, Chrome, Music
      Change-Id: I3325ce20d9304bc07659fd435554cbcbacbc9829
      fc80f480
  2. Apr 15, 2017
  3. Apr 14, 2017
  4. Apr 13, 2017
    • Sandeep Patil's avatar
      toolbox: add sepolicy for vendor toybox · 4fe441fb
      Sandeep Patil authored
      
      The vendor toybox MUST always be executed without transition and
      non-vendor processes are not allowed to execute the binary.
      
      Bug: 36463595
      Test: Boot and test if system shell can run /vendor/bin/echo
            Result: requires 'su'
      
      Change-Id: Ifb9aa61f247f91fb870b99d60ac7f849ee9c6adc
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      (cherry picked from commit c112cd18e8999c0242a2560219033231a0e19898)
      4fe441fb
    • Sandeep Patil's avatar
      Do not allow priv_apps to scan all exec files · 0b943202
      Sandeep Patil authored
      
      Bug: 36463595
      Test: sailfish boots without new denials
      
      Change-Id: I4271a293b91ab262dddd4d40220cd7daaff53bf2
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      (cherry picked from commit b2586825e1ce92d637754b4c40e4d5edfd50a1a6)
      0b943202
    • Alex Klyubin's avatar
      Policy for Camera HAL HwBinder service · ab2c681f
      Alex Klyubin authored
      This adds restrictions on which domains can register this HwBinder
      service with hwservicemanager and which domains can obtain tokens for
      this service from hwservicemanager.
      
      Test: Use Google Camera app to take HDR+ photo, conventional photo,
            record video with sound, record slow motion video with sound.
            Check that the photos display correctly and that videos play
            back fine and with sound. Check that there are no SELinux
            denials to do with camera.
      Bug: 34454312
      Change-Id: Icfaeed917423510d9f97d18b013775596883ff64
      ab2c681f
    • Martijn Coenen's avatar
      Add hwservice_contexts and support for querying it. · 3ea47b92
      Martijn Coenen authored
      hwservicemanager can check hwservice_contexts files
      both from the framework and vendor partitions.
      
      Initially, have a wildcard '*' in hwservice_contexts
      that maps to a label that can be added/found from
      domain. This needs to be removed when the proper policy
      is in place.
      
      Also, grant su/shell access to hwservicemanager list
      operations, so tools like 'lshal' continue to work.
      
      Bug: 34454312
      Test: Marlin boots
      Change-Id: I3a02d97a82458692b528d85c1b8e78b6f82ea1bc
      3ea47b92
    • Jin Qian's avatar
      Allow GMSCore to call dumpsys storaged · 00a1789c
      Jin Qian authored
      Test: trigger dumpsys storaged from GMScore
      Bug: 37284569
      Change-Id: Ie734ce5487a69f8cc29dd73d470229fe81cd1176
      00a1789c
  5. Apr 12, 2017
    • Alex Klyubin's avatar
      Treble devices use binderized HALs · 22157e7a
      Alex Klyubin authored
      All HALs which are represented by hal_* attributes in SELinux policy
      are required to run in binderized mode on Treble devices. This commit
      thus makes the SELinux policy for Treble devices no longer associate
      domains in hal_x_client with hal_x attribute, which is what was
      granting domains hosting clients of hal_x the rules needed to run this
      HAL in-process. The result is that core components have now less
      access.
      
      This commit has no effect on non-Treble devices.
      
      Test: Device boots -- no new denials
      Test: Play movie using Google Play Movies and Netflix
      Test: Play YouTube clip in YouTube app and in Chrome
      Test: Unlock lock screen using fingerprint
      Test: Using Google Camera, take a photo, an HDR+ photo, record a
            video with sound, a slow motion video with sound. Photos and
            videos display/play back fine (incl. sound).
      Test: adb screencap
      Test: $ monitor
            take screenshot
      Test: In all tests, no deials to do with hal_*, except pre-existing
            denials to do with hal_gnss.
      Bug: 37160141
      Bug: 34274385
      Bug: 34170079
      Change-Id: I1ca91d43592b466114af13898f5909f41e59b521
      22157e7a
    • Phil Burk's avatar
      service_contexts: add aaudio service · 16a2cfe3
      Phil Burk authored
      
      Test: test_aaudio.cpp
      Bug: 33398120
      Change-Id: I0712f60c898136154d729ceb1103ee021cc6ab82
      Signed-off-by: default avatarPhil Burk <philburk@google.com>
      (cherry picked from commit 8b9d93f2)
      16a2cfe3
    • Dan Cashman's avatar
      Change mapping file name to reflect its platform version. · 4f9a648e
      Dan Cashman authored
      As the platform progresses in the split SELinux world, the platform
      will need to maintain mapping files back to previous platform versions
      to maintain backwards compatibility with vendor images which have SELinux
      policy written based on the older versions.  This requires shipping multiple
      mapping files with the system image so that the right one can be selected.
      Change the name and location of the mapping file to reflect this.  Also add
      a file to the vendor partition indicating which version is being targeted that
      the platform can use to determine which mapping file to choose.
      
      Bug: 36783775
      Test: Force compilation of sepolicy on-device with mapping file changed
      to new location and name, using the value reported on /vendor.
      
      Change-Id: I93ab3e52c2c80c493719dc3825bc731867ea76d4
      4f9a648e
    • Jorge Lucangeli Obes's avatar
      system_server: Report dalvikcache_data_file execute violations. · 62a1b236
      Jorge Lucangeli Obes authored
      With build/core eaa9d88cf, system_server should not be loading code
      from /data. Add an auditallow rule to report violations.
      
      Bug: 37214733
      Test: Boot marlin, no SELinux audit lines for system_server.
      Change-Id: I2e25eb144503274025bd4fc9bb519555851f6521
      (cherry picked from commit 665128fa)
      62a1b236
    • Shawn Willden's avatar
      Add keystore_key:attest_unique_id to priv_app. · a0c7f012
      Shawn Willden authored
      Only privileged apps are supposed to be able to get unique IDs from
      attestation.
      
      Test: CTS test verifies the negative condition, manual the positive
      Bug: 34671471
      Change-Id: I9ab3f71b1e11ed1d7866ff933feece73152d2578
      a0c7f012
  6. Apr 11, 2017
  7. Apr 10, 2017
    • Alex Klyubin's avatar
      Grant audioserver access to /system/lib64/hw · 2d704464
      Alex Klyubin authored
      audioserver uses an always-passthrough Allocator HAL (ashmem / mapper)
      whose .so is loaded from /system/lib64/hw.
      
      Test: Modify hal_client_domain macro to not associate client of X HAL
            with hal_x attribute. Play Google Play Movies move -- no denials
            and AV playback works.
      Bug: 37160141
      
      Change-Id: I7b88b222aba5361a6c7f0f6bb89705503255a4b1
      2d704464
    • Sandeep Patil's avatar
      sepolicy: Fix renderscript driver lookup · 3af3a13b
      Sandeep Patil authored
      
      Renderscript drivers are loaded from /vendor/lib64 by following the
      /system/vendor symlink. This change fixes a couple of things.
      - Allows all domains access to follow the symlink
      - Restores app domain permissions for /vendor for non-treble devices
      - Allow app domains to peek into /vendor/lib64, but NOT grant 'execute'
        permissions for everything. Since RS drivers can be loaded into any
        process, their vendor implementation and dependencies have been
        marked as 'same process HALs' already.
      
      Bug: 37169158
      Test: Tested on sailfish (Treble) & Angler (non-treble)
            ./cts-tradefed run cts -m CtsRenderscriptTestCases \
            --skip-device-info --skip-preconditions --skip-connectivity-check \
            --abi arm64-v8a
            Result: Tests Passed: 743 Tests Failed: 0
      
      Change-Id: I36f5523381428629126fc196f615063fc7a50b8e
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      3af3a13b
    • Howard Chen's avatar
      SELinux changes for Treble Loadable Kernel Module · f6931130
      Howard Chen authored
      This change extends the recovery mode modprobe sepolicy
      to support loadable kernel module in normal mode by using
      statement below in init.rc:
      
      exec u:r:modprobe:s0 -- /system/bin/modprobe \
          -d /vendor/lib/modules mod
      
      Bug: b/35653245
      Test: sailfish  with local built kernel and LKM enabled
      Change-Id: I827e2ce387c899db3e0e179da92e79c75d61f5ae
      (cherry picked from commit b638d949)
      f6931130
    • Jiyong Park's avatar
      Rename vndk-stable to vndk-sp (SP=Same-process) · ba23c8fa
      Jiyong Park authored
      The concept of VNDK-stable set is gone because they no longer need to be
      stable across several Android releases. Instead, they are just small set
      of system libraries (other than Low-Level NDK) that can be used by
      same-process HALs. They need to be stable only during an Android release
      as other VNDK libraries. However, since they are eligible for double
      loading, we still need to distinguish those libs from other VNDK
      libraries. So we give them a name vndk-sp, which means VNDK designed for
      same-process HALs.
      
      Bug: 37139956
      Test: booting successful with vndk-sp libs in /vendor/lib(64)?/vndk-sp
      Change-Id: I892c4514deb3c6c8006e3659bed1ad3363420732
      ba23c8fa
  8. Apr 08, 2017
    • Jaekyun Seok's avatar
      Allow zygote to access dir/file under /vendor/overlay · e360791d
      Jaekyun Seok authored
      http://ag/2070347 doesn't allow zygote to read vendor_overlay_file:file
      anymore.
      But zygote isn't transitioned into idmap when executing idmap_exec. So
      we need to allow zygote to access dir/file under /vendor/overlay to
      enable idmap_exec run by zygote to read static RRO.
      
      Test: building succeeded and tested a static RRO on sailfish device.
      Bug: 37173452
      Change-Id: Iec8a6b31d24c225f7819eeb885305f78da73b8e0
      e360791d
  9. Apr 07, 2017
    • Jaesoo Lee's avatar
      allow access to vendor_framework_file to dex2oat and appdomain · 5377be65
      Jaesoo Lee authored
      We should give appdomain the access to the /vendor/framework directory
      since the jar in the directory is not dexopt-ed.AFAIK, jars which are
      not in the bootclasspath are not dexopt-ed by default.
      
      Bug: b/37129319
      Test: built and confirmed that embms.apk not crashed
      
      Change-Id: Ic2b1eef472f2fba53e26403dde8ad9ede8105a03
      5377be65
    • Jiyong Park's avatar
      sepolicy: allow access to vndk-stable libs · a4768fa8
      Jiyong Park authored
      Vndk-stable libs are system libs that are used by same process HALs.
      Since same process HALs can be loaded to any process, so are vndk-stable
      libs.
      
      Bug: 37138502
      Test: none, because the directory is currently empty and thus this is
      no-op. sailfish builds and boots.
      
      Change-Id: I67a2c8c2e4c3517aa30b4a97dc80dc2800e47b5a
      a4768fa8
    • Donghyun Cho's avatar
      Add sepolicy for tv.cec · f81dd0c5
      Donghyun Cho authored
      Bug: 36562029
      Test: m -j40 and CEC functionality works well
      Change-Id: I5a693e65abdd5139a848d939149a475056cc41e8
      f81dd0c5
  10. Apr 06, 2017
    • Sandeep Patil's avatar
      sepolicy: restrict /vendor/overlay from most coredomains · 9075699a
      Sandeep Patil authored
      
      The change makes 'vendor_overlay_file' accessible only to few platform
      domains like idmap, system_server, zygote and appdomain.
      
      The overlay files contains RROs (runtime resource overlays)
      
      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: I3596ca89ad51d0e7d78c75121f22ea71209ee332
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      9075699a
    • 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
    • Martijn Coenen's avatar
      Add new classes and types for (hw|vnd)servicemanager. · bc6d88d2
      Martijn Coenen authored
      Bug: 34454312
      Bug: 36052864
      Test: device boots, works
      Change-Id: If61d9b736a74c5944cef4449de4dfbaf78d9ccfa
      bc6d88d2
    • Dan Cashman's avatar
      Move mapping_sepolicy.cil to /system partition. · 0e9c47c0
      Dan Cashman authored
      This is a necessary first step to finalizing the SELinux policy build
      process.  The mapping_sepolicy.cil file is required to provide backward
      compatibility with the indicated vendor-targeted version.
      
      This still needs to be extended to provide N mapping files and corresponding
      SHA256 outputs, one for each of the N previous platform versions with which
      we're backward-compatible.
      
      Bug: 36783775
      Test: boot device with matching sha256 and non-matching and verify that
      device boots and uses either precompiled or compiled policy as needed. Also
      verify that mapping_sepolicy.cil has moved.
      
      Change-Id: I5692fb87c7ec0f3ae9ca611f76847ccff9182375
      0e9c47c0
    • Mark Salyzyn's avatar
      logcatd: introduce logcatd executable · 36f2eb20
      Mark Salyzyn authored
      logcatd is the same as logcat, except that the -L flag, if supplied,
      runs once, then the command re-runs itself without the -L flag with
      the same argument set.  By introducing a logcatd daemon executable
      we can solve the problem of the longish reads from pstore that
      sometimes occur when the system is excessively busy spinning in a
      foreground task starving this daemon as we absorb the delay in
      an init service, rather than in an init exec.  This would not have
      been efficiently possible without the introduction of liblogcat.
      
      Test: gTest logcat-unit-tests
      Test: Manual check logpersist operations
      Bug: 28788401
      Bug: 30041146
      Bug: 30612424
      Bug: 35326290
      Change-Id: I3454bad666c66663f59ae03bcd72e0fe8426bb0a
      36f2eb20
  11. Apr 05, 2017
    • Sandeep Patil's avatar
      sepolicy: relabel /vendor · 277a20eb
      Sandeep Patil authored
      
      The CL splits /vendor labeling from /system. Which was allowing all
      processes read, execute access to /vendor.
      
      Following directories will remain world readable
       /vendor/etc
       /vendor/lib(64)/hw/
      
      Following are currently world readable but their scope
      will be minimized to platform processes that require access
       /vendor/app
       /vendor/framework/
       /vendor/overlay
      
      Files labelled with 'same_process_hal_file' are allowed to be
      read + executed from by the world. This is for Same process HALs and
      their dependencies.
      
      Bug: 36527360
      Bug: 36832490
      Bug: 36681210
      Bug: 36680116
      Bug: 36690845
      Bug: 36697328
      Bug: 36696623
      Bug: 36806861
      Bug: 36656392
      Bug: 36696623
      Bug: 36792803
      
      All of the tests were done on sailfish, angler, bullhead, dragon
      Test: Boot and connect to wifi
      Test: Run chrome and load websites, play video in youtube, load maps w/
            current location, take pictures and record video in camera,
            playback recorded video.
      Test: Connect to BT headset and ensure BT audio playback works.
      Test: OTA sideload using recovery
      Test: CTS SELinuxHostTest pass
      
      Change-Id: I278435b72f7551a28f3c229f720ca608b77a7029
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      277a20eb
    • Andreas Gampe's avatar
      Sepolicy: Add ASAN-Extract · 82071b68
      Andreas Gampe authored
      Add selinux policies for init script and shell script to unzip a tar
      containing ASAN libraries on boot.
      
      Bug: 36458146
      Test: m && m SANITIZE_TARGET=address
      Test: manual (build steps for tar missing)
      Change-Id: I5c3cb233aae93ee9985431090af902b0e3c1b0a7
      (cherry picked from commit 0b743050)
      Merged-In: I5c3cb233aae93ee9985431090af902b0e3c1b0a7
      82071b68
    • Steven Moreland's avatar
      Remove unnecessary adbd permissions. · 97848f05
      Steven Moreland authored
      Test: adbd_test (with and without adb root)
        Note: one test fails without root with and without this change
              because of an unrelated shell selinux denial.
      Test: adb screencap, pull, and verify
      Test: Android Studio screenshot
      Bug: 36643190
      Change-Id: Ib534240bc9bb3a1f32b8865ca66db988902a0f4a
      97848f05
  12. Apr 04, 2017
  13. Apr 03, 2017
    • Jeff Vander Stoep's avatar
      adbd/shell: grant access to sepolicy for cts · 892d1e40
      Jeff Vander Stoep authored
      Test: Test: make cts && \
            cts-tradefed run singleCommand cts --skip-device-info \
            --skip-preconditions --skip-connectivity-check --abi arm64-v8a \
            --module CtsSecurityHostTestCases \
            -t android.security.cts.SELinuxHostTest#testNoExemptionsForBinderInVendorBan
            Fails as expected.
      Bug: 36002573
      
      Change-Id: I298c526789b25734d5f18666c64497e5d1e181d0
      892d1e40
    • Martijn Coenen's avatar
      Add target for vndservice_contexts. · 6676c234
      Martijn Coenen authored
      So we can limit vndservicemanager access to
      just vndservice_contexts.
      
      Bug: 36052864
      Test: servicemanager,vndservicemanager work
      Change-Id: I7b132d4f616ba1edd0daf7be750d4b7174c4e188
      6676c234
    • Alex Klyubin's avatar
      No access to tee domain over Unix domain sockets · f86d54f0
      Alex Klyubin authored
      The tee domain is a vendor domain. Thus it cannot be accessed by
      non-vendor components over Unix domain sockets.
      
      It appears that the rules granting this access are not needed.
      
      Test: Flash a clean build with this change. Confirm that bullhead,
            angler, sailfish, ryu, boot without new denials.
            Confirm that YouTube, Netflix, Google Play Movies play back
            videos without new denials.
      Bug: 36714625
      Bug: 36715266
      
      Change-Id: I639cecd07c9a3cfb257e62622b51b7823613472a
      f86d54f0
    • Alex Klyubin's avatar
      Move TEE rules to vendor image · 304d6536
      Alex Klyubin authored
      "tee" domain is a vendor domain. Hence its rules should live on the
      vendor image.
      
      What's left as public API is that:
      1. tee domain exists and that it is permitted to sys_rawio capability,
      2. tee_device type exists and apps are not permitted to access
         character devices labeled tee_device.
      
      If you were relying on system/sepolicy automatically labeling
      /dev/tf_driver as tee_device or labeling /system/bin/tf_daemon as
      tee_exec, then you need to add these rules to your device-specific
      file_contexts.
      
      Test: mmm system/sepolicy
      Test: bullhead, angler, and sailfish boot up without new denials
      Bug: 36714625
      Bug: 36714625
      Bug: 36720355
      Change-Id: Ie21619ff3c44ef58675c369061b4afdd7e8501c6
      304d6536
  14. Apr 01, 2017
  15. Mar 31, 2017
    • Shubang's avatar
      Add sepolicy for tv.input · c76e158c
      Shubang authored
      Test: build, flash; adb shell lshal
      Bug: 36562029
      Change-Id: If8f6d8dbd99d31e6627fa4b7c1fd4faea3b75cf2
      c76e158c
Loading