Skip to content
Snippets Groups Projects
  1. Feb 09, 2018
  2. Feb 08, 2018
    • Jeff Vander Stoep's avatar
      label /data/vendor{_ce,_de} · d25ccabd
      Jeff Vander Stoep authored
      Restrictions introduced in vendor init mean that new devices
      may not no longer exempt vendor init from writing to system_data_file.
      This means we must introduce a new label for /data/vendor which
      vendor_init may write to.
      
      Bug: 73087047
      Test: build and boot Taimen and Marlin. Complete SUW, enroll fingerprint
          No new denials.
      
      Change-Id: I65f904bb28952d4776aab947515947e14befbe34
      d25ccabd
  3. Feb 07, 2018
    • Tri Vo's avatar
      shell: remove from system_executes_vendor_violators. · bfe51254
      Tri Vo authored
      And grant explicit exemption from system_executes_vendor_violators
      neverallow rules.
      
      This does not change the policy, but is needed to test the violator
      attribute for emptiness.
      
      Bug: 72662597
      Test: build sepolicy
      Change-Id: Iba79bb42e1381b221fe0dc53470f62f8267a4791
      bfe51254
  4. Feb 05, 2018
    • Carmen Jackson's avatar
      Use a whitelisting strategy for tracefs. · 2c8ca45d
      Carmen Jackson authored
      This changes tracefs files to be default-enabled in debug mode, but
      default-disabled with specific files enabled in user mode.
      
      Bug: 64762598
      Test: Successfully took traces in user mode.
      
      Change-Id: I572ea22253e0c1e42065fbd1d2fd7845de06fceb
      2c8ca45d
  5. Jan 31, 2018
  6. Jan 30, 2018
    • Jeff Vander Stoep's avatar
      Test that /data is properly labeled · ccf965e9
      Jeff Vander Stoep authored
      Data outside of /data/vendor should have the core_data_file_type.
      Exempt data_between_core_and_vendor for some types.
      
      Ensure core_data_file_type and coredomain_socket do not get expanded
      to their underlying types.
      
      Test: build sepolicy for all targets in master (this is a build time
          test)
      Bug: 34980020
      Change-Id: I59387a87875f4603a001fb03f22fa31cae84bf5a
      (cherry picked from commit bdd45479)
      ccf965e9
  7. Jan 29, 2018
    • Tom Cherry's avatar
      Remove vendor_init from coredomain · 9c778045
      Tom Cherry authored
      vendor_init exists on the system partition, but it is meant to be an
      extention of init that runs with vendor permissions for executing
      vendor scripts, therefore it is not meant to be in coredomain.
      
      Bug: 62875318
      Test: boot walleye
      Merged-In: I01af5c9f8b198674b15b90620d02725a6e7c1da6
      Change-Id: I01af5c9f8b198674b15b90620d02725a6e7c1da6
      9c778045
  8. Jan 25, 2018
  9. Jan 23, 2018
  10. Jan 22, 2018
  11. Jan 19, 2018
  12. Jan 18, 2018
  13. Jan 16, 2018
  14. Jan 10, 2018
    • Jaekyun Seok's avatar
      Whitelist exported platform properties · e4971454
      Jaekyun Seok authored
      This CL lists all the exported platform properties in
      private/exported_property_contexts.
      
      Additionally accessing core_property_type from vendor components is
      restricted.
      Instead public_readable_property_type is used to allow vendor components
      to read exported platform properties, and accessibility from
      vendor_init is also specified explicitly.
      
      Note that whitelisting would be applied only if
      PRODUCT_COMPATIBLE_PROPERTY is set on.
      
      Bug: 38146102
      Test: tested on walleye with PRODUCT_COMPATIBLE_PROPERTY=true
      Change-Id: I304ba428cc4ca82668fec2ddeb17c971e7ec065e
      e4971454
    • Primiano Tucci's avatar
      Perfetto SELinux policies · c80f9e03
      Primiano Tucci authored
      Perfetto is a performance instrumentation and logging framework,
      living in AOSP's /external/pefetto.
      Perfetto introduces in the system one binary and two daemons
      (the binary can specialize in either depending on the cmdline).
      
      1) traced: unprivileged daemon. This is architecturally similar to logd.
         It exposes two UNIX sockets:
         - /dev/socket/traced_producer : world-accessible, allows to stream
           tracing data. A tmpfs file descriptor is sent via SCM_RIGHTS
           from traced to each client process, which needs to be able to
           mmap it R/W (but not X)
         - /dev/socket/traced_consumer : privilege-accessible (only from:
           shell, statsd). It allows to configure tracing and read the trace
           buffer.
      2) traced_probes: privileged daemon. This needs to:
         - access tracingfs (/d/tracing) to turn tracing on and off.
         - exec atrace
         - connect to traced_producer to stream data to traced.
      
      init.rc file:
      https://android-review.googlesource.com/c/platform/external/perfetto/+/575382/14/perfetto.rc
      
      Bug: 70942310
      Change-Id: Ia3b5fdacbd5a8e6e23b82f1d6fabfa07e4abc405
      c80f9e03
  15. Jan 05, 2018
    • Joel Galenson's avatar
      Update neverallow exception. · 8d92a9a1
      Joel Galenson authored
      This fixes an incorrect exception in the neverallow rule.
      
      Test: Built policy for all lunch targets.
      Change-Id: I283833131c6f1fd741e934de24c838594ac38a18
      8d92a9a1
  16. Jan 04, 2018
  17. Dec 20, 2017
  18. Dec 13, 2017
    • Tom Cherry's avatar
      Add /dev/__properties__/property_info · 8b5433a9
      Tom Cherry authored
      Allow init to create a serialized property_info file and allow all
      processes to read it.
      
      Bug: 36001741
      Test: boot bullhead, walleye using property_info
      
      Change-Id: Ie51d4c0f0221b128dd087029c811fda15b4d7093
      8b5433a9
  19. Dec 11, 2017
    • Jeff Vander Stoep's avatar
      Restore recovery's ability to format cache and preserve logs · 87dd195b
      Jeff Vander Stoep authored
      Commit b8b4f5d6 'Clean up old file-based OTA SELinux rules' removed
      many permissions from recovery, a few of which are still required.
      Restore these.
      
      [ 2918.409108] type=1400 audit(2327427.540:159): avc:  denied
      { search } for  pid=339 comm="recovery" name="/" dev="mmcblk0p38"
      ino=2 scontext=u:r:recovery:s0 tcontext=u:object_r:unlabeled:s0
      tclass=dir permissive=0
      [ 2586.563071] E:Failed to mount / create /cache/recovery: Permission
      denied
      [ 2586.780320] E:Can't open /cache/recovery/log: Permission denied
      [ 2586.850399] E:Can't open /cache/recovery/last_log: Permission
      denied
      [ 2586.918979] E:Can't open /cache/recovery/last_install: Permission
      denied
      
      [   54.035867] type=1400 audit(59206654.526:12): avc:  denied  { chown }
      for  pid=330 comm="recovery" capability=0  scontext=u:r:recovery:s0
      tcontext=u:r:recovery:s0 tclass=capability permissive=0a
      
      Bug: 70350029
      Test: xunchang to test
      Change-Id: I46ab049b8eb600b44c84a61777fade150cadd197
      87dd195b
  20. Dec 08, 2017
  21. Nov 27, 2017
    • Nick Kralevich's avatar
      Clean up old file-based OTA SELinux rules · b8b4f5d6
      Nick Kralevich authored
      Remove a number of SELinux rules which were required to support file
      based OTA. After this, we can have a much stronger assertion that files
      on /system are immutable. Tighten up the neverallow rules at the same
      time.
      
      Bug: 35853185
      Bug: 15575013
      Bug: 69664758
      Test: adb reboot recovery && adb sideload [file]
      Change-Id: I22aa208859b8478a2a90e1ed1c0f0d6b62a6664e
      b8b4f5d6
  22. Nov 22, 2017
    • Nick Kralevich's avatar
      Revert "Clean up old file-based OTA SELinux rules" · b6a05a93
      Nick Kralevich authored
      Self sideload OTA installation is aborted in #PPR1.171122.001.
      Likely cause is the removal of the file-based OTA rules. Revert
      the change while I investigate.
      
      This reverts commit 73885755.
      
      Bug: 35853185
      Bug: 69664758
      Bug: 15575013
      
      Change-Id: I65ca3bad7251f06df33eae8b2d4bcfada93ae9b8
      b6a05a93
    • Jeff Vander Stoep's avatar
      Fix CTS regressions · 6a28b68d
      Jeff Vander Stoep authored
      Commit 7688161c "hal_*_(client|server) => hal(client|server)domain"
      added neverallow rules on hal_*_client attributes while simultaneously
      expanding these attribute which causes them to fail CTS neverallow
      tests. Remove these neverallow rules as they do not impose specific
      security properties that we want to enforce.
      
      Modify Other neverallow failures which were imposed on hal_foo
      attributes and should have been enforced on hal_foo_server attributes
      instead.
      
      Bug: 69566734
      Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t \
          android.cts.security.SELinuxNeverallowRulesTest
      
          CtsSecurityHostTestCases completed in 7s. 627 passed, 1 failed
          remaining failure appears to be caused by b/68133473
      Test: build taimen-user/userdebug
      
      Change-Id: I619e71529e078235ed30dc06c60e6e448310fdbc
      6a28b68d
  23. Nov 21, 2017
    • Nick Kralevich's avatar
      Clean up old file-based OTA SELinux rules · 73885755
      Nick Kralevich authored
      Remove a number of SELinux rules which were required to support file
      based OTA. After this, we can have a much stronger assertion that files
      on /system are immutable. Tighten up the neverallow rules at the same
      time.
      
      Bug: 35853185
      Bug: 15575013
      Test: adb reboot recovery && adb sideload [file]
      Change-Id: I4238d17808bed6a81f47e14eb1797496c07642e2
      73885755
    • Jeffrey Vander Stoep's avatar
      Revert "Fix CTS regressions" · cd69bebf
      Jeffrey Vander Stoep authored
      This reverts commit ed876a5e.
      
      Fixes user builds.
      libsepol.report_failure: neverallow on line 513 of system/sepolicy/public/domain.te (or line 9149 of policy.conf) violated by allow update_verifier misc_block_device:blk_file { ioctl read write lock append open }; 
      libsepol.check_assertions: 1 neverallow failures occurred 
      Error while expanding policy
      Bug: 69566734
      Test: build taimen-user
      Change-Id: I969b7539dce547f020918ddc3e17208fc98385c4
      cd69bebf
    • Jeff Vander Stoep's avatar
      Fix CTS regressions · ed876a5e
      Jeff Vander Stoep authored
      Commit 7688161c "hal_*_(client|server) => hal(client|server)domain"
      added neverallow rules on hal_*_client attributes while simultaneously
      expanding these attribute which causes them to fail CTS neverallow
      tests. Remove these neverallow rules as they do not impose specific
      security properties that we want to enforce.
      
      Modify Other neverallow failures which were imposed on hal_foo
      attributes and should have been enforced on hal_foo_server attributes
      instead.
      
      Bug: 69566734
      Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t \
          android.cts.security.SELinuxNeverallowRulesTest
      
          CtsSecurityHostTestCases completed in 7s. 627 passed, 1 failed
          remaining failure appears to be caused by b/68133473
      Change-Id: I83dcb33c3a057f126428f88a90b95f3f129d9f0e
      ed876a5e
    • Benjamin Gordon's avatar
      sepolicy: Add rules for non-init namespaces · 9b2e0cbe
      Benjamin Gordon authored
      In kernel 4.7, the capability and capability2 classes were split apart
      from cap_userns and cap2_userns (see kernel commit
      8e4ff6f228e4722cac74db716e308d1da33d744f). Since then, Android cannot be
      run in a container with SELinux in enforcing mode.
      
      This change applies the existing capability rules to user namespaces as
      well as the root namespace so that Android running in a container
      behaves the same on pre- and post-4.7 kernels.
      
      This is essentially:
        1. New global_capability_class_set and global_capability2_class_set
           that match capability+cap_userns and capability2+cap2_userns,
           respectively.
        2. s/self:capability/self:global_capability_class_set/g
        3. s/self:capability2/self:global_capability2_class_set/g
        4. Add cap_userns and cap2_userns to the existing capability_class_set
           so that it covers all capabilities.  This set was used by several
           neverallow and dontaudit rules, and I confirmed that the new
           classes are still appropriate.
      
      Test: diff new policy against old and confirm that all new rules add
            only cap_userns or cap2_userns;
            Boot ARC++ on a device with the 4.12 kernel.
      Bug: crbug.com/754831
      
      Change-Id: I4007eb3a2ecd01b062c4c78d9afee71c530df95f
      9b2e0cbe
  24. Nov 20, 2017
    • Nick Kralevich's avatar
      Make /proc/sys/kernel/random available to everyone · 9d9c370f
      Nick Kralevich authored
      Similar to the way we handle /dev/random and /dev/urandom, make
      /proc/sys/kernel/random available to everyone.
      
        hostname:/proc/sys/kernel/random # ls -laZ
        total 0
        dr-xr-xr-x 1 root root u:object_r:proc_random:s0 0 2017-11-20 19:02 .
        dr-xr-xr-x 1 root root u:object_r:proc:s0        0 2017-11-20 18:32 ..
        -r--r--r-- 1 root root u:object_r:proc_random:s0 0 2017-11-20 19:02 boot_id
        -r--r--r-- 1 root root u:object_r:proc_random:s0 0 2017-11-20 19:02 entropy_avail
        -r--r--r-- 1 root root u:object_r:proc_random:s0 0 2017-11-20 19:02 poolsize
        -rw-r--r-- 1 root root u:object_r:proc_random:s0 0 2017-11-20 19:02 read_wakeup_threshold
        -rw-r--r-- 1 root root u:object_r:proc_random:s0 0 2017-11-20 19:02 urandom_min_reseed_secs
        -r--r--r-- 1 root root u:object_r:proc_random:s0 0 2017-11-20 19:02 uuid
        -rw-r--r-- 1 root root u:object_r:proc_random:s0 0 2017-11-20 19:02 write_wakeup_threshold
      
      boot_id (unique random number per boot) is commonly used by
      applications, as is "uuid". As these are random numbers, no sensitive
      data is leaked. The other files are useful to allow processes to
      understand the state of the entropy pool, and should be fairly benign.
      
      Addresses the following denial:
      
        type=1400 audit(0.0:207): avc: denied { read } for name="boot_id"
        dev="proc" ino=76194 scontext=u:r:untrusted_app_25:s0:c512,c768
        tcontext=u:object_r:proc:s0 tclass=file permissive=0
      
      Bug: 69294418
      Test: policy compiles.
      Change-Id: Ieeca1c654ec755123e19b4693555990325bd58cf
      9d9c370f
    • Jeff Vander Stoep's avatar
      Move platform/vendor data violations to device policy · d4785c37
      Jeff Vander Stoep authored
      Sharing data folders by path will be disallowed because it violates
      the approved API between platform and vendor components tested by
      VTS. Move all violating permissions from core selinux policy to
      device specific policy so that we can exempt existing devices from
      the ban and enforce it on new devices.
      
      Bug: 34980020
      Test: Move permissions. Build and test wifi, wifi AP, nfc, fingerprint
          and Play movies on Marlin and Taimen.
      Test: build on Angler, Bullhead, Dragon, Fugu, Marlin, Walleye
      
      Change-Id: Ib6fc9cf1403e74058aaae5a7b0784922f3172b4e
      d4785c37
  25. Nov 17, 2017
    • Jeff Vander Stoep's avatar
      Allow AOSP processes to read pm_prop · 0f5ad4e5
      Jeff Vander Stoep authored
      Exclude vendor processes.
      
      Bug: 69309298
      Test: cts-tradefed run cts -m CtsCompilationTestCases
          completed in 33s. 5 passed, 0 failed
      Test: runtest frameworks-services -c \
          com.android.server.pm.dex.DexoptOptionsTests \
          --install=".*FrameworksServicesTests.apk"
          OK (5 tests)
      
      Change-Id: Ic02caf373e2214b4b931a724ca8d4f4effbc0741
      0f5ad4e5
  26. Nov 09, 2017
    • Jeff Vander Stoep's avatar
      Allow vendor apps to use surfaceflinger_service · 63f46773
      Jeff Vander Stoep authored
      Vendor apps may only use servicemanager provided services
      marked as app_api_service. surfaceflinger_service should be
      available to vendor apps, so add this attribute and clean up
      duplicate grants.
      
      Addresses:
      avc:  denied  { find } scontext=u:r:qtelephony:s0
      tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager
      avc:  denied  { find } scontext=u:r:ssr_detector:s0
      tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager
      avc:  denied  { find } scontext=u:r:qcneservice:s0
      tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager
      
      Bug: 69064190
      Test: build
      Change-Id: I00fcf43b0a8bde232709aac1040a5d7f4792fa0f
      63f46773
  27. Nov 08, 2017
    • Jeff Vander Stoep's avatar
      wifi_supplicant: refactor permissions · f6375971
      Jeff Vander Stoep authored
      1. remove some duplicate permissions.
      2. Grant permissions to su for dgram sockets in a way that is
         consistent to how we grant permissions to stream_sockets.
      
      Bug: 34980020
      Test: build
      Change-Id: I50e01d51444a70ead3ef40b52eda8eb29732b46c
      f6375971
  28. Oct 25, 2017
    • Tom Cherry's avatar
      add vendor_init.te · 621c24cb
      Tom Cherry authored
      First pass at adding vendor_init.te
      
      Bug: 62875318
      Test: boot sailfish with vendor_init
      Change-Id: I35cc9be324075d8baae866d6de4166c37fddac68
      621c24cb
  29. Oct 20, 2017
    • Nick Kralevich's avatar
      disallow SIOCATMARK · 93615b14
      Nick Kralevich authored
      The use of SIOCATMARK is not recommended per rfc6093.
      
      This ioctl is not currently allowed on Android. Add a neverallowxperm
      statement (compile time assertion + CTS test) to ensure this never
      regresses.
      
      Bug: 68014825
      Test: policy compiles.
      Change-Id: I41272a0cb157ac9aa38c8e67aabb8385403815f9
      93615b14
  30. Oct 04, 2017
  31. Oct 03, 2017
  32. Sep 26, 2017
Loading