Skip to content
Snippets Groups Projects
  1. 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
  2. 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
  3. 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
  4. Apr 14, 2017
  5. 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
    • 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
  6. Apr 12, 2017
  7. 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
  8. 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
  9. 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
  10. Apr 06, 2017
  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
  12. 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
  13. Mar 31, 2017
    • Jeff Vander Stoep's avatar
      domain: grant all domains access to zoneinfo · 5aebe512
      Jeff Vander Stoep authored
      /data/misc/zoneinfo is provided by libc and is considered to be
      VNDK stable. Grant read access to all domains and exempt from
      neverallow rules asserting no vendor access to core data types.
      
      Bug: 36730929
      Test: Marlin Policy builds
      Change-Id: I13766a661d6314f5393639fc20f1ab55d802f35f
      5aebe512
    • Alex Klyubin's avatar
      Tighten restrictions on core <-> vendor socket comms · 2f6151ea
      Alex Klyubin authored
      This futher restricts neverallows for sockets which may be exposed as
      filesystem nodes. This is achieved by labelling all such sockets
      created by core/non-vendor domains using the new coredomain_socket
      attribute, and then adding neverallow rules targeting that attribute.
      
      This has now effect on what domains are permitted to do. This only
      changes neverallow rules.
      
      Test: mmm system/sepolicy
      Bug: 36577153
      
      (cherry picked from commit cf2ffdf0)
      
      Change-Id: Iffeee571a2ff61fb9515fa6849d060649636524e
      2f6151ea
  14. Mar 30, 2017
    • Alex Klyubin's avatar
      Further restrict access to Binder services from vendor · 0052bc69
      Alex Klyubin authored
      This tightens neverallows for looking up Binder servicemanager
      services from vendor components. In particular, vendor components,
      other than apps, are not permitted to look up any Binder services.
      Vendor apps are permitted to look up only stable public API services
      which is exactly what non-vendor apps are permitted to use as well.
      If we permitted vendor apps to use non-stable/hidden Binder services,
      they might break when core components get updated without updating
      vendor components.
      
      Test: mmm system/sepolicy
      Bug: 35870313
      
      Change-Id: I47d40d5d42cf4205d9e4e5e5f9d0794104efc28f
      0052bc69
    • Ian Pedowitz's avatar
      Revert "Further restrict access to Binder services from vendor" · 43b48045
      Ian Pedowitz authored
      This reverts commit 5c09d123.
      
      Broke the build
      
      Bug: 35870313
      Test: source build/envsetup.sh && lunch marlin-userdebug && m -j40
      Change-Id: I71c968be6e89462fd286be5663933552d478f8bf
      43b48045
  15. Mar 29, 2017
    • Alex Klyubin's avatar
      Further restrict access to Binder services from vendor · 5c09d123
      Alex Klyubin authored
      This tightens neverallows for looking up Binder servicemanager
      services from vendor components. In particular, vendor components,
      other than apps, are not permitted to look up any Binder services.
      Vendor apps are permitted to look up only stable public API services
      which is exactly what non-vendor apps are permitted to use as well.
      If we permitted vendor apps to use non-stable/hidden Binder services,
      they might break when core components get updated without updating
      vendor components.
      
      Test: mmm system/sepolicy
      Bug: 35870313
      Change-Id: I949d62b3528cadb4bfe6f5985c25d1f497df0d5a
      5c09d123
    • Alex Klyubin's avatar
      Loosen system app data neverallows · f2e07765
      Alex Klyubin authored
      We don't want to prevent access from vendor platform apps to system app
      data. The issue with the referencing system_app explicitly in
      neverallows is that vendor platform apps which need sandboxes similar to
      system_app cannot be placed under system_app without modifying the
      policy for all platform apps.
      
      Test: mmm system/sepolicy
      Change-Id: Ic0052602c31be4d74b02eeea129e2d8bfbd9c8d3
      f2e07765
    • Sandeep Patil's avatar
      prop_context: correctly label all property_context files · 54a42001
      Sandeep Patil authored
      
      split property context file in vendor and sytem were left untouched by
      the recent changes. This was working accidentally because they were
      still accessible to all domains as 'system_file'.
      
      Bug: 36002573
      Test: Boot sailfish to observe no new denials.
      Test: 'adb sideload' OTA on sailfish successfully
      
      Change-Id: I5bec058b59db83d2a431e9f7e91c5a09af7d2942
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      54a42001
    • Alex Klyubin's avatar
      Fix warnings · edc53291
      Alex Klyubin authored
      Unescaped apostrophe is not permitted inside macros.
      
      Test: mmm system/sepolicy -- no warnings
      Bug: 34980020
      Change-Id: I893a41508d8b62975771967fd6e40e50d188c7c1
      edc53291
  16. Mar 28, 2017
    • Jeff Vander Stoep's avatar
      Ban vendor components access to core data types · 4a478c47
      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 file:
      stat/read/write/append.
      
      This commit marks core data types as core_data_file_type and bans
      access to non-core domains with an exemption for apps. A temporary
      exemption is also granted to domains that currently rely on
      access with TODOs and bug number for each exemption.
      
      Bug: 34980020
      Test: Build and boot Marlin. Make phone call, watch youtube video.
            No new denials observed.
      Change-Id: I320dd30f9f0a5bf2f9bb218776b4bccdb529b197
      4a478c47
  17. Mar 27, 2017
    • Alex Klyubin's avatar
      Allow violators of "no Binder in vendor" access to /dev/binder · 2ab99a13
      Alex Klyubin authored
      In f5446eb1 I forgot to let violators
      of "no Binder in vendor" rule keep their access to /dev/binder. This
      commit fixes the issue.
      
      Test: mmm system/sepolicy
      Bug: 35870313
      Bug: 36657020
      Change-Id: I3fc68df1d78e2a2da94ac9bf036a51923e3a9aae
      2ab99a13
    • Alex Klyubin's avatar
      Ban socket connections between core and vendor · 2746ae68
      Alex Klyubin authored
      On PRODUCT_FULL_TREBLE devices, non-vendor domains (coredomain) and
      vendor domain are not permitted to connect to each other's sockets.
      There are two main exceptions: (1) apps are permitted to talk to other
      apps over Unix domain sockets (this is public API in Android
      framework), and (2) domains with network access (netdomain) are
      permitted to connect to netd.
      
      This commit thus:
      * adds neverallow rules restricting socket connection establishment,
      * temporarily exempts the domains which are currently violating this
        rule from this restriction. These domains are grouped using the new
        "socket_between_core_and_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
      Bug: 36613996
      Change-Id: I458f5a09a964b06ad2bddb52538ec3a15758b003
      2746ae68
  18. Mar 24, 2017
    • 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
  19. Mar 23, 2017
    • Martijn Coenen's avatar
      Initial sepolicy for vndservicemanager. · e7d8f4c3
      Martijn Coenen authored
      vndservicemanager is the context manager for binder services
      that are solely registered and accessed from vendor processes.
      
      Bug: 36052864
      Test: vendorservicemanager runs
      Merged-In: Ifbf536932678d0ff13d019635fe6347e185ef387
      Change-Id: I430f1762eb83825f6cd4be939a69d46a8ddc80ff
      e7d8f4c3
  20. Mar 22, 2017
    • Martijn Coenen's avatar
      Initial sepolicy for vndservicemanager. · cba70be7
      Martijn Coenen authored
      vndservicemanager is the context manager for binder services
      that are solely registered and accessed from vendor processes.
      
      Bug: 36052864
      Test: vendorservicemanager runs
      Change-Id: Ifbf536932678d0ff13d019635fe6347e185ef387
      cba70be7
  21. Mar 07, 2017
Loading