Skip to content
Snippets Groups Projects
  1. Nov 16, 2017
    • Jeff Vander Stoep's avatar
      Remove unused permissions from tee · 13c69b89
      Jeff Vander Stoep authored
      Only getattr and read are necessary for lnk_file. Open violates a new
      neverallow for separating system and vendor data.
      
      Bug: 34980020
      Test: Enroll fingerprint on Taimen
      Change-Id: I9434afbd5b4ecc1ead9f0ba47c7582fb5a6c6bf0
      13c69b89
  2. 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
  3. Apr 14, 2017
  4. Apr 13, 2017
  5. Apr 11, 2017
    • Sandeep Patil's avatar
      sepolicy: make exec_types in /vendor a subset of vendor_file_type · 2ee66e7d
      Sandeep Patil authored
      
      We install all default hal implementations in /vendor/bin/hw along with
      a few domains that are defined in vendor policy and installed in
      /vendor. These files MUST be a subset of the global 'vendor_file_type'
      which is used to address *all files installed in /vendor* throughout the
      policy.
      
      Bug: 36463595
      Test: Boot sailfish without any new denials
      
      Change-Id: I3d26778f9a26f9095f49d8ecc12f2ec9d2f4cb41
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      2ee66e7d
  6. Apr 04, 2017
    • Alex Klyubin's avatar
      tee no longer violates the socket comms ban · 645abead
      Alex Klyubin authored
      SELinux policy no longer has allow rules which permit core/non-vendor
      domains to communicate with tee domain over sockets. This commit thus
      removes tee from the list of temporary exceptions for the socket
      communications prohibition.
      
      Test: mmm system/sepolicy
      Bug: 36714625
      Bug: 36715266
      Change-Id: Iccbd9ea0555b0c9f1cb6c5e0f5a6c0d3f8730b4d
      645abead
  7. Apr 03, 2017
    • Alex Klyubin's avatar
      Move TEE rules to vendor image · 304d6536
      Alex Klyubin authored
      "tee" domain is a vendor domain. Hence its rules should live on the
      vendor image.
      
      What's left as public API is that:
      1. tee domain exists and that it is permitted to sys_rawio capability,
      2. tee_device type exists and apps are not permitted to access
         character devices labeled tee_device.
      
      If you were relying on system/sepolicy automatically labeling
      /dev/tf_driver as tee_device or labeling /system/bin/tf_daemon as
      tee_exec, then you need to add these rules to your device-specific
      file_contexts.
      
      Test: mmm system/sepolicy
      Test: bullhead, angler, and sailfish boot up without new denials
      Bug: 36714625
      Bug: 36714625
      Bug: 36720355
      Change-Id: Ie21619ff3c44ef58675c369061b4afdd7e8501c6
      304d6536
  8. Mar 29, 2017
    • Alex Klyubin's avatar
      tee domain is a vendor domain · 0f6c047d
      Alex Klyubin authored
      As a result, Keymaster and DRM HALs are permitted to talk to tee domain
      over sockets. Unfortunately, the tee domain needs to remain on the
      exemptions list because drmserver, mediaserver, and surfaceflinger are
      currently permitted to talk to this domain over sockets.
      
      We need to figure out why global policy even defines a TEE domain...
      
      Test: mmm system/sepolicy
      Bug: 36601092
      Bug: 36601602
      Bug: 36714625
      Bug: 36715266
      Change-Id: I0b95e23361204bd046ae5ad22f9f953c810c1895
      0f6c047d
  9. 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
  10. 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
  11. Sep 11, 2016
    • Jeff Vander Stoep's avatar
      Enforce ioctl command whitelisting on all sockets · bff98015
      Jeff Vander Stoep authored
      Remove the ioctl permission for most socket types. For others, such as
      tcp/udp/rawip/unix_dgram/unix_stream set a default unprivileged whitelist
      that individual domains may extend (except where neverallowed like
      untrusted_app). Enforce via a neverallowxperm rule.
      
      Change-Id: I15548d830f8eff1fd4d64005c5769ca2be8d4ffe
      bff98015
  12. Sep 10, 2016
  13. Sep 09, 2016
  14. Aug 29, 2016
  15. Jun 15, 2016
    • Jeff Vander Stoep's avatar
      Enforce ioctl command whitelisting on all sockets · c71c6622
      Jeff Vander Stoep authored
      Remove the ioctl permission for most socket types. For others, such as
      tcp/udp/rawip/unix_dgram/unix_stream set a default unprivileged whitelist
      that individual domains may extend (except where neverallowed like
      untrusted_app). Enforce via a neverallowxperm rule.
      
      Change-Id: I15548d830f8eff1fd4d64005c5769ca2be8d4ffe
      c71c6622
  16. Jun 06, 2016
  17. Mar 03, 2016
    • Stephen Smalley's avatar
      Update netlink socket classes. · 423fd19d
      Stephen Smalley authored
      
      Define new netlink socket security classes introduced by upstream kernel commit
      6c6d2e9bde1c1c87a7ead806f8f5e2181d41a652 ("selinux: update netlink socket
      classes").  This was merged in Linux 4.2 and is therefore only required
      for Android kernels based on 4.2 or newer (e.g. the android-4.4 branch
      of the kernel/common tree).
      
      Add the new socket classes to socket_class_set.
      Add an initial set of allow rules although further refinement
      will likely be necessary.  Any allow rule previously written
      on :netlink_socket may need to be rewritten or duplicated for
      one or more of the more specific classes.  For now, we retain
      the existing :netlink_socket rules for compatibility on older kernels.
      
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      
      (cherry picked from commit 01d95c23)
      
      Change-Id: Ic00a0d474730cda91ba3bc387e0cc14482f82114
      423fd19d
    • Stephen Smalley's avatar
      Update netlink socket classes. · 01d95c23
      Stephen Smalley authored
      
      Define new netlink socket security classes introduced by upstream kernel commit
      6c6d2e9bde1c1c87a7ead806f8f5e2181d41a652 ("selinux: update netlink socket
      classes").  This was merged in Linux 4.2 and is therefore only required
      for Android kernels based on 4.2 or newer (e.g. the android-4.4 branch
      of the kernel/common tree).
      
      Add the new socket classes to socket_class_set.
      Add an initial set of allow rules although further refinement
      will likely be necessary.  Any allow rule previously written
      on :netlink_socket may need to be rewritten or duplicated for
      one or more of the more specific classes.  For now, we retain
      the existing :netlink_socket rules for compatibility on older kernels.
      
      Change-Id: I5040b30edd2d374538490a080feda96dd4bae5bf
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      01d95c23
  18. 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
  19. Feb 25, 2014
    • Stephen Smalley's avatar
      Clean up socket rules. · 16011320
      Stephen Smalley authored
      
      Replace * or any permission set containing create with
      create_socket_perms or create_stream_socket_perms.
      
      Add net_domain() to all domains using network sockets and
      delete rules already covered by domain.te or net.te.
      
      For netlink_route_socket, only nlmsg_write needs to be separately
      granted to specific domains that are permitted to modify the routing
      table.   Clarification:  read/write permissions are just ability to
      perform read/recv() or write/send() on the socket, whereas nlmsg_read/
      nlmsg_write permissions control ability to observe or modify the
      underlying kernel state accessed via the socket.
      See security/selinux/nlmsgtab.c in the kernel for the mapping of
      netlink message types to nlmsg_read or nlmsg_write.
      
      Delete legacy rule for b/12061011.
      
      This change does not touch any rules where only read/write were allowed
      to a socket created by another domain (inherited across exec or
      received across socket or binder IPC).  We may wish to rewrite some or all
      of those rules with the rw_socket_perms macro but that is a separate
      change.
      
      Change-Id: Ib0637ab86f6d388043eff928e5d96beb02e5450e
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      16011320
  20. Dec 06, 2013
  21. Nov 13, 2013
  22. 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
  23. May 22, 2013
  24. May 20, 2013
    • repo sync's avatar
      Make all domains unconfined. · 77d4731e
      repo sync authored
      This prevents denials from being generated by the base policy.
      Over time, these rules will be incrementally tightened to improve
      security.
      
      Change-Id: I4be1c987a5d69ac784a56d42fc2c9063c402de11
      77d4731e
  25. May 15, 2013
  26. Mar 23, 2013
    • rpcraig's avatar
      New dev_types and other minor adjustments. · 41e53901
      rpcraig authored
      
      Add new dev_type:
      - ump_device : Unified Memory Provider driver.
             The file_contexts entry should be
             described on a per device basis.
      
      Minor adjustments:
      - tee needs netlink socket access.
      - ueventd needs to grant file operations.
      
      Change-Id: I915304da687d3a2b9aa417e6f91ea915bd697676
      Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
      41e53901
  27. Aug 13, 2012
Loading