Skip to content
Snippets Groups Projects
  1. Apr 26, 2018
    • Max Bires's avatar
      Adding ability for keystore to find dropbox · d2d91e60
      Max Bires authored
      This will allow the logging in keystore to actually work.
      
      Bug: 36549319
      Test: keystore dropbox logging is successful
      Change-Id: Ic135fa9624c289c54187e946affbd0caacef13c1
      (cherry picked from commit 2e69afc079a175070279674be78aacbe4434c367)
      d2d91e60
  2. Jul 24, 2017
    • Jeff Vander Stoep's avatar
      Move domain_deprecated into private policy · 7c34e83f
      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.
      Merged-In: I31beeb5bdf3885195310b086c1af3432dc6a349b
      Change-Id: I31beeb5bdf3885195310b086c1af3432dc6a349b
      (cherry picked from commit 76aab82c)
      7c34e83f
  3. 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
  4. 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
  5. 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
  6. 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
  7. Mar 29, 2017
    • Roshan Pius's avatar
      sepolicy: Add new wifi keystore HAL · 9af7c95f
      Roshan Pius authored
      Moving the wpa_supplicant interaction from the binder keystore service
      to the new wifi keystore HAL.
      
      Denials addressed:
      03-29 00:04:52.075   734   734 E SELinux : avc:  denied  { get } for
      pid=638 uid=1010 scontext=u:r:hal_wifi_keystore_default:s0
      tcontext=u:r:keystore:s0 tclass=keystore_key
      
      Bug: 34603782
      Test: Able to connect to wifi passpoint networks. Denials no longer
      seen.
      Change-Id: I97eb9a4aa9968056a2f1fcc7ce5509ceb62fd41e
      9af7c95f
  8. Feb 23, 2017
    • Alex Klyubin's avatar
      Switch Keymaster HAL policy to _client/_server · f7543d27
      Alex Klyubin authored
      This switches Keymaster HAL policy to the design which enables us to
      conditionally remove unnecessary rules from domains which are clients
      of Keymaster HAL.
      
      Domains which are clients of Keymaster HAL, such as keystore and vold
      domains, are granted rules targeting hal_keymaster only when the
      Keymaster HAL runs in passthrough mode (i.e., inside the client's
      process). When the HAL runs in binderized mode (i.e., in another
      process/domain, with clients talking to the HAL over HwBinder IPC),
      rules targeting hal_keymaster are not granted to client domains.
      
      Domains which offer a binderized implementation of Keymaster HAL, such
      as hal_keymaster_default domain, are always granted rules targeting
      hal_keymaster.
      
      Test: Password-protected sailfish boots up and lock screen unlocks --
            this exercises vold -> Keymaster HAL interaction
      Test: All Android Keystore CTS tests pass -- this exercises keystore ->
            Keymaster HAL interaction:
            make cts cts-tradefed
            cts-tradefed run singleCommand cts --skip-device-info \
            --skip-preconditions --skip-connectivity-check --abi arm64-v8a \
            --module CtsKeystoreTestCases
      Bug: 34170079
      
      Change-Id: I2254d0fdee72145721654d6c9e6e8d3331920ec7
      f7543d27
  9. Feb 10, 2017
    • Jeff Vander Stoep's avatar
      Remove logspam · a1b45600
      Jeff Vander Stoep authored
      Grant observed uses of permissions being audited in domain_deprecated.
      
      fsck
      avc: granted { getattr } for path="/" dev="dm-0" ino=2 scontext=u:r:fsck:s0 tcontext=u:object_r:rootfs:s0 tclass=dir
      
      keystore
      avc: granted { read open } for path="/vendor/lib64/hw" dev="dm-1" ino=168 scontext=u:r:keystore:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      sdcardd
      avc: granted { read open } for path="/proc/filesystems" dev="proc" ino=4026532412 scontext=u:r:sdcardd:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      update_engine
      avc: granted { getattr } for path="/proc/misc" dev="proc" ino=4026532139 scontext=u:r:update_engine:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { read open } for path="/proc/misc" dev="proc" ino=4026532139 scontext=u:r:update_engine:s0 tcontext=u:object_r:proc:s0 tclass=file
      avc: granted { read } for name="hw" dev="dm-1" ino=168 scontext=u:r:update_engine:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      vold
      avc: granted { read open } for path="/vendor/lib64/hw" dev="dm-1" ino=168 scontext=u:r:vold:s0 tcontext=u:object_r:system_file:s0 tclass=dir
      
      Test: Marlin builds and boots, avc granted messages no longer observed.
      Bug: 35197529
      Change-Id: Iae34ae3b9e22ba7550cf7d45dc011ab043e63424
      a1b45600
  10. Jan 27, 2017
    • Janis Danisevskis's avatar
      Preliminary policy for hal_keymaster (TREBLE) · e8acd769
      Janis Danisevskis authored
      This adds the premissions required for
      android.hardware.keymaster@2.0-service to access the keymaster TA
      as well as for keystore and vold to lookup and use
      android.hardware.keymaster@2.0-service.
      
      IT DOES NOT remove the privileges from keystore and vold to access
      the keymaster TA directly.
      
      Test: Run keystore CTS tests
      Bug: 32020919
      
      (cherry picked from commit 5090d6f3)
      
      Change-Id: Ib02682da26e2dbcabd81bc23169f9bd0e832eb19
      e8acd769
  11. Jan 26, 2017
    • William Roberts's avatar
      te_macros: introduce add_service() macro · 606d2fd6
      William Roberts authored
      
      Introduce the add_service() macro which wraps up add/find
      permissions for the source domain with a neverallow preventing
      others from adding it. Only a particular domain should
      add a particular service.
      
      Use the add_service() macro to automatically add a neverallow
      that prevents other domains from adding the service.
      
      mediadrmserver was adding services labeled mediaserver_service.
      Drop the add permission as it should just need the find
      permission.
      
      Additionally, the macro adds the { add find } permission which
      causes some existing neverallow's to assert. Adjust those
      neverallow's so "self" can always find.
      
      Test: compile and run on hikey and emulator. No new denials were
      found, and all services, where applicable, seem to be running OK.
      
      Change-Id: Ibbd2a5304edd5f8b877bc86852b0694732be993c
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      606d2fd6
  12. Jan 18, 2017
    • Janis Danisevskis's avatar
      Preliminary policy for hal_keymaster (TREBLE) · 5090d6f3
      Janis Danisevskis authored
      This adds the premissions required for
      android.hardware.keymaster@2.0-service to access the keymaster TA
      as well as for keystore and vold to lookup and use
      android.hardware.keymaster@2.0-service.
      
      IT DOES NOT remove the privileges from keystore and vold to access
      the keymaster TA directly.
      
      Test: Run keystore CTS tests
      Bug: 32020919
      Change-Id: I9467ee29232cc54b48a6dae8ae240656999f73bf
      5090d6f3
  13. Oct 06, 2016
    • dcashman's avatar
      Split general policy into public and private components. · cc39f637
      dcashman authored
      Divide policy into public and private components.  This is the first
      step in splitting the policy creation for platform and non-platform
      policies.  The policy in the public directory will be exported for use
      in non-platform policy creation.  Backwards compatibility with it will
      be achieved by converting the exported policy into attribute-based
      policy when included as part of the non-platform policy and a mapping
      file will be maintained to be included with the platform policy that
      maps exported attributes of previous versions to the current platform
      version.
      
      Eventually we would like to create a clear interface between the
      platform and non-platform device components so that the exported policy,
      and the need for attributes is minimal.  For now, almost all types and
      avrules are left in public.
      
      Test: Tested by building policy and running on device.
      
      Change-Id: Idef796c9ec169259787c3f9d8f423edf4ce27f8c
      cc39f637
  14. Sep 14, 2016
  15. Sep 10, 2016
  16. Sep 09, 2016
  17. Aug 29, 2016
  18. Aug 10, 2016
  19. Jun 06, 2016
  20. Feb 05, 2016
    • Nick Kralevich's avatar
      Replace "neverallow domain" by "neverallow *" · 35a14514
      Nick Kralevich authored
      Modify many "neverallow domain" rules to be "neverallow *" rules
      instead. This will catch more SELinux policy bugs where a label
      is assigned an irrelevant rule, as well as catch situations where
      a domain attribute is not assigned to a process.
      
      Change-Id: I5b83a2504c13b384f9dff616a70ca733b648ccdf
      35a14514
  21. Nov 03, 2015
    • Jeff Vander Stoep's avatar
      Create attribute for moving perms out of domain · d22987b4
      Jeff Vander Stoep authored
      Motivation: Domain is overly permissive. Start removing permissions
      from domain and assign them to the domain_deprecated attribute.
      Domain_deprecated and domain can initially be assigned to all
      domains. The goal is to not assign domain_deprecated to new domains
      and to start removing domain_deprecated where it is not required or
      reassigning the appropriate permissions to the inheriting domain
      when necessary.
      
      Bug: 25433265
      Change-Id: I8b11cb137df7bdd382629c98d916a73fe276413c
      d22987b4
  22. May 29, 2015
  23. Apr 29, 2015
  24. Mar 13, 2015
    • Stephen Smalley's avatar
      Move allow rules before neverallow rules. · b8caf7fd
      Stephen Smalley authored
      
      There were a few instances where allow rules were appended
      after the neverallow rules stanza in the .te file.  Also
      there were some regular allow rules inserted into the CTS-specific
      rules section of app.te.  Just move the rules as appropriate.
      Should be no change in policy.
      
      Change-Id: Iec76f32d4b531d245bbf5dd9f621a71ff5c71f3e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      b8caf7fd
  25. Dec 15, 2014
    • dcashman's avatar
      Restrict service_manager find and list access. · cd82557d
      dcashman authored
      All domains are currently granted list and find service_manager
      permissions, but this is not necessary.  Pare the permissions
      which did not trigger any of the auditallow reporting.
      
      Bug: 18106000
      Change-Id: Ie0ce8de2af8af2cbe4ce388a2dcf4534694c994a
      cd82557d
  26. Oct 22, 2014
  27. Jul 25, 2014
    • Nick Kralevich's avatar
      Resync lmp-dev-plus-aosp with master · d065f048
      Nick Kralevich authored
      A DO NOT MERGE change merged from lmp-dev to lmp-dev-plus-aosp.
      This is expected, but it's causing unnecessary merge conflicts
      when handling AOSP contributions.
      
      Resolve those conflicts.
      
      This is essentially a revert of bf696327
      for lmp-dev-plus-aosp only.
      
      Change-Id: Icc66def7113ab45176ae015f659cb442d53bce5c
      d065f048
  28. Jul 18, 2014
  29. Jul 15, 2014
    • Riley Spahn's avatar
      Add access control for each service_manager action. · 344fc109
      Riley Spahn authored
      Add SELinux MAC for the service manager actions list
      and find. Add the list and find verbs to the
      service_manager class. Add policy requirements for
      service_manager to enforce policies to binder_use
      macro.
      
      (cherry picked from commit b8511e0d)
      
      Change-Id: I980d4a8acf6a0c6e99a3a7905961eb5564b1be15
      344fc109
  30. Jul 14, 2014
    • Riley Spahn's avatar
      Add access control for each service_manager action. · b8511e0d
      Riley Spahn authored
      Add SELinux MAC for the service manager actions list
      and find. Add the list and find verbs to the
      service_manager class. Add policy requirements for
      service_manager to enforce policies to binder_use
      macro.
      
      Change-Id: I224b1c6a6e21e3cdeb23badfc35c82a37558f964
      b8511e0d
  31. Jun 26, 2014
    • Riley Spahn's avatar
      Adding policies for KeyStore MAC. · 1196d2a5
      Riley Spahn authored
      Add keystore_key class and an action for each action supported
      by keystore. Add policies that replicate the access control that
      already exists in keystore. Add auditallow rules for actions
      not known to be used frequently. Add macro for those domains
      wishing to access keystore.
      
      Change-Id: Iddd8672b9e9b72b45ee208e6eda608cc9dc61edc
      1196d2a5
  32. Jun 12, 2014
    • Riley Spahn's avatar
      Add SELinux rules for service_manager. · f90c41f6
      Riley Spahn authored
      Add a service_mananger class with the verb add.
      Add a type that groups the services for each of the
      processes that is allowed to start services in service.te
      and an attribute for all services controlled by the service
      manager. Add the service_contexts file which maps service
      name to target label.
      
      Bug: 12909011
      Change-Id: I017032a50bc90c57b536e80b972118016d340c7d
      f90c41f6
  33. May 20, 2014
    • Nick Kralevich's avatar
      Don't allow ptrace on keystore · 8aa754c9
      Nick Kralevich authored
      keystore may hold sensitive information in it's memory. Don't
      allow anyone to ptrace keystore.
      
      Change-Id: I4e3717e482b9fd128d38ce687c03122d41678b6f
      8aa754c9
  34. May 09, 2014
    • Nick Kralevich's avatar
      Protect keystore's files. · cd905ec0
      Nick Kralevich authored
      Only keystore itself should be reading / writing it's files.
      Remove keystore file access from other SELinux domains, including
      unconfined. Add neverallow rules to protect against regressions.
      Allow init limited access to recurse into keystore's directory.
      
      Change-Id: I0bb5de7804f4314997c16fac18507933014bcadf
      cd905ec0
  35. Jan 08, 2014
    • Nick Kralevich's avatar
      Allow keystore to talk to the tee · b23d2876
      Nick Kralevich authored
      On manta, the keystore CTS tests are failing, because
      keystore isn't allowed to talk to the tee. Allow it.
      
      I've only seen this bug on manta, but it seems appropriate
      for all domains.
      
      Fixes the following denial:
      
      <5>[  286.249563] type=1400 audit(1389210059.924:6): avc:  denied  { connectto } for  pid=126 comm="keystore" path=006D636461656D6F6E scontext=u:r:keystore:s0 tcontext=u:r:tee:s0 tclass=unix_stream_socket
      
      Bug: 12450710
      Change-Id: I07133d9abeaf967392118ba478a5a391cf0c5fa5
      b23d2876
  36. Nov 06, 2013
  37. Nov 05, 2013
    • Nick Kralevich's avatar
      Revert "Make the keystore domain enforcing." · 2d8dcb73
      Nick Kralevich authored
      This is causing runtime restarts on flo/deb when uninstalling
      some APKs. Revert while I investigate it.
      
      11-04 21:52:41.487   687   704 I ActivityManager: Force stopping com.android.development appid=10078 user=-1: uninstall pkg
      11-04 21:52:41.487   687   712 W PackageManager: Couldn't delete native library directory /data/app-lib/com.android.development
      11-04 21:52:41.557   687   712 W dalvikvm: threadid=20: thread exiting with uncaught exception (group=0x959dfae8)
      11-04 21:52:41.557   687   712 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: PackageManager
      11-04 21:52:41.557   687   712 E AndroidRuntime: java.lang.NullPointerException
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.security.KeyStore.clearUid(KeyStore.java:327)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.removeKeystoreDataIfNeeded(PackageManagerService.java:9787)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.removePackageDataLI(PackageManagerService.java:9384)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.deleteInstalledPackageLI(PackageManagerService.java:9503)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.deletePackageLI(PackageManagerService.java:9612)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.deletePackageX(PackageManagerService.java:9239)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.access$4100(PackageManagerService.java:178)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService$7.run(PackageManagerService.java:9173)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:733)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:136)
      11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.os.HandlerThread.run(HandlerThread.java:61)
      11-04 21:52:41.567   687   712 I Process : Sending signal. PID: 687 SIG: 9
      
      and
      
      [    7.324554] type=1400 audit(1383601030.823:5): avc:  denied  { read write } for  pid=192 comm="keystore" name="qseecom" dev="tmpfs" ino=7521 scontext=u:r:keystore:s0 tcontext=u:object_r:device:s0 tclass=chr_file
      
      This reverts commit 709d7183.
      
      Bug: 11518274
      2d8dcb73
  38. Oct 31, 2013
  39. Oct 29, 2013
  40. Oct 21, 2013
    • Nick Kralevich's avatar
      Move unconfined domains out of permissive mode. · 353c72e3
      Nick Kralevich authored
      This change removes the permissive line from unconfined
      domains. Unconfined domains can do (mostly) anything, so moving
      these domains into enforcing should be a no-op.
      
      The following domains were deliberately NOT changed:
      1) kernel
      2) init
      
      In the future, this gives us the ability to tighten up the
      rules in unconfined, and have those tightened rules actually
      work.
      
      When we're ready to tighten up the rules for these domains,
      we can:
      
      1) Remove unconfined_domain and re-add the permissive line.
      2) Submit the domain in permissive but NOT unconfined.
      3) Remove the permissive line
      4) Wait a few days and submit the no-permissive change.
      
      For instance, if we were ready to do this for adb, we'd identify
      a list of possible rules which allow adbd to work, re-add
      the permissive line, and then upload those changes to AOSP.
      After sufficient testing, we'd then move adb to enforcing.
      We'd repeat this for each domain until everything is enforcing
      and out of unconfined.
      
      Change-Id: If674190de3262969322fb2e93d9a0e734f8b9245
      353c72e3
Loading