Skip to content
Snippets Groups Projects
  1. Dec 22, 2016
    • Alex Klyubin's avatar
      Restrict access to ro.serialno and ro.boot.serialno · 20151072
      Alex Klyubin authored
      This restricts access to ro.serialno and ro.boot.serialno, the two
      system properties which contain the device's serial number, to a
      select few SELinux domains which need the access. In particular, this
      removes access to these properties from Android apps. Apps can access
      the serial number via the public android.os.Build API. System
      properties are not public API for apps.
      
      The reason for the restriction is that serial number is a globally
      unique identifier which cannot be reset by the user. Thus, it can be
      used as a super-cookie by apps. Apps need to wean themselves off of
      identifiers not resettable by the user.
      
      Test: Set up fresh GMS device, install some apps via Play, update some apps, use Chrome
      Test: Access the device via ADB (ADBD exposes serial number)
      Test: Enable MTP over USB, use mtp-detect to confirm that serial number is reported in MTP DeviceInfo
      Bug: 31402365
      Bug: 33700679
      Change-Id: I4713133b8d78dbc63d8272503e80cd2ffd63a2a7
      20151072
  2. Oct 07, 2016
  3. 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
  4. Jul 20, 2016
    • Jeff Vander Stoep's avatar
      adbd: allow reading apk_data_file · a7915ceb
      Jeff Vander Stoep authored
      (cherry picked from commit d743ddea)
      
      avc: denied { search } for comm=73657276696365203139 name="app" dev="sda35" ino=770049 scontext=u:r:adbd:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir permissive=0
      
      Bug: 30000600
      Change-Id: I86958ebcca815ee1779f85fb425592493f40101a
      a7915ceb
  5. Jul 19, 2016
  6. Jun 01, 2016
  7. Apr 13, 2016
    • Nick Kralevich's avatar
      Restore /mnt/sdcard symlink read access · e3151bd1
      Nick Kralevich authored
      Allow adbd and app domains to read the symlink at /mnt/sdcard.
      This symlink was suppose to have been removed in the Gingerbread
      time frame, but lives on.
      
      Read access for this symlink was removed from adbd and the shell user in
      8ca19368, and from untrusted_app in
      cbf7ba18.
      
      Addresses the following denials:
      
        avc: denied { read } for name="sdcard" dev="tmpfs" ino=9486 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:tmpfs:s0 tclass=lnk_file permissive=0
        avc: denied { read } for pid=4161 comm=73657276696365203137 name="sdcard" dev="tmpfs" ino=5114 scontext=u:r:adbd:s0 tcontext=u:object_r:tmpfs:s0 tclass=lnk_file permissive=0
      
      Bug: 25801877
      Bug: 28108983
      Change-Id: Ia31cd8b53c9c3a5b7d11be42c2fde170f96affb0
      e3151bd1
  8. Apr 07, 2016
    • Nick Kralevich's avatar
      adbd: disallow non-shell domain transitions. · 6c768d74
      Nick Kralevich authored
      Make sure adbd can't transition to other non-shell domains,
      and in particular, can't transition to the su user on user builds.
      
      Bug: 27270128
      Change-Id: I67dc974da460d63879f5ff3e1258af8eb790a815
      6c768d74
  9. Mar 31, 2016
    • Daniel Rosenberg's avatar
      Allow access to media_rw_data_file for now. · d25d57a3
      Daniel Rosenberg authored
      With sdcardfs, we no longer have a separate sdcardd acting as
      an intermediate between the outside world and /data/media.
      Unless we modify sdcardfs to change contexts, we need these.
      Added for: adbd, kernel, mediaserver, and shell
      
      Remove this patch if sdcardfs is updated to change the
      secontext of fs accesses.
      
      Bug: 27915475
      Bug: 27937873
      
      Change-Id: I25edcfc7fb8423b3184db84040bda790a1042724
      d25d57a3
    • Daniel Rosenberg's avatar
      Allow shell and adbd access to media_rw_data_file for now. · bb90999e
      Daniel Rosenberg authored
      With sdcardfs, we no longer have a separate sdcardd acting as
      an intermediate between the outside world and /data/media.
      Unless we modify sdcardfs to change contexts, we need these.
      
      Remove this patch if sdcardfs is updated to change the
      secontext of fs accesses.
      
      Bug: 27925072
      Change-Id: I3ad37c0f12836249c83042bdc1111b6360f22b3c
      bb90999e
  10. Jan 19, 2016
    • Rubin Xu's avatar
      SELinux rule for ro.device_owner and persist.logd.security · 0c8286fe
      Rubin Xu authored
      They are introduced for the device owner process logging feature.
      That is, for enterprise-owned devices with device owner app provisioned,
      the device owner may choose to turn on additional device-wide logging for
      auditing and intrusion detection purposes. Logging includes histories of
      app process startup, commands issued over ADB and lockscreen unlocking
      attempts. These logs will available to the device owner for analysis,
      potentially shipped to a remote server if it chooses to.
      
      ro.device_owner will be a master switch to turn off logging, if the device
      has no device owner provisioned. persist.logd.security is a switch that
      device owner can toggle (via DevicePoliyManager) to enable/disable logging.
      Writing to both properties should be only allowed by the system server.
      
      Bug: 22860162
      Change-Id: Iabfe2347b094914813b9d6e0c808877c25ccd038
      0c8286fe
  11. Jan 15, 2016
  12. Jan 13, 2016
    • dcashman's avatar
      Allow adbd to pull sepolicy from device. · 0fb0ab41
      dcashman authored
      Address the following denial when running CTS:
      avc: denied { search } for comm=73657276696365203136 name="/" dev="selinuxfs" ino=1 scontext=u:r:adbd:s0 tcontext=u:object_r:selinuxfs:s0 tclass=dir permissive=0
      
      Bug: 26290097
      Change-Id: Icf51061a65a5fda15f7e7ef78200a62ffbd1ca9b
      0fb0ab41
  13. Dec 08, 2015
    • Nick Kralevich's avatar
      Change /dev/ion from read-only to read-write · 71fd337f
      Nick Kralevich authored
      Even though /dev/ion can allocate memory when opened in read-only mode,
      some processes seem to unnecessarily open it in read-write mode.
      This doesn't seem to be harmful, and was originally allowed in
      domain_deprecated. Re-allow it.
      
      Bug: 25965160
      Change-Id: Icaf948be89a8f2805e9b6a22633fa05b69988e4f
      71fd337f
  14. Dec 07, 2015
    • Nick Kralevich's avatar
      adbd: allow ddms screen capture to work again · 5e8402df
      Nick Kralevich authored
      The removal of domain_deprecated broke ddms screen capturing
      functionality.
      
      Steps to reproduce:
      
      1) Run "ddms"
      2) Select your device
      3) Go to the Device > Screen Capture menu
      4) Attempt to take a screenshot
      
      Addresses the following denials:
      
        avc: denied { read } for pid=2728 comm="screencap" name="ion" dev="tmpfs" ino=7255 scontext=u:r:adbd:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=1
        avc: denied { open } for pid=2728 comm="screencap" name="ion" dev="tmpfs" ino=7255 scontext=u:r:adbd:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=1
        avc: denied { ioctl } for pid=2728 comm="screencap" path="/dev/ion" dev="tmpfs" ino=7255 ioctlcmd=4905 scontext=u:r:adbd:s0 tcontext=u:object_r:ion_device:s0 tclass=chr_file permissive=1
        avc: denied { read } for pid=5261 comm="screencap" name="egl" dev="dm-1" ino=210 scontext=u:r:adbd:s0 tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
        avc: denied { read } for pid=5261 comm="screencap" name="egl" dev="dm-1" ino=210 scontext=u:r:adbd:s0 tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
      
      Bug: 26023462
      Change-Id: Ie77c65900de56756d5c9b99dcda1e20664151ed2
      5e8402df
    • Nick Kralevich's avatar
      adbd: allow "adb pull /sdcard/" · b899f4fc
      Nick Kralevich authored
      The removal of domain_deprecated broke the ability for adbd to
      pull files from /sdcard. Re-allow it.
      
      Addresses the following denials:
      
        avc: denied { search } for pid=2753 comm=73657276696365203530 name="/" dev="tmpfs" ino=6242 scontext=u:r:adbd:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir permissive=0
        avc: denied { getattr } for pid=2755 comm=73657276696365203431 path="/sdcard" dev="rootfs" ino=5472 scontext=u:r:adbd:s0 tcontext=u:object_r:rootfs:s0 tclass=lnk_file permissive=0
      
      Change-Id: I70257933f554abd008932c7f122dd0151f464b05
      b899f4fc
  15. Nov 28, 2015
    • Nick Kralevich's avatar
      Remove domain_deprecated from adbd and shell · 8ca19368
      Nick Kralevich authored
      The extra permissions are not needed. Delete them.
      
      This change also adds read permission for /data/misc/zoneinfo
      back to all domains. libc refernces this directory for timezone
      related files, and it feels dangerous and of little value to
      try to restrict access. In particular, this causes problems when the
      shell user attempts to run "ls -la" to show file time stamps in
      the correct timezone.
      
      Bug: 25433265
      Change-Id: I666bb460e440515151e3bf46fe2e0ac0e7c99f46
      8ca19368
  16. Nov 25, 2015
  17. 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
  18. Sep 15, 2015
  19. Aug 25, 2015
    • Stephen Smalley's avatar
      Only allow toolbox exec where /system exec was already allowed. · a3c97a76
      Stephen Smalley authored
      
      When the toolbox domain was introduced, we allowed all domains to exec it
      to avoid breakage.  However, only domains that were previously allowed the
      ability to exec /system files would have been able to do this prior to the
      introduction of the toolbox domain.  Remove the rule from domain.te and add
      rules to all domains that are already allowed execute_no_trans to system_file.
      Requires coordination with device-specific policy changes with the same Change-Id.
      
      Change-Id: Ie46209f0412f9914857dc3d7c6b0917b7031aae5
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      a3c97a76
  20. May 07, 2015
    • William Roberts's avatar
      Replace unix_socket_connect() and explicit property sets with macro · 2f5a6a96
      William Roberts authored
      
      A common source of mistakes when authoring sepolicy is properly
      setting up property sets. This is a 3 part step of:
      1. Allowing the unix domain connection to the init/property service
      2. Allowing write on the property_socket file
      3. Allowing the set on class property_service
      
      The macro unix_socket_connect() handled 1 and 2, but could be
      confusing for first time policy authors. 3 had to be explicitly
      added.
      
      To correct this, we introduce a new macros:
      set_prop(sourcedomain, targetprop)
      
      This macro handles steps 1, 2 and 3.
      
      No difference in sediff is expected.
      
      (cherrypicked from commit 625a3526)
      
      Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@linux.intel.com>
      2f5a6a96
    • William Roberts's avatar
      Replace unix_socket_connect() and explicit property sets with macro · 625a3526
      William Roberts authored
      
      A common source of mistakes when authoring sepolicy is properly
      setting up property sets. This is a 3 part step of:
      1. Allowing the unix domain connection to the init/property service
      2. Allowing write on the property_socket file
      3. Allowing the set on class property_service
      
      The macro unix_socket_connect() handled 1 and 2, but could be
      confusing for first time policy authors. 3 had to be explicitly
      added.
      
      To correct this, we introduce a new macros:
      set_prop(sourcedomain, targetprop)
      
      This macro handles steps 1, 2 and 3.
      
      No difference in sediff is expected.
      
      Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@linux.intel.com>
      625a3526
  21. Apr 24, 2015
  22. Apr 03, 2015
    • Jeff Sharkey's avatar
      Apps need more than just search. · 3bdc0abc
      Jeff Sharkey authored
      avc: denied { getattr } for path="/storage/self" dev="tmpfs" ino=3129 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:mnt_user_file:s0 tclass=dir permissive=0
      
      Change-Id: I802321331e9bd7ae41d3af7ace39364240db6d84
      3bdc0abc
    • Jeff Sharkey's avatar
      Consistent external storage policy. · 93fd6f0a
      Jeff Sharkey authored
      Apps, shell and adbd should all have identical access to external
      storage.  Also document where we have files and/or symlinks.
      
      Bug: 20055945
      Change-Id: I133ffcf28cc3ccdb0541aba18ea3b9ba676eddbe
      93fd6f0a
  23. Feb 23, 2015
  24. 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
  25. Nov 05, 2014
  26. Oct 22, 2014
    • Nick Kralevich's avatar
      DO NOT MERGE: allow access to labeled executables in /system · 2c38b3b8
      Nick Kralevich authored
      Most files on /system are labeled with the "system_file" label, and
      are readable by default by all SELinux domains. However, select
      executables are labeled with their own label, so that SELinux knows
      what domains to enter upon running the executable.
      
      Allow adbd read access to labeled executables in /system. We do
      this by granting adbd read access to exec_type, the attribute
      assigned to all executables on /system.
      
      This allows "adb pull /system" to work without generating
      SELinux denials.
      
      Bug: 18078338
      Change-Id: I97783759af083968890f15f7b1d8fff989e80604
      2c38b3b8
  27. Oct 21, 2014
  28. Sep 26, 2014
  29. Sep 09, 2014
  30. Sep 08, 2014
    • Stephen Smalley's avatar
      Annotate MLS trusted subjects and objects. · 45731c70
      Stephen Smalley authored
      
      When using MLS (i.e. enabling levelFrom= in seapp_contexts),
      certain domains and types must be exempted from the normal
      constraints defined in the mls file.  Beyond the current
      set, adbd, logd, mdnsd, netd, and servicemanager need to
      be able to read/write to any level in order to communicate
      with apps running with any level, and the logdr and logdw
      sockets need to be writable by apps running with any level.
      
      This change has no impact unless levelFrom= is specified in
      seapp_contexts, so by itself it is a no-op.
      
      Change-Id: I36ed382b04a60a472e245a77055db294d3e708c3
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      45731c70
  31. 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
  32. Jul 18, 2014
  33. Jul 17, 2014
    • Riley Spahn's avatar
      Refine service_manager find auditallow statements. · 14aa7c06
      Riley Spahn authored
      Add adbd as a service_manager_local_audit_domain and negate
      surfaceflinger_service in its auditallow. Negate keystore_service
      and radio_service in the system_app auditallow.
      
      (cherry picked from commit 88157ea3)
      
      Change-Id: I25354db2add3135335c80be2c2d350e526137572
      14aa7c06
    • Riley Spahn's avatar
      Refine service_manager find auditallow statements. · 88157ea3
      Riley Spahn authored
      Add adbd as a service_manager_local_audit_domain and negate
      surfaceflinger_service in its auditallow. Negate keystore_service
      and radio_service in the system_app auditallow.
      
      Change-Id: I05ea2a3e853b692f151182202f1b30786b44f1fb
      88157ea3
  34. Jul 15, 2014
Loading