Skip to content
Snippets Groups Projects
  1. Mar 25, 2017
  2. Mar 24, 2017
    • Alex Klyubin's avatar
      Merge "Mark all clients of Allocator HAL" · 73a6f38b
      Alex Klyubin authored
      73a6f38b
    • Alex Klyubin's avatar
      Mark all clients of Allocator HAL · 7cda44f4
      Alex Klyubin authored
      This change associates all domains which are clients of Allocator HAL
      with hal_allocator_client and the, required for all HAL client
      domains, halclientdomain.
      
      This enables this commit to remove the now unnecessary hwallocator_use
      macro because its binder_call(..., hal_allocator_server) is covered by
      binder_call(hal_allocator_client, hal_allocator_server) added in this
      commit.
      
      Unfortunately apps, except isolated app, are clients of Allocator HAL
      as well. This makes it hard to use the hal_client_domain(...,
      hal_allocator) macro because it translates into "typeattribute" which
      currently does not support being provided with a set of types, such as
      { appdomain -isolated_app }. As a workaround, hopefully until
      typeattribute is improved, this commit expresses the necessary
      association operation in CIL. private/technical_debt.cil introduced by
      this commit is appended into the platform policy CIL file, thus
      ensuring that the hack has effect on the final monolithic policy.
      
      P. S. This change also removes Allocator HAL access from isolated_app.
      Isolated app shouldn't have access to this HAL anyway.
      
      Test: Google Play Music plays back radios
      Test: Google Camera records video with sound and that video is then
            successfully played back with sound
      Test: YouTube app plays back clips with sound
      Test: YouTube in Chrome plays back clips with sound
      Bug: 34170079
      Change-Id: Id00bba6fde83e7cf04fb58bc1c353c2f66333f92
      7cda44f4
    • Alex Klyubin's avatar
      su and perfprofd are coredomain too · 6b558dcb
      Alex Klyubin authored
      This is a follow-up to f5446eb1 where
      I forgot to associate su and perfprofd domains with coredomain.
      
      Test: mmm system/sepolicy
            sepolicy-analyze $OUT/root/sepolicy attribute coredomain
      Bug: 35870313
      Change-Id: I13f90693843f7c6fe9fea8e5332aa6dd9558478a
      6b558dcb
    • Alex Klyubin's avatar
      Vendor domains must not use Binder · f5446eb1
      Alex Klyubin authored
      On PRODUCT_FULL_TREBLE devices, non-vendor domains (except vendor
      apps) are not permitted to use Binder. This commit thus:
      * groups non-vendor domains using the new "coredomain" attribute,
      * adds neverallow rules restricting Binder use to coredomain and
        appdomain only, and
      * temporarily exempts the domains which are currently violating this
        rule from this restriction. These domains are grouped using the new
        "binder_in_vendor_violators" attribute. The attribute is needed
        because the types corresponding to violators are not exposed to the
        public policy where the neverallow rules are.
      
      Test: mmm system/sepolicy
      Test: Device boots, no new denials
      Test: In Chrome, navigate to ip6.me, play a YouTube video
      Test: YouTube: play a video
      Test: Netflix: play a movie
      Test: Google Camera: take a photo, take an HDR+ photo, record video with
            sound, record slow motion video with sound. Confirm videos play
            back fine and with sound.
      Bug: 35870313
      Change-Id: I0cd1a80b60bcbde358ce0f7a47b90f4435a45c95
      f5446eb1
    • Treehugger Robot's avatar
  3. Mar 23, 2017
  4. Mar 22, 2017
    • Alex Klyubin's avatar
      Remove unnecessary rules from NFC HAL clients · e5395706
      Alex Klyubin authored
      Rules in clients of NFC HAL due to the HAL running (or previously
      running) in passthrough mode are now targeting hal_nfc. Domains which
      are clients of NFC HAL are associated with hal_nfc only the the HAL
      runs in passthrough mode. NFC HAL server domains are always associated
      with hal_nfc and thus get these rules unconditionally.
      
      This commit also moves the policy of nfc domain to private. The only
      thing remaining in the public policy is the existence of this domain.
      This is needed because there are references to this domain in public
      and vendor policy.
      
      Test: Open a URL in Chrome, NFC-tap Android to another Android and
            observe that the same URL is opened in a web browser on the
            destination device. Do the same reversing the roles of the two
            Androids.
      Test: Install an NFC reader app, tap a passive NFC tag with the
            Android and observe that the app is displaying information about
            the tag.
      Test: No SELinux denials to do with NFC before and during and after
            the above tests on sailfish, bullhead, and angler.
      Bug: 34170079
      
      Change-Id: I29fe43f63d64b286c28eb19a3a9fe4f630612226
      e5395706
    • Treehugger Robot's avatar
    • Treehugger Robot's avatar
    • Treehugger Robot's avatar
      6456542f
    • Jeff Vander Stoep's avatar
      Grant additional permissions for ASAN builds · 74434848
      Jeff Vander Stoep authored
      ASAN builds may require additional permissions to launch processes
      with ASAN wrappers. In this case, system_server needs permission to
      execute /system/bin/sh.
      
      Create with_asan() macro which can be used exclusively on debug
      builds. Note this means that ASAN builds with these additional
      permission will not pass the security portion of CTS - like any
      other debug build.
      
      Addresses:
      avc: denied { execute } for name="sh" dev="dm-0" ino=571
      scontext=u:r:system_server:s0 tcontext=u:object_r:shell_exec:s0
      tclass=file
      
      Test: lunch aosp_marlin-userdebug;
            cd system/sepolicy; mm SANITIZE_TARGET=address;
            Verify permissions granted using with_asan() are granted.
      Test: lunch aosp_marlin-userdebug;
            cd system/sepolicy; mm;
            Verify permissions granted using with_asan() are not granted.
      Test: lunch aosp_marlin-user;
            cd system/sepolicy; mm SANITIZE_TARGET=address;
            Verify permissions granted using with_asan() are not granted.
      Bug: 36138508
      Change-Id: I6e39ada4bacd71687a593023f16b45bc16cd7ef8
      74434848
    • Sandeep Patil's avatar
      dumpstate: allow HALs to read /proc/interrupts · a866a416
      Sandeep Patil authored
      
      /proc/interrupts may be dumped by dumpstate HAL if required.
      
      Bug: 36486169
      Test: 'adb shell bugreport' on sailfish
      
      Change-Id: Ifc41a516aeea846bc56b86b064bda555b43c58ed
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      a866a416
    • Treehugger Robot's avatar
    • Treehugger Robot's avatar
      cc45b87c
    • Treehugger Robot's avatar
    • Roshan Pius's avatar
      wpa_supplicant: Remove unnecessary permissions from system_server · f27e8f09
      Roshan Pius authored
      Now that the android wifi framework has fully switched over to HIDL,
      remove the sepolicy permissions for accessing wpa_supplicant using
      socket control interface.
      
      While there, also removed the redundant |hwbinder_use|.
      
      Bug: 35707797
      Test: Device boots up and able to connect to wifi networks.
      Test: Wifi integration tests passed.
      Change-Id: I55e24b852558d1a905b189116879179d62bdc76c
      f27e8f09
    • Nick Kralevich's avatar
      app.te: prevent locks of files on /system · 92c44a57
      Nick Kralevich authored
      Prevent app domains (processes spawned by zygote) from acquiring
      locks on files in /system. In particular, /system/etc/xtables.lock
      must never be lockable by applications, as it will block future
      iptables commands from running.
      
      Test: device boots and no obvious problems.
      Change-Id: Ifd8dc7b117cf4a622b30fd4fffbcab1b76c4421b
      92c44a57
    • Steven Moreland's avatar
      hwservicemanager: halserverdomain · e91cbcba
      Steven Moreland authored
      Test: no neverallows triggered
      Bug: 36494354
      Change-Id: I52e21a9be5400027d4e96a8befdd4faaffb06a93
      e91cbcba
    • Treehugger Robot's avatar
      9d5f97b3
  5. Mar 21, 2017
    • Alex Klyubin's avatar
      6de0d9a7
    • Chad Brubaker's avatar
    • Treehugger Robot's avatar
      Merge "Enforce one HAL per domain." · d3266558
      Treehugger Robot authored
      d3266558
    • Alex Klyubin's avatar
      Remove unnecessary binder_call from cameraserver · 57ab0015
      Alex Klyubin authored
      This is a follow-up to 93391686
      which added both
      hal_client_domain(cameraserver, hal_graphics_allocator) and
      binder_call(cameraserver, hal_graphics_allocator). The latter
      binder_call rule is no longer needed because it is automatically
      granted by virtue of cameraserver being marked as a client of
      Graphics Allocator HAL --
      see 49274721.
      
      Test: Take a photo (both HDR and conventional) using Google Camera
      Test: Record video using Google Camera
      Test: Record slow motion video using Google Camera
      Test: No denials to do with cameraserver and hal_graphics_allocator*
      Bug: 34170079
      Change-Id: If93fe310fa62923b5107a7e78d158f6e4b4d0b3a
      57ab0015
    • Chad Brubaker's avatar
      Disallow access to proc_net for ephemeral_app · c4a938e7
      Chad Brubaker authored
      Test: Boots, runs
      Bug: 32713782
      Change-Id: Ia58db3c4c0159482f08e72ef638f3e1736095918
      c4a938e7
    • Jeff Vander Stoep's avatar
      Enforce one HAL per domain. · 84b96a6b
      Jeff Vander Stoep authored
      HALs are intended to be limited responsibility and thus limited
      permission. In order to enforce this, place limitations on:
      1. What processes may transition into a HAL - currently only init
      2. What methods may be used to transition into a HAL - no using
         seclabel
      3. When HALs exec - only allow exec with a domain transition.
      
      Bug: 36376258
      Test: Build aosp_marlin, aosp_bullhead, aosp_dragon. Neverallow rules
            are compile time assertions, so building is a sufficient test.
      
      Change-Id: If4df19ced730324cf1079f7a86ceba7c71374131
      84b96a6b
    • Yin-Chia Yeh's avatar
    • Alex Klyubin's avatar
      Remove unused hal_impl_domain macro · cb839c64
      Alex Klyubin authored
      All previous users of this macro have been switched to
      hal_server_domain macro.
      
      Test: no hal_impl_domain in system/sepolicy/ and device/**/sepolicy
      Test: mmm system/sepolicy
      Bug: 34170079
      Change-Id: I4a71b3fd5046c0d215b056f1cae25fe6bda0fb45
      cb839c64
    • Treehugger Robot's avatar
      cc877324
    • Jiyong Park's avatar
      Allow app to access configstore HAL · ed4625f3
      Jiyong Park authored
      Apps should be able to access the configstore HAL since framework
      libraries which are loaded into app process can call configstore.
      
      Letting apps have direct access to this HAL is OK because: 
      
      (1) the API of this HAL does not make clients provide any sensitive 
      information to the HAL, which makes it impossible for the HAL to 
      disclose sensitive information of its clients when the HAL is 
      compromised, 
      
      (2) we will require that this HAL is binderized (i.e., does not run 
      inside the process of its clients), 
      
      (3) we will require that this HAL runs in a tight seccomp sandbox 
      (this HAL doesn't need much access, if at all) and,
      
      (4) we'll restrict the HALs powers via neverallows.
      
      Test: apps can use configstore hal.
      
      Change-Id: I04836b7318fbc6ef78deff770a22c68ce7745fa9
      ed4625f3
    • Alex Klyubin's avatar
  6. Mar 20, 2017
    • Yin-Chia Yeh's avatar
      Camera: allow cameraserver access hal_graphics_allocator · 93391686
      Yin-Chia Yeh authored
      Test: Google camera app snapshot/record/
            slow motion recording
      Bug: 36383997
      Change-Id: I565fb441aec529464474e0dd0e01dbfe0b167c82
      93391686
    • Alex Klyubin's avatar
      Switch Allocator HAL policy to _client/_server · 08d6f566
      Alex Klyubin authored
      This switches Allocator HAL policy to the design which enables us to
      identify all SELinux domains which host HALs and all domains which are
      clients of HALs.
      
      Allocator HAL is special in the sense that it's assumed to be always
      binderized. As a result, rules in Camera HAL target hal_allocator_server
      rather than hal_allocator (which would be the server and any client, if
      the Allocator HAL runs in passthrough mode).
      
      Test: Device boots up, no new denials
      Test: YouTube video plays back
      Test: Take photo using Google Camera app, recover a video, record a slow
            motion video
      Bug: 34170079
      Change-Id: Ifbbca554ec221712361ee6cda94c82f254d84936
      08d6f566
    • Alex Klyubin's avatar
      Move Graphics Allocator HAL IPC rules to proper location · 49274721
      Alex Klyubin authored
      Every client of Graphics Allocator HAL needs permission to (Hw)Binder
      IPC into the HAL.
      
      Test: Device boots, no denials to do with hal_graphics_allocator
            (also, removing the binder_call(hal_graphics_allocator_client,
            hal_graphics_allocator_server) leads to denials)
      Test: GUI works, YouTube works
      Bug: 34170079
      
      Change-Id: I5c64d966862a125994dab903c2eda5815e336a94
      49274721
    • 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
Loading