Skip to content
Snippets Groups Projects
  1. Apr 21, 2017
    • Alex Klyubin's avatar
      Relax neverallow for video_device access · 3ef2d51b
      Alex Klyubin authored
      On fugu, surfaceflinger is Graphics Allocator HAL. surfaceflinger
      needs access to video_device. This commit thus relaxes the neverallow
      rule which says that out of all HALs, only Camera HAL can access
      video_device. The rule is relaxed to exclude HALs offered by
      framework/system image.
      
      Test: fugu boots
      Bug: 37575062
      Change-Id: I9b9be55fe0bf3928f1a6342113a7d6f9a2eb0260
      3ef2d51b
    • Sandeep Patil's avatar
      Make sure all public types are defined regardless of build variants · 35e308cf
      Sandeep Patil authored
      
      The types need to be exported so userdebug system.img
      can still build the policy with a user vendor.img at boot time.
      All permissions and attributes for these types are still kept under
      conditional userdebug_or_eng macro
      
      Bug: 37433251
      Test: Boot sailfish-user build with generic_arm64_ab system.img on
            sailfish and make sure sepolicy compilation succeeds
      
      Change-Id: I98e8428c414546dfc74641700d4846edcf9355b1
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      35e308cf
    • Chia-I Wu's avatar
      Allow dumping hal_graphics_composer_server and fix watchdog · e4d21465
      Chia-I Wu authored
      Bug: 37152880
      Bug: 37554633
      Test: adb shell am hang --allow-restart
      Test: adb shell dumpstate
      Change-Id: Ie68607f3e3245a40056bdde7dd810ddf212b4295
      e4d21465
    • Alex Klyubin's avatar
      Grant dumpstate hwservermanager list permission · 09423b50
      Alex Klyubin authored
      This lets dumpstate obtain the list of currently registered HwBinder
      services.
      
      Test: adb bugreport -- no denials to do with dumpstate access to
            hwservicemanager list functionality.
      Bug: 37554633
      
      Change-Id: I95512168948ca45a0dd830c20922e3c776ffaf41
      09423b50
    • Alex Klyubin's avatar
      Restrict access to hwservicemanager · 53656c17
      Alex Klyubin authored
      This adds fine-grained policy about who can register and find which
      HwBinder services in hwservicemanager.
      
      Test: Play movie in Netflix and Google Play Movies
      Test: Play video in YouTube app and YouTube web page
      Test: In Google Camera app, take photo (HDR+ and conventional),
            record video (slow motion and normal), and check that photos
            look fine and videos play back with sound.
      Test: Cast screen to a Google Cast device
      Test: Get location fix in Google Maps
      Test: Make and receive a phone call, check that sound works both ways
            and that disconnecting the call frome either end works fine.
      Test: Run RsHelloCompute RenderScript demo app
      Test: Run fast subset of media CTS tests:
            make and install CtsMediaTestCases.apk
            adb shell am instrument -e size small \
                -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
      Test: Play music using Google Play music
      Test: Adjust screen brightness via the slider in Quick Settings
      Test: adb bugreport
      Test: Enroll in fingerprint screen unlock, unlock screen using
            fingerprint
      Test: Apply OTA update:
            Make some visible change, e.g., rename Settings app.
            make otatools && \
            make dist
            Ensure device has network connectivity
            ota_call.py -s <serial here> --file out/dist/sailfish-ota-*.zip
            Confirm the change is now live on the device
      Bug: 34454312
      (cherry picked from commit 632bc494)
      Merged-In: Iecf74000e6c68f01299667486f3c767912c076d3
      Change-Id: I7a9a487beaf6f30c52ce08e04d415624da49dd31
      53656c17
    • Jeff Vander Stoep's avatar
      Fix build time warning · 2db1cd48
      Jeff Vander Stoep authored
      Fixes warning:
      system/sepolicy/public/install_recovery.te:14:WARNING 'unrecognized character' at token ''' on line 13335:
      allow install_recovery vendor_file:file { { getattr open read ioctl lock } { getattr execute execute_no_trans } };'
      
      Bug: 37105075
      Test: Fugu policy builds without this warning.
      Change-Id: I8f417c51a816f3983a918c7e36dd804c5b85543f
      2db1cd48
    • Pavel Grafov's avatar
      Let shell and bugreport read logging related properties. · a283ac71
      Pavel Grafov authored
      Currently ro.device_owner and persist.logd.security aren't accessible
      without root, so "adb shell getprop" returns empty reply which is
      confusing. Also these properties aren't seen from bugreport unless
      their change happened recently.
      
      Bug: 37053313
      Test: manual, took bugreport and ran getprop after "adb unroot".
      Change-Id: Id41cdabc282f2ebcdfc0ac7fe9df756322a0863d
      a283ac71
  2. Apr 20, 2017
    • Chia-I Wu's avatar
      dumpstate is a client of graphics allocator · c0044bfa
      Chia-I Wu authored
      This fixes
      
      avc: denied { call } for comm="screencap" scontext=u:r:dumpstate:s0
        tcontext=u:r:hal_graphics_allocator_default:s0 tclass=binder
        permissive=0
      
      Bug: 37360953
      Test: adb shell dumpstate -p -o <path>
      Change-Id: Ia9387559e3ec1ba51b614bb9d24294fbbbd51b1a
      c0044bfa
  3. Apr 19, 2017
    • Sandeep Patil's avatar
      Allow access to /proc/config.gz for priv_app and recovery · 04654427
      Sandeep Patil authored
      
      Bug: 37485771
      Test: sideloaded OTA through recovery on sailfish
      
      Change-Id: I98bb4e0e919db585131391f57545f1a9a0096701
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      04654427
    • Jeff Hao's avatar
      Add dex2oat permissions to open and read the tmp apk. · 37f5c2d9
      Jeff Hao authored
      The PackageManager now passes previous code paths to dex2oat as shared
      libraries. dex2oat needs extra permissions in order to access and open
      the oat files of these libraries (if they were compiled).
      
      Part of a multi-project change.
      
      Bug: 34169257
      Test: cts-tradefed run singleCommand cts -d --module
      CtsAppSecurityHostTestCases -t android.appsecurity.cts.SplitTests
      
      (cherry-picked from commit 1103f963)
      
      Change-Id: I3cf810ef5f4f4462f6082dc30d3a7b144dcce0d9
      37f5c2d9
    • Chong Zhang's avatar
      grant mediadrmserver permission to read dir from /system/* · 492dab2a
      Chong Zhang authored
      hal_client_domain no longer allows read dir permission, in order
      to load .so from /system/lib, we have to add this permission ourselves.
      
      bug: 37476803
      Change-Id: I1711d158c2f4580f50ac244da10c489df003cc18
      492dab2a
    • Andy Hung's avatar
      Extend mediaextractor file read permissions · f239fcf5
      Andy Hung authored
      Permit mediaextractor its own file source for apk and ringtone files.
      
      Previously we fall back to the mediaserver file source.
      This does not affect behavior as the fallback works fine; however,
      the log messages may cause confusion.
      
          [73402.683908] type=1400 audit(1491338955.878:121): avc: denied { read }
          for pid=18381 comm="generic"
          path="/data/system_de/0/ringtones/alarm_alert_cache" dev="sda35"
          ino=2490374 scontext=u:r:mediaextractor:s0
          tcontext=u:object_r:ringtone_file:s0 tclass=file permissive=0
          [73402.683932] type=1400 audit(1491338955.884:122): avc: denied { read }
          for pid=18383 comm="generic"
          path="/data/system_de/0/ringtones/ringtone_cache" dev="sda35"
          ino=2490376 scontext=u:r:mediaextractor:s0
          tcontext=u:object_r:ringtone_file:s0 tclass=file permissive=0
      
      Test: Ringtone and CTS
      Bug: 37500781
      
      Change-Id: Ie6d8e6d2b7301d00957733f173aeebbe9d0d1998
      f239fcf5
  4. Apr 18, 2017
    • Carmen Jackson's avatar
      Add selinux rules for additional file contexts in userdebug · 25788df1
      Carmen Jackson authored
      These rules allow the additional tracepoints we need for running traceur
      in userdebug builds to be writeable.
      
      Bug: 37110010
      Test: I'm testing by running atrace -l and confirming that the
      tracepoints that I'm attempting to enable are available.
      
      Change-Id: Ia352100ed67819ae5acca2aad803fa392d8b80fd
      25788df1
    • Dan Cashman's avatar
      Remove vndservice_manager object classes. · 2f1c7ba7
      Dan Cashman authored
      vndservicemanager is a copy of servicemanager, and so has the exact
      same properties.  This should be reflected in the sharing of an object
      manager in SELinux policy, rather than creating a second one, which is
      effectively an attempt at namespacing based on object rather than type
      labels.  hwservicemanager, however, provides different and additional
      functionality that may be reflected in changed permissions, though they
      currently map to the existing servicemanager permissions.  Keep the new
      hwservice_manager object manager but remove the vndservice_manager one.
      
      Bug: 34454312
      Bug: 36052864
      Test: policy builds and device boots.
      Change-Id: I9e0c2757be4026101e32ba780f1fa67130cfa14e
      2f1c7ba7
    • Alex Klyubin's avatar
      surfaceflinger and apps are clients of Configstore HAL · 75ca4832
      Alex Klyubin authored
      This commit marks surfaceflinger and app domain (except isolated_app)
      as clients of Configstore HAL. This cleans up the policy and will make
      it easier to restrict access to HwBinder services later.
      
      Test: Play YouTube clip in YouTube app and YouTube web page in Chrome
      Test: Take an HDR+ photo, a normal photo, a video, and slow motion
            video in Google Camera app. Check that photos show up fine and
            that videos play back with sound.
      Test: Play movie using Google Play Movies
      Test: Google Maps app displays the Android's correct location
      Bug: 34454312
      Change-Id: I0f468a4289132f4eaacfb1d13ce4e61604c2a371
      75ca4832
  5. Apr 16, 2017
    • Martijn Coenen's avatar
      Allow mediadrmserver to call mediacodec. · ed1c3827
      Martijn Coenen authored
      Bug: 36604251
      Test: Netflix protected content, Play movies
      Change-Id: I5c2c542007abddbe56b933ff44d65bd376b6691e
      ed1c3827
    • 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
  6. Apr 15, 2017
    • Martijn Coenen's avatar
      Allow mediacodec access to sync fences. · b4d701bf
      Martijn Coenen authored
      Test: WIP
      Change-Id: I678b0d0e9750b25628b86060574fd516d3749cdf
      b4d701bf
    • Sandeep Patil's avatar
      Add vendor_executes_system_violators attribute · b99676ee
      Sandeep Patil authored
      
      Temporary attribute (checked against in CTS) to point out vendor
      processes that run /system executables. These are currently only down to
      2-3 of them that are related to telephony on sailfish
      
      Bug: 36463595
      Test: Build succeeds for sailfish
      Test: ./cts-tradefed run cts -m CtsSecurityHostTestCases -t \
                android.security.cts.SELinuxHostTest#testNoExemptionsForVendorExecutingCore \
                --skip-device-info --skip-preconditions --skip-connectivity-check \
                --abi arm64-v8a
      
      Change-Id: I9eb40ad259aefba73869d6a1b40186d33fa475dd
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      b99676ee
    • Sandeep Patil's avatar
      add netutils_wrappers · c6d89024
      Sandeep Patil authored
      
      Bug: 36463595
      Test: Boot sailfish, make wifi call, internet over data and wifi
      
      Change-Id: I81259b6412d7197725afe2fe4976aa0a03b8df6e
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      c6d89024
  7. Apr 14, 2017
  8. 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
    • Alex Klyubin's avatar
      Unbreak user builds · d9745f3d
      Alex Klyubin authored
      This unbreaks user builds broken by recently landed changes to secilc
      which is now aggressively removing attributes which aren't used in
      allow rules, even when they are used in other places, such as being
      referenced from *_contexts files.
      
      User builds are broken by vndservice_manager_type not being found when
      checkfc is run for *vndservice_contexts targets.
      
      Test: On a clean user build: mmma system/sepolicy
      Bug: 37319524
      Bug: 36508258
      Change-Id: I4a1727a74122ecd9020c3831462d56a65ee6d304
      d9745f3d
    • Alex Klyubin's avatar
      Unbreak build · 4641f672
      Alex Klyubin authored
      ag/2106481 negatively interfered with ag/2106263...
      
      Test: mmm system/sepolicy
      Bug: 34454312
      Change-Id: If3f5ef6696341ccfdd706350ec670f8426dac9c9
      4641f672
    • Martijn Coenen's avatar
      Add temporary allow rule for hwservice_manager_type · 20716c7e
      Martijn Coenen authored
      So it won't get compiled out of sepolicy.
      
      Test: marlin build
      Change-Id: I3a089fe83df69a76bebf64f874556967bc49ee78
      20716c7e
    • 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
  9. 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
    • Andreas Gampe's avatar
      sepolicy: Allow postinstall_dexopt /vendor/app access · e843044c
      Andreas Gampe authored
      Follow-up to commit 1b5f81a2.
      
      Bug: 36681210
      Bug: 37158297
      Test: lunch sailfish-userdebug && m
      Test: Manually run OTA
      Change-Id: Ifb4808c9255842a51a660c07ffd924cef52024c5
      e843044c
  10. Apr 11, 2017
    • Sandeep Patil's avatar
      sepolicy: make exec_types in /vendor a subset of vendor_file_type · 2ee66e7d
      Sandeep Patil authored
      
      We install all default hal implementations in /vendor/bin/hw along with
      a few domains that are defined in vendor policy and installed in
      /vendor. These files MUST be a subset of the global 'vendor_file_type'
      which is used to address *all files installed in /vendor* throughout the
      policy.
      
      Bug: 36463595
      Test: Boot sailfish without any new denials
      
      Change-Id: I3d26778f9a26f9095f49d8ecc12f2ec9d2f4cb41
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      2ee66e7d
    • Jaesoo Lee's avatar
      allow to load kernel modules from vendor partition · a6ac1147
      Jaesoo Lee authored
      The kernel  modules under /vendor partition has been relabeled to vendor_file.
      This CL allows for the modprobe to load modules labeled vendor_file.
      
      Kernel modules are loaded in init.rc with following commands:
          exec u:r:modprobe:s0 -- /system/bin/modprobe -d /vendor/lib/modules MODULE
      
      Bug: 35653245
      Test: tested on sailfish
      Change-Id: I2132ca4de01c5c60476dad8496e98266de5a1bb7
      a6ac1147
  11. Apr 10, 2017
    • Alex Klyubin's avatar
      Apostrophe not permitted in macro parameters · d84f20b2
      Alex Klyubin authored
      Test: mmm system/sepolicy -- no warnings
      Bug: 3716915
      Change-Id: I76886c2d09a70cbe6dc707dd0599217407bb63f7
      d84f20b2
    • 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
Loading