Skip to content
Snippets Groups Projects
  1. Feb 22, 2017
    • Alex Klyubin's avatar
      Switch Wi-Fi HAL policy to _client/_server · 1d2a1476
      Alex Klyubin authored
      This switches Wi-Fi HAL policy to the design which enables us to
      conditionally remove unnecessary rules from domains which are clients
      of Wi-Fi HAL.
      
      Domains which are clients of Wi-Fi HAL, such as system_server domain,
      are granted rules targeting hal_wifi only when the Wi-Fi 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_wifi are
      not granted to client domains.
      
      Domains which offer a binderized implementation of Wi-Fi HAL, such as
      hal_wifi_default domain, are always granted rules targeting hal_wifi.
      
      Test: Setup Wizard (incl. adding a Google Account) completes fine with
            Wi-Fi connectivity only
      Test: Toggle Wi-Fi off, on, off, on
      Test: Use System UI to see list of WLANs and connect to one which does
            not require a password, and to one which requries a PSK
      Test: ip6.me loads fine in Chrome over Wi-Fi
      Bug: 34170079
      
      Change-Id: I7a216a06727c88b7f2c23d529f67307e83bed17f
      1d2a1476
    • Alex Klyubin's avatar
      Switch Dumpstate HAL policy to _client/_server · 47174e3b
      Alex Klyubin authored
      This switches Dumpstate HAL policy to the design which enables us to
      conditionally remove unnecessary rules from domains which are clients
      of Dumpstate HAL.
      
      Domains which are clients of Dumpstate HAL, such as dumpstate domain,
      are granted rules targeting hal_dumpstate only when the Dumpstate 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_dumpstate are not granted to client domains.
      
      Domains which offer a binderized implementation of Dumpstate HAL, such
      as hal_dumpstate_default domain, are always granted rules targeting
      hal_dumpstate.
      
      Test: adb bugreport
      Test: Take bugreport through system UI
      Bug: 34170079
      Change-Id: I3e827534af03cdfa876921c5fa4af3a53025ba27
      47174e3b
    • Alex Klyubin's avatar
      Switch Fingerprint HAL policy to _client/_server · f98650e4
      Alex Klyubin authored
      This switches Fingerprint HAL policy to the design which enables us to
      conditionally remove unnecessary rules from domains which are clients
      of Bluetooth HAL.
      
      Domains which are clients of Fingerprint HAL, such as system_server
      domain, are granted rules targeting hal_fingerprint only when the
      Fingerprint 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_fingerprint are not granted to client domains.
      
      Domains which offer a binderized implementation of Fingerprint HAL,
      such as hal_fingerprint_default domain, are always granted rules
      targeting hal_fingerprint.
      
      NOTE: This commit also removes unnecessary allow rules from
      Fingerprint HAL, such access to servicemanager (not hwservicemanager)
      and access to keystore daemon over Binder IPC. Fingerprint HAL does
      not use this functionality anyway and shouldn't use it either.
      
      Test: Enable fingerprint + PIN secure lock screen, confirm it unlocks
            with fingerprint or PIN
      Test: Disable PIN (and thus fingerprint) secure lock screen
      Test: make FingerprintDialog, install, make a fake purchase
      Test: Add fingerprint_hidl_hal_test to device.mk, build & add to device,
            adb shell stop,
            adb shell /data/nativetest64/fingerprint_hidl_hal_test/fingerprint_hidl_hal_test -- all tests pass
      Bug: 34170079
      
      Change-Id: I6951c0f0640194c743ff7049357c77f5f21b71a1
      f98650e4
  2. Feb 17, 2017
    • Alex Klyubin's avatar
      Switch DRM HAL policy to _client/_server · 9b718c40
      Alex Klyubin authored
      This switches DRM HAL policy to the design which enables us to
      conditionally remove unnecessary rules from domains which are clients
      of DRM HAL.
      
      Domains which are clients of DRM HAL, such as mediadrmserver domain,
      are granted rules targeting hal_drm only when the DRM 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_drm
      are not granted to client domains.
      
      Domains which offer a binderized implementation of DRM HAL, such as
      hal_drm_default domain, are always granted rules targeting hal_drm.
      
      Test: Play movie using Google Play Movies
      Test: Play movie using Netflix
      Bug: 34170079
      Change-Id: I3ab0e84818ccd61e54b90f7ade3509b7dbf86fb9
      9b718c40
    • Alex Klyubin's avatar
      Switch Bluetooth HAL policy to _client/_server · 168435fe
      Alex Klyubin authored
      This switches Bluetooth HAL policy to the design which enables us to
      conditionally remove unnecessary rules from domains which are clients
      of Bluetooth HAL.
      
      Domains which are clients of Bluetooth HAL, such as bluetooth domain,
      are granted rules targeting hal_bluetooth only when the Bluetooth 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_bluetooth are not granted to client domains.
      
      Domains which offer a binderized implementation of Bluetooth HAL, such
      as hal_bluetooth_default domain, are always granted rules targeting
      hal_bluetooth.
      
      Test: Toggle Bluetooth off and on
      Test: Pair with another Android, and transfer a file to that Android
            over Bluetooth
      Test: Pair with a Bluetooth speaker, play music through that
            speaker over Bluetooth
      Test: Add bluetooth_hidl_hal_test to device.mk, build & add to device,
            adb shell stop,
            adb shell /data/nativetest64/bluetooth_hidl_hal_test/bluetooth_hidl_hal_test
      Bug: 34170079
      Change-Id: I05c3ccf1e98cbbc1450a81bb1000c4fb75eb8a83
      168435fe
    • Alex Klyubin's avatar
      Switch Camera HAL policy to _client/_server · 3a8426bf
      Alex Klyubin authored
      This switches Camera HAL policy to the design which enables us to
      conditionally remove unnecessary rules from domains which are clients
      of Camera HAL.
      
      Domains which are clients of Camera HAL, such as cameraserver domain,
      are granted rules targeting hal_camera only when the Camera 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_camera are
      not granted to client domains.
      
      Domains which offer a binderized implementation of Camera HAL, such
      as hal_camera_default domain, are always granted rules targeting
      hal_camera.
      
      Test: Take non-HDR photo using Google Camera app
      Test: Take HDR photo using Google Camera app
      Test: Record video using Google Camera app
      Bug: 34170079
      Change-Id: I463646cf79fede57f11ccd4ec2cbc37a4fff141e
      3a8426bf
  3. Feb 15, 2017
    • Alex Klyubin's avatar
      Use _client and _server for Audio HAL policy · ac2b4cd2
      Alex Klyubin authored
      This starts the switch for HAL policy to the approach where:
      * domains which are clients of Foo HAL are associated with
        hal_foo_client attribute,
      * domains which offer the Foo HAL service over HwBinder are
        associated with hal_foo_server attribute,
      * policy needed by the implementation of Foo HAL service is written
        against the hal_foo attribute. This policy is granted to domains
        which offer the Foo HAL service over HwBinder and, if Foo HAL runs
        in the so-called passthrough mode (inside the process of each
        client), also granted to all domains which are clients of Foo HAL.
        hal_foo is there to avoid duplicating the rules for hal_foo_client
        and hal_foo_server to cover the passthrough/in-process Foo HAL and
        binderized/out-of-process Foo HAL cases.
      
      A benefit of associating all domains which are clients of Foo HAL with
      hal_foo (when Foo HAL is in passthrough mode) is that this removes the
      need for device-specific policy to be able to reference these domains
      directly (in order to add device-specific allow rules). Instead,
      device-specific policy only needs to reference hal_foo and should no
      longer need to care which particular domains on the device are clients
      of Foo HAL. This can be seen in simplification of the rules for
      audioserver domain which is a client of Audio HAL whose policy is
      being restructured in this commit.
      
      This commit uses Audio HAL as an example to illustrate the approach.
      Once this commit lands, other HALs will also be switched to this
      approach.
      
      Test: Google Play Music plays back radios
      Test: Google Camera records video with sound and that video is then
            successfully played back with sound
      Test: YouTube app plays back clips with sound
      Test: YouTube in Chrome plays back clips with sound
      Bug: 34170079
      Change-Id: I2597a046753edef06123f0476c2ee6889fc17f20
      ac2b4cd2
  4. Feb 14, 2017
    • Jeff Vander Stoep's avatar
      untrusted_app: policy versioning based on targetSdkVersion · bacb6d79
      Jeff Vander Stoep authored
      Motivation:
      Provide the ability to phase in new security policies by
      applying them to apps with a minimum targetSdkVersion.
      
      Place untrusted apps with targetSdkVersion<=25 into the
      untrustd_app_25 domain. Apps with targetSdkVersion>=26 are placed
      into the untrusted_app domain. Common rules are included in the
      untrusted_app_all attribute. Apps with a more recent targetSdkVersion
      are granted fewer permissions.
      
      Test: Marlin builds and boots. Apps targeting targetSdkVersion<=25
      run in untrusted_app_25 domain. Apps targeting the current development
      build >=26 run in the untrusted_app domain with fewer permissions. No
      new denials observed during testing.
      Bug: 34115651
      Bug: 35323421
      Change-Id: Ie6a015566fac07c44ea06c963c40793fcdc9a083
      bacb6d79
  5. Feb 02, 2017
    • Jiyong Park's avatar
      configstore: add selinux policy for configstore@1.0 hal · ebec1aa2
      Jiyong Park authored
      This change adds selinux policy for configstore@1.0 hal. Currently, only
      surfaceflinger has access to the HAL, but need to be widen.
      
      Bug: 34314793
      Test: build & run
      
      Merged-In: I40e65032e9898ab5f412bfdb7745b43136d8e964
      Change-Id: I40e65032e9898ab5f412bfdb7745b43136d8e964
      (cherry picked from commit 5ff0f178)
      ebec1aa2
  6. 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
    • Badhri Jagan Sridharan's avatar
      sepolicy for usb hal · ae206f16
      Badhri Jagan Sridharan authored
      Bug: 31015010
      
      cherry-pick from b6e4d4bd
      
      Test: checked for selinux denial msgs in the dmesg logs.
      Change-Id: I8285ea05162ea0d75459e873e5c2bad2dbc7e5ba
      ae206f16
  7. Jan 25, 2017
  8. Jan 20, 2017
  9. Jan 18, 2017
  10. Jan 17, 2017
    • Alex Klyubin's avatar
      Group all HAL impls using haldomain attribute · f41d89eb
      Alex Klyubin authored
      This marks all HAL domain implementations with the haldomain attribute
      so that rules can be written which apply to all HAL implementations.
      
      This follows the pattern used for appdomain, netdomain and
      bluetoothdomain.
      
      Test: No change to policy according to sesearch.
      Bug: 34180936
      Change-Id: I0cfe599b0d49feed36538503c226dfce41eb65f6
      f41d89eb
  11. Jan 13, 2017
    • Jim Miller's avatar
      New SeLinux policy for fingerprint HIDL · 54e0e5af
      Jim Miller authored
      Move from fingerprintd to new fingerprint_hal and update SeLinux policy.
      
      Test: Boot with no errors related to fingerprint sepolicy
      Bug: 33199080
      Change-Id: Idfde0cb0530e75e705033042f64f3040f6df22d6
      54e0e5af
    • Hridya Valsaraju's avatar
      add selinux policy for GNSS hal · 953c4396
      Hridya Valsaraju authored
      The following are the avc denials that are addressed:
      
      avc: denied { call } for pid=889 comm="system_server"
      scontext=u:r:system_server:s0 tcontext=u:r:hal_gnss_default:s0
      tclass=binder permissive=0
      
      avc: denied { call } for scontext=u:r:hal_gnss_default:s0
      tcontext=u:r:system_server:s0 tclass=binder permissive=0
      
      avc: denied { read } for name="hw" dev="mmcblk0p43" ino=1837
      scontext=u:r:hal_gnss_default:s0 tcontext=u:object_r:system_file:s0
      tclass=dir permissive=0
      
      avc: denied { open } for path="/system/lib64/hw" dev="mmcblk0p43"
      ino=1837 scontext=u:r:hal_gnss_default:s0
      tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
      
      Bug:31974439
      
      Test: Checked that there no more related avc denial messages related to
      the GNSS HAL in dmesg.
      
      Change-Id: I5b43dc088017a5568dd8e442726d2bf52e95b1d5
      953c4396
  12. Jan 10, 2017
  13. Jan 03, 2017
  14. Dec 29, 2016
  15. Dec 28, 2016
  16. Dec 27, 2016
  17. Dec 17, 2016
  18. Dec 16, 2016
  19. Dec 14, 2016
  20. Dec 13, 2016
  21. Nov 18, 2016
    • dcashman's avatar
      Move hal_light to attribute. · 3319d5ee
      dcashman authored
      HAL policy defines how the platform and a given HAL interact, but not how the
      HAL is implemented.  This policy should be represented as an attribute that all
      processes implementing the HAL can include.
      
      Bug: 32123421
      Test: Builds.
      Change-Id: I17e5612c0835773c28e14f09e2ce7bdc3f210c15
      3319d5ee
  22. 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
  23. Aug 10, 2016
    • Alex Deymo's avatar
      Allow executing update_engine_sideload from recovery. · 27f19427
      Alex Deymo authored
      The recovery flow for A/B devices allows to sideload an OTA downloaded
      to a desktop and apply from recovery. This patch allows the "recovery"
      context to perform all the operations required to apply an update as
      update_engine would do in the background. These rules are now extracted
      into a new attributte called update_engine_common shared between
      recovery and update_engine.
      
      Bug: 27178350
      
      (cherry picked from commit d63084d3)
      
      Change-Id: I1f3e1e83a21e37e09b69cd9c497f87b42b9cbeb1
      27f19427
  24. Aug 09, 2016
    • Alex Deymo's avatar
      Allow executing update_engine_sideload from recovery. · d63084d3
      Alex Deymo authored
      The recovery flow for A/B devices allows to sideload an OTA downloaded
      to a desktop and apply from recovery. This patch allows the "recovery"
      context to perform all the operations required to apply an update as
      update_engine would do in the background. These rules are now extracted
      into a new attributte called update_engine_common shared between
      recovery and update_engine.
      
      Bug: 27178350
      Change-Id: I97b301cb2c039fb002e8ebfb23c3599463ced03a
      d63084d3
  25. Apr 22, 2016
    • Alex Deymo's avatar
      Move boot_control HAL permissions to an attribute. · 7b8413db
      Alex Deymo authored
      The boot_control HAL is library loaded by our daemons (like
      update_engine and update_verifier) that interacts with the bootloader.
      The actual implementation of this library is provided by the vendor and
      its runtime permissions are tied to this implementation which varies a
      lot based on how the bootloader and the partitions it uses are
      structured.
      
      This patch moves these permissions to an attribute so the attribute can
      be expanded on each device without the need to repeat that on each one
      of our daemons using the boot_control HAL.
      
      Bug: 27107517
      
      (cherry picked from commit 0f8d9261)
      
      Change-Id: Icb2653cb89812c0de81381ef48280e4ad1e9535c
      7b8413db
    • Alex Deymo's avatar
      Move boot_control HAL permissions to an attribute. · 0f8d9261
      Alex Deymo authored
      The boot_control HAL is library loaded by our daemons (like
      update_engine and update_verifier) that interacts with the bootloader.
      The actual implementation of this library is provided by the vendor and
      its runtime permissions are tied to this implementation which varies a
      lot based on how the bootloader and the partitions it uses are
      structured.
      
      This patch moves these permissions to an attribute so the attribute can
      be expanded on each device without the need to repeat that on each one
      of our daemons using the boot_control HAL.
      
      Bug: 27107517
      Change-Id: Idfe6a208720b49802b03f70fee4a3e73030dae2e
      0f8d9261
  26. Apr 19, 2016
    • mukesh agrawal's avatar
      limit shell's access to log.* properties · 84cfde22
      mukesh agrawal authored
      Restrict the ability of the shell to set the log.*
      properties. Namely: only allow the shell to set
      such properities on eng and userdebug builds.
      
      The shell (and other domains) can continue to
      read log.* properties on all builds.
      
      While there: harmonize permissions for log.* and
      persist.log.tag. Doing so introduces two changes:
      - log.* is now writable from from |system_app|. This
        mirrors the behavior of persist.log.tag, which is
        writable to support "Developer options" ->
        "Logger buffer sizes" -> "Off".
        (Since this option is visible on user builds, the
        permission is enabled for all builds.)
      - persist.log.tag can now be set from |shell| on
        userdebug_or_eng().
      
      BUG=28221972
      TEST=manual (see below)
      
      Testing details
      - user build (log.tag)
        $ adb shell setprop log.tag.foo V
        $ adb shell getprop log.tag
        <blank line>
        $ adb bugreport | grep log.tag.foo
        [  146.525836] init: avc:  denied  { set } for property=log.tag.foo pid=4644 uid=2000 gid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:log_prop:s0 tclass=property_service permissive=0
        [  146.525878] init: sys_prop: permission denied uid:2000  name:log.tag.foo
      - userdebug build (log.tag)
        $ adb shell getprop log.tag.foo
        <blank line>
        $ adb shell setprop log.tag.foo V
        $ adb shell getprop log.tag.foo
        V
      - user build (persist.log.tag)
        $ adb shell getprop | grep log.tag
        <no match>
        - Developer options -> Logger buffer sizes -> Off
        $ adb shell getprop | grep log.tag
        [persist.log.tag]: [Settings]
        [persist.log.tag.snet_event_log]: [I]
      
      Change-Id: Idf00e7a623723a7c46bf6d01e386aeca92b2ad75
      84cfde22
  27. Dec 14, 2015
    • William Roberts's avatar
      checkfc: add attribute test · ad3cb39e
      William Roberts authored
      
      Enable checkfc to check *_contexts against a set of valid attributes
      which must be associated with all types in the contexts file that
      is being checked.
      
      Since it's imperative that checkfc knows which file its checking to
      choose the proper attribute set, the -s option is introduced to
      indicate the service_contexts file. The property_contexts file continues
      to use the existing -p and file_contexts requires no specification, aka
      it's the default.
      
      Failure examples:
      file_contexts:
      Error: type "init" is not of set: "fs_type, dev_type, file_type"
      
      service_contexts:
      Error: type "init_exec" is not of set: "service_manager_type"
      
      property_contexts:
      Error: type "bluetooth_service" is not of set: "property_type"
      
      Change-Id: I62077e4d0760858a9459e753e14dfd209868080f
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      ad3cb39e
  28. Dec 08, 2015
    • Nick Kralevich's avatar
      Remove property read access for non-core properties · 5a570a4b
      Nick Kralevich authored
      Instead of allowing global read access to all properties,
      only allow read access to the properties which are part of
      core SELinux policy. Device-specific policies are no longer
      readable by default and need to be granted in device-specific
      policy.
      
      Grant read-access to any property where the person has write
      access. In most cases, anyone who wants to write a property
      needs read access to that property.
      
      Change-Id: I2bd24583067b79f31b3bb0940b4c07fc33d09918
      5a570a4b
    • Nick Kralevich's avatar
      Add initial debugfs labeling support and label /sys/kernel/debug/tracing/trace_marker · 44826cb5
      Nick Kralevich authored
      Add initial support for labeling files on /sys/kernel/debug.
      The kernel support was added in https://android-review.googlesource.com/122130
      but the userspace portion of the change was never completed until now.
      
      Start labeling the file /sys/kernel/debug/tracing/trace_marker . This
      is the trace_marker file, which is written to by almost all processes
      in Android. Allow global write access to this file.
      
      This change should be submitted at the same time as the system/core
      commit with the same Change-Id as this patch.
      
      Change-Id: Id1d6a9ad6d0759d6de839458890e8cb24685db6d
      44826cb5
  29. 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
  30. Jun 08, 2015
    • dcashman's avatar
      Remove service_manager_local_audit_domain. · 4b4b2b92
      dcashman authored
      service_manager_local_audit_domain was used to fine tune the service_manager
      auditallow rules when introducing the service_manager SELinux rules.  This is no
      longer needed.
      
      (cherry-pick of commit: eab26faa)
      
      Bug: 21656807
      Change-Id: Ia042a887e7bf9eb2a2b08b8d831e68dfe6395f75
      4b4b2b92
    • dcashman's avatar
      Remove service_manager_local_audit_domain. · eab26faa
      dcashman authored
      service_manager_local_audit_domain was used to fine tune the service_manager
      auditallow rules when introducing the service_manager SELinux rules.  This is no
      longer needed.
      
      Bug: 21656807
      Change-Id: Ia042a887e7bf9eb2a2b08b8d831e68dfe6395f75
      eab26faa
  31. Apr 09, 2015
    • dcashman's avatar
      Enforce more specific service access. · bd7f5803
      dcashman authored
      Move the remaining services from tmp_system_server_service to appropriate
      attributes and remove tmp_system_server and associated logging:
      
      registry
      restrictions
      rttmanager
      scheduling_policy
      search
      sensorservice
      serial
      servicediscovery
      statusbar
      task
      textservices
      telecom_service
      trust_service
      uimode
      updatelock
      usagestats
      usb
      user
      vibrator
      voiceinteraction
      wallpaper
      webviewupdate
      wifip2p
      wifi
      window
      
      Bug: 18106000
      Change-Id: Ia0a6d47099d82c53ba403af394537db6fbc71ca0
      bd7f5803
Loading