Skip to content
Snippets Groups Projects
  1. Feb 06, 2017
  2. 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
  3. Jan 20, 2017
  4. Dec 06, 2016
    • dcashman's avatar
      sepolicy: add version_policy tool and version non-platform policy. · 2e00e637
      dcashman authored
      In order to support platform changes without simultaneous updates from
      non-platform components, the platform and non-platform policies must be
      split.  In order to provide a guarantee that policy written for
      non-platform objects continues to provide the same access, all types
      exposed to non-platform policy are versioned by converting them and the
      policy using them into attributes.
      
      This change performs that split, the subsequent versioning and also
      generates a mapping file to glue the different policy components
      together.
      
      Test: Device boots and runs.
      Bug: 31369363
      Change-Id: Ibfd3eb077bd9b8e2ff3b2e6a0ca87e44d78b1317
      2e00e637
  5. Oct 07, 2016
  6. 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
  7. Oct 01, 2016
    • Jeff Vander Stoep's avatar
      mediaserver drmserver: remove domain_deprecated attribute · 3a0721a3
      Jeff Vander Stoep authored
      avc: granted { use } for pid=3067 comm="SoundPoolThread"
      scontext=u:r:drmserver:s0 tcontext=u:r:system_server:s0 tclass=fd
      
      Test: builds/boots on Angler. Adds permissions for all "granted" avc
      messages observed in three months of log auditing.
      
      Bug: 28760354
      Change-Id: I51f13d7c7d40f479b1241dfcd5d925d28f74926b
      3a0721a3
  8. Sep 12, 2016
    • Jeff Vander Stoep's avatar
      drmserver: read locked ringtones · 188f9b14
      Jeff Vander Stoep authored
      (cherry picked from commit f23b870a)
      
      avc: denied { read } for comm="generic" path="/data/system_de/0/ringtones/ringtone_cache" dev="sda35" ino=1114120 scontext=u:r:drmserver:s0 tcontext=u:object_r:ringtone_file:s0 tclass=file
      
      Change-Id: I40992733d779743be92c15a094d166a3df64a10f
      Fixes: 30167454
      188f9b14
  9. Sep 10, 2016
  10. Aug 29, 2016
  11. Jul 20, 2016
    • Jeff Vander Stoep's avatar
      drmserver: read locked ringtones · f23b870a
      Jeff Vander Stoep authored
      avc: denied { read } for comm="generic" path="/data/system_de/0/ringtones/ringtone_cache" dev="sda35" ino=1114120 scontext=u:r:drmserver:s0 tcontext=u:object_r:ringtone_file:s0 tclass=file
      
      Change-Id: I40992733d779743be92c15a094d166a3df64a10f
      Fixes: 30167454
      f23b870a
  12. Nov 25, 2015
  13. 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
  14. Apr 08, 2015
    • dcashman's avatar
      Enforce more specific service access. · 03a6f64f
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      network_management
      network_score
      notification
      package
      permission
      persistent
      power
      print
      processinfo
      procstats
      
      Bug: 18106000
      Change-Id: I9dfb41fa41cde72ef0059668410a2e9eb1af491c
      03a6f64f
  15. Apr 03, 2015
    • dcashman's avatar
      Add system_api_service and app_api_service attributes. · d12993f0
      dcashman authored
      System services differ in designed access level.  Add attributes reflecting this
      distinction and label services appropriately.  Begin moving access to the newly
      labeled services by removing them from tmp_system_server_service into the newly
      made system_server_service attribute.  Reflect the move of system_server_service
      from a type to an attribute by removing access to system_server_service where
      appropriate.
      
      Change-Id: I7fd06823328daaea6d6f96e4d6bd00332382230b
      d12993f0
  16. Mar 03, 2015
    • dcashman's avatar
      Record observed system_server servicemanager service requests. · 23f33615
      dcashman authored
      Also formally allow dumpstate access to all services and grant system_server
      access to address the following non-system_server_service entries:
      
      avc:  granted  { find } for service=drm.drmManager scontext=u:r:system_server:s0 tcontext=u:object_r:drmserver_service:s0 tclass=service_manager
      avc:  granted  { find } for service=nfc scontext=u:r:system_server:s0 tcontext=u:object_r:nfc_service:s0 tclass=service_manager
      
      Bug: 18106000
      Change-Id: Iad16b36acf44bce52c4824f8b53c0e7731c25602
      23f33615
  17. Jan 14, 2015
    • dcashman's avatar
      Make system_server_service an attribute. · 4a89cdfa
      dcashman authored
      Temporarily give every system_server_service its own
      domain in preparation for splitting it and identifying
      special services or classes of services.
      
      Change-Id: I81ffbdbf5eea05e0146fd7fd245f01639b1ae0ef
      4a89cdfa
  18. 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
  19. Oct 10, 2014
    • Nick Kralevich's avatar
      allow oemfs:dir search · ebfd9f87
      Nick Kralevich authored
      mediaserver and drmserver both have permission to read oemfs
      related files. However, there are no search permissions on the
      directory, so the files would be unreachable.
      
      Grant search permissions on the oemfs directory, so that the files
      within that directory can be read.
      
      Bug: 17954291
      Change-Id: I9e36dc7b940bd46774753c1fa07b0f47c36ff0db
      ebfd9f87
  20. Sep 17, 2014
  21. Sep 16, 2014
  22. 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
  23. Jul 24, 2014
  24. Jul 18, 2014
  25. 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
  26. 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
  27. 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
  28. Mar 27, 2014
    • Stephen Smalley's avatar
      Allow reading of radio data files passed over binder. · 3fbc536d
      Stephen Smalley authored
      
      Addresses denials such as:
       avc:  denied  { read } for  pid=5114 comm="le.android.talk" path="/data/data/com.android.providers.telephony/app_parts/PART_1394223232515_recording88476874.amr" dev="mmcblk0p23" ino=64522 scontext=u:r:mediaserver:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
       avc:  denied  { getattr } for  pid=29199 comm="Binder_4" path="/data/data/com.android.providers.telephony/app_parts/PART_1394223232515_recording88476874.amr" dev="mmcblk0p23" ino=64522 scontext=u:r:mediaserver:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
       avc:  denied  { read } for  pid=29199 comm="Binder_4" path="/data/data/com.android.providers.telephony/app_parts/PART_1394223232515_recording88476874.amr" dev="mmcblk0p23" ino=64522 scontext=u:r:drmserver:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
       avc:  denied  { getattr } for  pid=9338 comm="MediaLoader" path="/data/data/com.android.providers.telephony/app_parts/PART_1394848620510_image.jpg" dev="mmcblk0p28" ino=287374 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
       avc:  denied  { read } for  pid=9896 comm="Binder_7" path="/data/data/com.android.providers.telephony/app_parts/PART_1394594346187_image.jpg" dev="mmcblk0p28" ino=287522 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
      
      This does not allow write denials such as:
       avc:  denied  { write } for  pid=1728 comm="Binder_4" path="/data/data/com.android.providers.telephony/app_parts/PART_1394818738798_image.jpg" dev="mmcblk0p28" ino=82279 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
      
      Need to understand whether write access is in fact required.
      
      Change-Id: I7693d16cb4f9855909d790d3f16f8bf281764468
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      3fbc536d
  29. Mar 15, 2014
    • Stephen Smalley's avatar
      Allow drmserver and mediaserver to read apk files. · 721f1adf
      Stephen Smalley authored
      
      Required to support passing resources via open apk files over Binder.
      Resolves denials such as:
       avc:  denied  { read } for  pid=31457 comm="SoundPoolThread" path="/mnt/asec/au.com.shiftyjelly.pocketcasts-1/pkg.apk" dev="dm-10" ino=12 scontext=u:r:mediaserver:s0 tcontext=u:object_r:asec_apk_file:s0 tclass=file
       avc:  denied  { read } for  pid=31439 comm="Binder_2" path="/mnt/asec/au.com.shiftyjelly.pocketcasts-1/pkg.apk" dev="dm-10" ino=12 scontext=u:r:drmserver:s0 tcontext=u:object_r:asec_apk_file:s0 tclass=file
      
      We do not allow open as it is not required (i.e. the files
      are passed as open files over Binder or local socket and opened by the
      client).
      
      Change-Id: Ib0941df1e9aac8d20621a356d2d212b98471abbc
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      721f1adf
  30. Mar 13, 2014
    • Stephen Smalley's avatar
      Get rid of separate platform_app_data_file type. · dc88dca1
      Stephen Smalley authored
      
      The original concept was to allow separation between /data/data/<pkgdir>
      files of "platform" apps (signed by one of the four build keys) and
      untrusted apps.  But we had to allow read/write to support passing of
      open files via Binder or local socket for compatibilty, and it seems
      that direct open by pathname is in fact used in Android as well,
      only passing the pathname via Binder or local socket.  So there is no
      real benefit to keeping it as a separate type.
      
      Retain a type alias for platform_app_data_file to app_data_file until
      restorecon /data/data support is in place to provide compatibility.
      
      Change-Id: Ic15066f48765322ad40500b2ba2801bb3ced5489
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      dc88dca1
  31. Mar 03, 2014
  32. 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
  33. Feb 11, 2014
  34. Feb 04, 2014
    • Nick Kralevich's avatar
      Revert "Move tlcd_sock policy over to manta." · 1a1ad959
      Nick Kralevich authored
      This doesn't compile on non-manta devices because of a
      missing drmserver_socket declaration.
      
      external/sepolicy/mediaserver.te":68:ERROR 'unknown type drmserver_socket' at token ';' on line 6764:
      #line 68
      allow mediaserver drmserver_socket:sock_file write;
      checkpolicy:  error(s) encountered while parsing configuration
      make: *** [out/target/product/flo/obj/ETC/sepolicy_intermediates/sepolicy] Error 1
      make: *** Waiting for unfinished jobs....
      
      This reverts commit 8cd400d3.
      
      Change-Id: Ib8f07b57008b9ed1165b945057502779e806f0f8
      1a1ad959
    • Stephen Smalley's avatar
      Move tlcd_sock policy over to manta. · 8cd400d3
      Stephen Smalley authored
      
      Change-Id: I7d5a5f964133177e7d466b9759fcf6300fec345d
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      8cd400d3
  35. Jan 31, 2014
    • Nick Kralevich's avatar
      drmserver: allow looking in efs_file directories · 7cbe44f2
      Nick Kralevich authored
      We can read any efs_files, but can't look in the directory
      containing them. Allow it.
      
      Without this patch, high resolution movie playback is broken.
      
      Addresses the following denial:
      
      [  276.780046] type=1400 audit(1391105234.431:5): avc:  denied  { search } for  pid=125 comm="drmserver" name="/" dev="mmcblk0p1" ino=2 scontext=u:r:drmserver:s0 tcontext=u:object_r:efs_file:s0 tclass=dir
      
      Bug: 12819852
      
      Change-Id: Ie9d13a224cef5e229de1bdb78d605841ed387a21
      7cbe44f2
  36. Jan 25, 2014
  37. Jan 16, 2014
Loading