Skip to content
Snippets Groups Projects
  1. Sep 15, 2017
    • Jeff Vander Stoep's avatar
      do not expand hal_cas attribute · aa5f37da
      Jeff Vander Stoep authored
      Addresses:
      junit.framework.AssertionFailedError: The following errors were
      encountered when validating the SELinuxneverallow rule:
      neverallow {   domain   -adbd   -dumpstate   -hal_drm -hal_cas -init
      -mediadrmserver   -recovery   -shell   -system_server }
      serialno_prop:file { getattr open read ioctl lock map };
      Warning!  Type or attribute hal_cas used in neverallow undefined in
      policy being checked.
      libsepol.report_failure: neverallow violated by allow mediaextractor
      serialno_prop:file { ioctl read getattr lock map open };
      libsepol.report_failure: neverallow violated by allow mediacodec
      serialno_prop:file { ioctl read getattr lock map open };
      libsepol.report_failure: neverallow violated by allow hal_cas_default
      serialno_prop:file { ioctl read getattr lock map open };
      libsepol.check_assertions: 3 neverallow failures occurred
      
      Bug: 65681219
      Test: build
      Change-Id: I2a6445d6372ee4e768cc2cea2140c6de97707a74
      Merged-In: I1092aff40da9dcf09bd044400bedd1f549eb7e38
      aa5f37da
  2. Aug 28, 2017
  3. Aug 17, 2017
  4. Aug 16, 2017
  5. Jul 25, 2017
  6. Jul 19, 2017
    • Jeff Vander Stoep's avatar
      Do not expand hal_audio attribute · 89f215e6
      Jeff Vander Stoep authored
      Fixes:
      neverallow hal_audio domain:{ tcp_socket udp_socket rawip_socket } *;
      Warning!  Type or attribute hal_audio used in neverallow undefined in
      policy being checked.
      
      hal_audio_client is not used in neverallows and was mistakenly marked
      as expandattribute false instead of hal_audio. Fix this.
      
      Bug: 63809360
      Test: build policy
      Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t \
          android.cts.security.SELinuxNeverallowRulesTest
      
          No more:
          Warning!  Type or attribute hal_audio used in neverallow
          undefined in policy being checked.
      
      Change-Id: Iedf1b80f669f95537ed201cbdbb0626e7e32be81
      89f215e6
  7. Jul 05, 2017
    • Jeff Vander Stoep's avatar
      Preserve attributes needed for CTS · 5f5aa962
      Jeff Vander Stoep authored
      Change fb889f23 "Force expand all hal_* attributes" annotated all
      hal_* attributes to be expanded to their associated types. However
      some of these attributes are used in CTS for neverallow checking.
      Mark these attributes to be preserved.
      
      In addition, remove the hacky workaround introduced in oc-dev
      for b/62658302 where extraneous neverallow rules were introduced
      to prevent unused or negated attributes from being auto-expanded
      from policy.
      
      Bug: 62658302
      Bug: 63135903
      Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t \
          android.cts.security.SELinuxNeverallowRulesTest
      
          armeabi-v7a CtsSecurityHostTestCases completed in 4s.
          501 passed, 0 failed, 0 not executed
      Merged-In: I989def70a16f66e7a18bef1191510793fbe9cb8c
      Change-Id: I989def70a16f66e7a18bef1191510793fbe9cb8c
      5f5aa962
    • Jeff Vander Stoep's avatar
      Preserve attributes needed for CTS · bf8ed096
      Jeff Vander Stoep authored
      Change fb889f23 "Force expand all hal_* attributes" annotated all
      hal_* attributes to be expanded to their associated types. However
      some of these attributes are used in CTS for neverallow checking.
      Mark these attributes to be preserved.
      
      In addition, remove the hacky workaround introduced in oc-dev
      for b/62658302 where extraneous neverallow rules were introduced
      to prevent unused or negated attributes from being auto-expanded
      from policy.
      
      Bug: 62658302
      Bug: 63135903
      Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t \
          android.cts.security.SELinuxNeverallowRulesTest
      
          armeabi-v7a CtsSecurityHostTestCases completed in 4s.
          501 passed, 0 failed, 0 not executed
      Change-Id: I989def70a16f66e7a18bef1191510793fbe9cb8c
      bf8ed096
  8. Jun 21, 2017
    • Dan Cashman's avatar
      Revert "Remove neverallow preventing hwservice access for apps." · ceed7204
      Dan Cashman authored
      This reverts commit 3e307a4d.
      
      Test: Builds - neverallow change only.
      Bug: 62806062
      Change-Id: Id3aa1b425cf48fc8586890c9850a74594584922d
      ceed7204
    • Dan Cashman's avatar
      Remove neverallow preventing hwservice access for apps. · 3e307a4d
      Dan Cashman authored
      Same-process HALs are forbidden except for very specific HALs that have
      been provided and whitelisted by AOSP.  As a result, a vendor extension
      HAL may have a need to be accessed by untrusted_app.  This is still
      discouraged, and the existing AOSP hwservices are still forbidden, but
      remove the blanket prohibition.  Also indicate that this is temporary,
      and that partners should expect to get exceptions to the rule into AOSP
      in the future.
      
      Bug: 62806062
      Test: neverallow-only change builds.  Verify new attribute is in policy.
      Change-Id: I6d3e659147d509a3503c2c9e0b6bb9016cc75832
      3e307a4d
  9. Jun 16, 2017
  10. Jun 08, 2017
  11. Jun 07, 2017
  12. May 25, 2017
    • Jeff Vander Stoep's avatar
      Force expand all hal_* attributes · fb889f23
      Jeff Vander Stoep authored
      Cutting down on the number of attributes associated with each type
      speeds up policy lookup times when there is an access vector cache
      miss.
      
      This change cuts down on the number of attributes associate with
      system_server from 19 to 8. The total number of attributes is
      reduced from 159 to 64.
      
      Bug: 36508258
      Test: build and boot Marlin
      Change-Id: I8cdb6fb783ded869e88c5a9868fd7c8f838190f9
      fb889f23
  13. May 23, 2017
    • pkanwar's avatar
      SE Policy for Tether Offload HAL · c67fa9bf
      pkanwar authored
      Update SE Policy to allow calls to and callbacks for the Tether Offload HAL
      HIDL binderized service.
      
      Bug: 38417260
      Test: New functionality. So we don't have any tests.
      Change-Id: I2c95b290523c55c081afa1bca091f368559c9125
      (cherry picked from commit 722249b3)
      c67fa9bf
    • pkanwar's avatar
      SE Policy for Tether Offload HAL · 722249b3
      pkanwar authored
      Update SE Policy to allow calls to and callbacks for the Tether Offload HAL
      HIDL binderized service.
      
      Bug: 38417260
      Test: New functionality. So we don't have any tests.
      Change-Id: I2c95b290523c55c081afa1bca091f368559c9125
      722249b3
  14. 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
  15. 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
  16. 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
    • Alex Vakulenko's avatar
      SELinux policies for PDX services · c4055f0d
      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
      Merged-Id: I78eb8ae8b6e08105666445a66bfcbd2f1d69d0ea
      c4055f0d
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. Apr 14, 2017
  23. Apr 13, 2017
  24. Apr 10, 2017
  25. Apr 07, 2017
    • Donghyun Cho's avatar
      Add sepolicy for tv.cec · f81dd0c5
      Donghyun Cho authored
      Bug: 36562029
      Test: m -j40 and CEC functionality works well
      Change-Id: I5a693e65abdd5139a848d939149a475056cc41e8
      f81dd0c5
  26. Apr 06, 2017
  27. 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
  28. Apr 04, 2017
    • Alex Klyubin's avatar
      Wifi Keystore HAL is not a HAL · 9a14704f
      Alex Klyubin authored
      Wifi Keystore HAL is a HwBinder service (currently offered by keystore
      daemon) which is used by Wifi Supplicant HAL. This commit thus
      switches the SELinux policy of Wifi Keystore HAL to the approach used
      for non-HAL HwBinder services.
      
      The basic idea is simimilar to how we express Binder services in the
      policy, with two tweaks: (1) we don't have 'hwservicemanager find' and
      thus there's no add_hwservice macro, and (2) we need loosen the
      coupling between core and vendor components. For example, it should be
      possible to move a HwBinder service offered by a core component into
      another core component, without having to update the SELinux policy of
      the vendor image. We thus annotate all components offering HwBinder
      service x across the core-vendor boundary with x_server, which enables
      the policy of clients to contain rules of the form:
      binder_call(mydomain, x_server), and, if the service uses IPC
      callbacks, also binder_call(x_server, mydomain).
      
      Test: mmm system/sepolicy
      Test: sesearch indicates to changes to binder { call transfer} between
            keystore and hal_wifi_supplicant_default domains
      Bug: 36896667
      
      Change-Id: I45c4ce8159b63869d7bb6df5c812c5291776d892
      9a14704f
    • Sohani Rao's avatar
      SE Policy for Wifi Offload HAL · 3dd460ba
      Sohani Rao authored
      Update SE Policy to allow calls to and callbacks from Wifi Offload HAL
      HIDL binderized service.
      Cherry pick from d56aa1982d15acfc2408271138dac43f1e5dc987
      
      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
      3dd460ba
  29. 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
  30. Mar 31, 2017
    • Shubang's avatar
      Add sepolicy for tv.input · c76e158c
      Shubang authored
      Test: build, flash; adb shell lshal
      Bug: 36562029
      Change-Id: If8f6d8dbd99d31e6627fa4b7c1fd4faea3b75cf2
      c76e158c
    • 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
    • Jeff Vander Stoep's avatar
      Ban core components from accessing vendor data types · cd97e710
      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.
      
      Bug: 34980020
      Test: build Marlin policy
      Change-Id: I2f0442f2628fbac1f2f7aa5ddf2a13e16b2546cc
      cd97e710
Loading