Skip to content
Snippets Groups Projects
  1. May 04, 2017
  2. 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
    • Jeff Vander Stoep's avatar
      Add default label and mapping for vendor services · 639a2b84
      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
      639a2b84
  3. 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
  4. Apr 25, 2017
    • 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
  5. 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
  6. Apr 22, 2017
    • Alex Klyubin's avatar
      Tighten isolated_app -> *Binder policy · fa57d415
      Alex Klyubin authored
      * isolated_app is no longer permitted to access /dev/hwbinder -- this
        was granted by mistake.
      * There are now neverallows which enforce that isolated_app can't
        access HwBinder and VendorBinder.
      * There are now neverallows which enforce that isolated_app can't add
        Binder and VendorBinder services to servicemanager and
        vndservicemanager.
      
      Test: mmm system/sepolicy
      Bug: 34454312
      Change-Id: I8ba90a0dcb6a9fccd8f50c78cbd2409381376f7a
      fa57d415
  7. Apr 21, 2017
    • 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
    • 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
  8. Apr 20, 2017
    • Alex Klyubin's avatar
      Restrict access to hwservicemanager · 632bc494
      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
      Change-Id: Iecf74000e6c68f01299667486f3c767912c076d3
      632bc494
    • Daniel Nicoara's avatar
      Remove rules blocking vrcore_app to connect to VR HWC and VirtualTouchpad · 52276383
      Daniel Nicoara authored
      Bug: 37542947
      Test: Compiled and ran on device to ensure no access errors while in VR
      Change-Id: Ia685676d82f1f10f2bd371a13879d00fe63a9ea6
      52276383
    • Jeff Vander Stoep's avatar
      Only the bluetooth app may run in the bluetooth domain · 67b40378
      Jeff Vander Stoep authored
      Remove neverallow exemption allowing other processes to run in
      the bluetooth app's selinux domain.
      
      The bluetooth domain is intended to host the zygote spawned
      bluetooth app. It is not intended to host other bluetooth related
      processes. Please define new domains for these processes.
      
      Test: build Marlin
      Change-Id: I1fd3dd0fe85f73457d77b63a65b4307821cbd41c
      67b40378
  9. Apr 19, 2017
    • Andreas Gampe's avatar
      Sepolicy: Fix asanwrapper · c848d37d
      Andreas Gampe authored
      Add asanwrapper support for system server under sanitization.
      
      Bug: 36138508
      Test: m && m SANITIZE_TARGET=address SANITIZE_LITE=true
      Test: adb root && adb shell setprop wrap.system_server asanwrapper
      Change-Id: Id930690d2cfd8334c933e0ec5ac62f88850331d0
      c848d37d
    • Dan Cashman's avatar
      Remove vndservice_manager object classes. · fe02a4ee
      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.
      
      (preemptive cherry-pick of commit: 2f1c7ba7
      to avoid merge conflict)
      
      Bug: 34454312
      Bug: 36052864
      Test: policy builds and device boots.
      Change-Id: I9e0c2757be4026101e32ba780f1fa67130cfa14e
      fe02a4ee
  10. Apr 18, 2017
    • 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
  11. Apr 15, 2017
    • 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
  12. Apr 14, 2017
  13. Apr 13, 2017
    • 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
    • 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
      Remove unnecessary attributes · 3cc6a959
      Alex Klyubin authored
      Test: mmm system/sepolicy
      Bug: 34980020
      Change-Id: I36547658a844c58fcb21bb5a0244ab6f61291736
      3cc6a959
    • 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
  14. Apr 12, 2017
  15. Apr 11, 2017
    • 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
  16. 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
    • 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
  17. Apr 07, 2017
    • 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
  18. Apr 06, 2017
  19. 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
  20. Apr 01, 2017
    • Jeff Vander Stoep's avatar
      Ban core components from accessing vendor data types · 50563c03
      Jeff Vander Stoep authored
      Vendor and system components are only allowed to share files by
      passing open FDs over HIDL. Ban all directory access and all file
      accesses other than what can be applied to an open FD such as
      ioctl/stat/read/write/append.
      
      This commit asserts that core components marked with attribute
      coredomain may only access core data types marked with attribute
      core_data_file_type.
      
      A temporary exemption is granted to domains that currently rely on
      access.
      
      (cherry picked from commit cd97e710)
      
      Bug: 34980020
      Test: build Marlin policy
      Change-Id: I2f0442f2628fbac1f2f7aa5ddf2a13e16b2546cc
      50563c03
    • Andreas Gampe's avatar
      Sepolicy: Add ASAN-Extract · 0b743050
      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
      0b743050
Loading