Skip to content
Snippets Groups Projects
  1. May 18, 2017
    • Sohani Rao's avatar
      SE Policy for Wifi Offload HAL · 325bf725
      Sohani Rao authored
      Update SE Policy to allow calls to and callbacks from Wifi Offload HAL
      HIDL binderized service.
      Combined cherry pick from d56aa1982d15acfc2408271138dac43f1e5dc987
      and 66e27bf5
      
      Bug: 32842314
      Test: Unit tests, Mannual test to ensure Wifi can be brought up and
      connected to an AP, ensure that Offload HAL service is running and that
      that wificond can get the service handle by calling hwservicemanager.
      
      Change-Id: I0fc51a4152f1891c8d88967e75d45ded115e766e
      325bf725
  2. May 17, 2017
    • Steven Moreland's avatar
      Add fwk_display_hwservice. · e8ab0020
      Steven Moreland authored
      This hidl service provides information about vsync and hotplug
      to vendor services which is required by at least some camera
      hal implementations.
      
      Test: VtsFwkDisplayServiceV1_0TargetTest
      Test: no denials
      Bug: 38311538
      Change-Id: I64f0321e2832facf987057f0d48940e269d8e2d9
      e8ab0020
  3. May 16, 2017
    • Jeff Vander Stoep's avatar
      hal_camera: remove video_device restriction · a1c94c8d
      Jeff Vander Stoep authored
      Disallowing other HALs access to video_device does not appear to be
      enforceable.
      
      (cherry picked from commit c26dd18a)
      
      Bug: 37669506
      Test: build policy. Neverallow rules are build time test and do not
            impact the policy binary.
      Change-Id: Iea401de08a63f3261a461f67b85113a9d838e88a
      a1c94c8d
  4. 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
  5. May 12, 2017
    • Andrew Scull's avatar
      SELinux policies for Weaver HAL. · 3c90eaf2
      Andrew Scull authored
      Bug: 35628284
      Change-Id: I08877ac117212325b1259f7d90a4c0cb1dac2d9f
      Fix: 38233550
      Test: Build and boot
      Merged-In: I4cdacb601e0eea1f5f0e721c568c7ee04298704f
      3c90eaf2
    • Andrew Scull's avatar
      SELinux policies for the OEM lock HAL. · 0e9b2207
      Andrew Scull authored
      Bug: 34766843
      Change-Id: I5be615d818ecf999fec6514ce9b89ff6a7f13cd6
      Fix: 38232801
      Test: Build and boot
      Merged-In: Ice78aedfdbe82477a84252499a76dad37887fe6b
      0e9b2207
  6. May 11, 2017
    • Luke Song's avatar
      Move sensord sepolicy · 2dd9ae33
      Luke Song authored
      Sensord move in ag/2106763 should be accompanied by corresponding
      sepolicy move of sensord-related files/declarations.
      
      Bug: 36996994
      Test: Sailfish build shows no related permission errors
      Change-Id: Ibe41b363f7ca2752b5d3e0961298985cf784663d
      2dd9ae33
  7. May 10, 2017
    • Alex Vakulenko's avatar
      SELinux policies for PDX services · 41daa7f8
      Alex Vakulenko authored
      Specify per-service rules for PDX transport. Now being able to
      grant permissions to individual services provided by processes,
      not all services of a process.
      
      Also tighter control over which permissions are required for
      client and server for individual components of IPC (endpoints,
      channels, etc).
      
      Bug: 37646189
      Change-Id: I78eb8ae8b6e08105666445a66bfcbd2f1d69d0ea
      41daa7f8
  8. May 09, 2017
    • Martijn Coenen's avatar
      Grant CAP_SYS_NICE to processes that need it. · 0d1f7d29
      Martijn Coenen authored
      New binder kernel changes extend the areas where
      binder will set real-time scheduling priorities
      on threads; to make sure the driver can correctly
      determine whether a process is allowed to run
      at real-time priority or not, add the capability
      to the services that need it.
      
      Bug: 37293077
      Test: processes run at real-time prio on incoming
            real-time binder calls.
      
      Change-Id: Ia4b3e5ecb1f5e18e7272bdaaad5c31a856719633
      0d1f7d29
  9. May 08, 2017
    • Mikhail Naganov's avatar
      hal_audio: Allow writing dump info into pipes when capturing BR · 7fa260ab
      Mikhail Naganov authored
      The following HAL methods use file descriptors to write dump
      info comprising audioflinger debug dump:
      
      IDevice.debugDump
      IEffectsFactory.debugDump
      IStream.debugDump
      
      Bug: 37993476
      Test: check contents of media.audio_flinger section in
            a bugreport captured on Pixel device
      Merged-In: I77d347c019ac93c3ba0d54ce50f0fdc243b04685
      
      Change-Id: Ia0531f715ae5f8b2599153e54a11e9eb4ee47d4b
      7fa260ab
  10. 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
  11. May 04, 2017
    • Dimitry Ivanov's avatar
      Allow getattr on tempfs files · a0d3ff8e
      Dimitry Ivanov authored
      This is needed by linker to be able to load libraries from memfd
      which currently generated following denial:
      avc: denied { getattr } for path=2F6D656D66643A666F6F626172202864656C6574656429 dev="tmpfs" ino=902079 scontext=u:r:shell:s0 tcontext=u:object_r:shell_tmpfs:s0 tclass=file permissive=0
      
      Bug: http://b/37245203
      Bug: http://b/37916741
      Test: builds
      Change-Id: I5b57b6cada50a62657c8daaaaaa56f1ee9cdb376
      a0d3ff8e
  12. May 02, 2017
  13. Apr 29, 2017
    • Hassan Shojania's avatar
      Allow mediaserver to access fd allocated by hal_graphics_composer · a91e3e82
      Hassan Shojania authored
      Bug:  37713584
      Test: With GtsMediaTestCases.apk installed, try:
            adb shell am instrument -w
            -e class 'com.google.android.media.gts.MediaPlayerTest#testLLAMA_H264_BASELINE_240P_800_DOWNLOADED_V0_SYNC'
            'com.google.android.media.gts/android.support.test.runner.AndroidJUnitRunner'
      
      Change-Id: Icc2066e9d9bbc5c020b6d694e9627487771ef35e
      a91e3e82
    • Andreas Gampe's avatar
      Sepolicy: Fix new access from the linker for postinstall · bddd1893
      Andreas Gampe authored
      The linker now requires getattr rights for the filesystem. Otherwise
      linking otapreopt and patchoat/dex2oat will fail.
      
      Bug: 37776530
      Test: m
      Test: manual OTA
      Change-Id: I1351fbfa101beca4ba80f84b0dd9dbcabe2c9d39
      bddd1893
  14. Apr 28, 2017
    • Jeff Vander Stoep's avatar
      Add default label and mapping for vendor services · 082eae4e
      Jeff Vander Stoep authored
      Adding the default label/mapping is important because:
      1.  Lookups of services without an selinux label should generate
          a denial.
      2.  In permissive mode, lookups of a service without a label should be
          be allowed, without the default label service manager disallows
          access.
      3.  We can neverallow use of the default label.
      
      Bug: 37762790
      Test: Build and flash policy onto Marlin with unlabeled vendor services.
          Add/find of unlabeled vendor services generate a denial.
      
      Change-Id: I66531deedc3f9b79616f5d0681c87ed66aca5b80
      (cherry picked from commit 639a2b84)
      082eae4e
    • Steven Moreland's avatar
      Remove audio from socket_between.._violators · b0ed9363
      Steven Moreland authored
      Test: Play Music over BT headset
      Bug: 37640821
      Change-Id: I1fe6c9a289315dc0118888e19250cd64aee9a0d5
      b0ed9363
  15. Apr 27, 2017
  16. Apr 26, 2017
    • Nick Kralevich's avatar
      relax fuse_device neverallow rules · 45766d41
      Nick Kralevich authored
      The fuse_device neverallow rules are too aggressive and are inhibiting
      certain vendor customizations. Relax the /dev/fuse neverallow rules so
      that they better reflect the security invariants we want to uphold.
      
      Bug: 37496487
      Test: policy compiles.
      Change-Id: Ie73b0ba7c76446afc2a7a23ebed1275c977d932d
      45766d41
  17. Apr 25, 2017
    • Jeff Tinker's avatar
      Allow DRM hal to access fd allocated by mediaserver · 3bc24e68
      Jeff Tinker authored
      Test: gts-tradefed run gts -m GtsMediaTestCases -t com.google.android.media.gts.MediaPlayerTest#testLLAMA_H264_BASELINE_240P_800_DOWNLOADED_V0_SYNC
      
      bug:37548390
      Change-Id: I9c2d446118d3a5f729730b75ec117954e383159b
      3bc24e68
    • Alex Klyubin's avatar
      Assert ban on framework <-> vendor comms over VndBinder · 00657834
      Alex Klyubin authored
      This adds neverallow rules which enforce the prohibition on
      communication between framework and vendor components over VendorBinder.
      This prohibition is similar in spirit to the one for Binder
      communications.
      
      Most changes consist of adding neverallow rules, which do not affect
      runtime behavior. The only change which does affect runtime behavior
      is the change which takes away the right of servicemanager domain to
      transfer Binder tokens to hwservicemanager and vndservicemanager. This
      grant was there by accident (because it was overly broad) and is not
      expected to be needed: servicemanager, hwservicemanager, and
      vndservicemanager are not supposed to be communicating with each
      other.
      
      P. S. The new neverallow rules in app_neverallows.te are covered by
      the new rules in domain.te. The rules were nevertheless added to
      app_neverallows.te for consistency with other *Binder rules there.
      
      Test: mmm system/sepolicy
      Bug: 37663632
      Change-Id: I7c2ae23924bf0f2fed3f1e3a8d4d603129286329
      00657834
  18. Apr 24, 2017
    • Alex Klyubin's avatar
      Assert apps can access only approved HwBinder services · 2a7f4fb0
      Alex Klyubin authored
      App domains which host arbitrary code must not have access to
      arbitrary HwBinder services. Such access unnecessarily increases the
      attack surface. The reason is twofold:
      1. HwBinder servers do not perform client authentication because HIDL
         currently does not expose caller UID information and, even if it
         did, many HwBinder services either operate at a layer below that of
         apps (e.g., HALs) or must not rely on app identity for
         authorization. Thus, to be safe, the default assumption is that
         a HwBinder service treats all its clients as equally authorized to
         perform operations offered by the service.
      2. HAL servers (a subset of HwBinder services) contain code with
         higher incidence rate of security issues than system/core
         components and have access to lower layes of the stack (all the way
         down to hardware) thus increasing opportunities for bypassing the
         Android security model.
      
      HwBinder services offered by core components (as opposed to vendor
      components) are considered safer because of point #2 above.
      
      Always same-process aka always-passthrough HwBinder services are
      considered safe for access by these apps. This is because these HALs
      by definition do not offer any additional access beyond what its
      client already as, because these services run in the process of the
      client.
      
      This commit thus introduces these two categories of HwBinder services
      in neverallow rules.
      
      Test: mmm system/sepolicy -- this does not change on-device policy
      Bug: 34454312
      Change-Id: I4f5f4dd10b3fc3bb9d262dda532d4a23dcdf061d
      2a7f4fb0
  19. 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
    • Daniel Nicoara's avatar
      Remove vr_wm service selinux policy · 0e43e4e6
      Daniel Nicoara authored
      vr_wm functionality is moved in VrCore, so remove this service.
      
      Bug: 37542947, 36506799
      Test: Ran on device and verified there are no permission errors while in
      VR
      Change-Id: I37fd34e96babec2a990600907f61da8c358ecc89
      0e43e4e6
    • Daniel Nicoara's avatar
      Allow vr_hwc and virtual_touchpad to query for permissions · 1fc07550
      Daniel Nicoara authored
      Allow the services to do binder calls to system_server in order to check
      for app permissions.
      
      Bug: 37542947
      Test: Compiled and ran on device ensuring no permission errors
      Change-Id: If91895607eb118f689cf2e11c63945e9f83bf2a0
      1fc07550
    • 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
    • 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
  20. Apr 20, 2017
  21. 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
  22. 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
Loading