Skip to content
Snippets Groups Projects
  1. 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
  2. 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
  3. 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
  4. 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
  5. Sep 15, 2015
  6. 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
  7. 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
  8. Apr 24, 2015
  9. 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
  10. Feb 23, 2015
  11. 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
  12. Nov 05, 2014
  13. 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
  14. Oct 21, 2014
  15. Sep 26, 2014
  16. Sep 09, 2014
  17. 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
  18. 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
  19. Jul 18, 2014
  20. 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
  21. Jul 15, 2014
  22. Jul 10, 2014
    • Nick Kralevich's avatar
      Remove domain:process from unconfined · a7c04dcd
      Nick Kralevich authored
      Prune down unconfined so it doesn't allow process access
      to all other domains. Use domain_trans() for transitions to
      seclabeled domains.
      
      Change-Id: I8e88a49e588b6b911e1f7172279455838a06091d
      a7c04dcd
  23. Jun 08, 2014
    • Nick Kralevich's avatar
      allow adb push to create directories. · 98b7ab53
      Nick Kralevich authored
      Addresses the following denial:
      
        type=1400 audit(0.0:24): avc: denied { create } for comm="adbd" name="md5sum" scontext=u:r:adbd:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir
      
      Change-Id: Ibb1708af85b2235cbad2794993cfeef896f8db4a
      98b7ab53
  24. Jun 05, 2014
    • Nick Kralevich's avatar
      Allow adbd / shell /data/anr access · cb182aba
      Nick Kralevich authored
      The shell user needs to be able to run commands like
      "cat /data/anr/traces.txt". Allow it.
      
      We also need to be able to pull the file via adb.
      "adb pull /data/anr/traces.txt". Allow it.
      
      Addresses the following denials:
      
      <4>[   20.212398] type=1400 audit(1402000262.433:11): avc: denied { getattr } for pid=1479 comm="adbd" path="/data/anr/traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      <4>[   20.252182] type=1400 audit(1402000262.473:12): avc: denied { read } for pid=1479 comm="adbd" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      <4>[   20.252579] type=1400 audit(1402000262.473:13): avc: denied { open } for pid=1479 comm="adbd" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      <4>[   27.104068] type=1400 audit(1402000268.479:14): avc: denied { read } for pid=2377 comm="sh" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:shell:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      
      Bug: 15450720
      
      (cherry picked from commit 4fd4a205)
      
      Change-Id: Ide6f62183a1c6e2af4cbe84bb0ebb928cd8e63b7
      cb182aba
    • Nick Kralevich's avatar
      Allow adbd / shell /data/anr access · 4fd4a205
      Nick Kralevich authored
      The shell user needs to be able to run commands like
      "cat /data/anr/traces.txt". Allow it.
      
      We also need to be able to pull the file via adb.
      "adb pull /data/anr/traces.txt". Allow it.
      
      Addresses the following denials:
      
      <4>[   20.212398] type=1400 audit(1402000262.433:11): avc: denied { getattr } for pid=1479 comm="adbd" path="/data/anr/traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      <4>[   20.252182] type=1400 audit(1402000262.473:12): avc: denied { read } for pid=1479 comm="adbd" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      <4>[   20.252579] type=1400 audit(1402000262.473:13): avc: denied { open } for pid=1479 comm="adbd" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:adbd:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      <4>[   27.104068] type=1400 audit(1402000268.479:14): avc: denied { read } for pid=2377 comm="sh" name="traces.txt" dev="mmcblk0p28" ino=325763 scontext=u:r:shell:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file
      
      Bug: 15450720
      Change-Id: I767102a7182895112838559b0ade1cd7c14459ab
      4fd4a205
  25. Jun 03, 2014
    • Nick Kralevich's avatar
      Remove obsolete vdc rule. · 24b56225
      Nick Kralevich authored
      As of system/core commit 225459a5da21e9397ca49b0d9af7d5fe3462706b,
      adbd no longer talks to vold. Remove the obsolete rule.
      
      Bug: 12504045
      Change-Id: I0a4f621afd8e5f8ab83219e7b0ff096c992d365f
      24b56225
  26. May 23, 2014
    • Stephen Smalley's avatar
      Restrict requesting contexts other than policy-defined defaults. · 356f4be6
      Stephen Smalley authored
      
      Writing to the /proc/self/attr files (encapsulated by the libselinux
      set*con functions) enables a program to request a specific security
      context for various operations instead of the policy-defined defaults.
      The security context specified using these calls is checked by an
      operation-specific permission, e.g. dyntransition for setcon,
      transition for setexeccon, create for setfscreatecon or
      setsockcreatecon, but the ability to request a context at all
      is controlled by a process permission.  Omit these permissions from
      domain.te and only add them back where required so that only specific
      domains can even request a context other than the default defined by
      the policy.
      
      Change-Id: I6a2fb1279318625a80f3ea8e3f0932bdbe6df676
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      356f4be6
  27. Apr 15, 2014
    • Nick Kralevich's avatar
      Label /dev/usb-ffs/adb functionfs · 77cc0550
      Nick Kralevich authored
      Newer adbd versions use functionfs instead of a custom adb usb gadget.
      Make sure the functionfs filesystem is properly labeled, and that adbd
      has access to the functionfs files.
      
      Once labeled, this addresses the following denials:
      
      <12>[   16.127191] type=1400 audit(949060866.189:4): avc:  denied  { read write } for  pid=223 comm="adbd" name="ep0" dev="functionfs" ino=5489 scontext=u:r:adbd:s0 tcontext=u:object_r:functionfs:s0 tclass=file
      <12>[   16.127406] type=1400 audit(949060866.189:5): avc:  denied  { open } for  pid=223 comm="adbd" path="/dev/usb-ffs/adb/ep0" dev="functionfs" ino=5489 scontext=u:r:adbd:s0 tcontext=u:object_r:functionfs:s0 tclass=file
      <12>[  377.366011] type=1400 audit(949061227.419:16): avc:  denied  { ioctl } for  pid=225 comm="adbd" path="/dev/usb-ffs/adb/ep2" dev="functionfs" ino=5564 scontext=u:r:adbd:s0 tcontext=u:object_r:functionfs:s0 tclass=file
      
      Change-Id: Iee8b522e48b4d677fd12f7c83dbc7ffbc9543ad2
      77cc0550
  28. Mar 12, 2014
    • dcashman's avatar
      Allow adbd access to gpu_device. · 4d529383
      dcashman authored
      Addresses denials seen when attempting to take a screencaputre from ddms:
      <5>[ 1232.327360] type=1400 audit(1393354131.695:41): avc:  denied  { read write } for  pid=18487 comm="screencap" name="nvhost-ctrl" dev="tmpfs" ino=4035 scontext=u:r:adbd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
      
      Bug: 13188914
      
      (cherry picked from commit ddde8c29)
      
      Change-Id: I25c90a0f5dadf5f4e9f99cd27cf8740766a21aaa
      4d529383
    • dcashman's avatar
      Allow adbd access to gpu_device. · ddde8c29
      dcashman authored
      Addresses denials seen when attempting to take a screencaputre from ddms:
      <5>[ 1232.327360] type=1400 audit(1393354131.695:41): avc:  denied  { read write } for  pid=18487 comm="screencap" name="nvhost-ctrl" dev="tmpfs" ino=4035 scontext=u:r:adbd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
      
      Bug: 13188914
      Change-Id: I758e4f87ab024035604d47eebae7f89f21ea1e3e
      ddde8c29
  29. Feb 25, 2014
  30. Feb 24, 2014
  31. Feb 05, 2014
    • Nick Kralevich's avatar
      Remove obsolete vdc rule. · 4e5dc85d
      Nick Kralevich authored
      As of system/core commit 225459a5da21e9397ca49b0d9af7d5fe3462706b,
      adbd no longer talks to vold. Remove the obsolete rule.
      
      Bug: 12504045
      Change-Id: I0a4f621afd8e5f8ab83219e7b0ff096c992d365f
      4e5dc85d
  32. Jan 27, 2014
    • Nick Kralevich's avatar
      Move adbd into enforcing (all build types) · f9563665
      Nick Kralevich authored
      adbd was only in enforcing for user builds. Commit
      Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6 allows us to move
      it into enforcing for everyone. Do it.
      
      Change-Id: Ie1a3e5361c891d2c9366e11f35699e3146cc3d88
      f9563665
  33. Jan 23, 2014
    • Nick Kralevich's avatar
      Support running adbd in the su domain. · 7d0f955e
      Nick Kralevich authored
      When adbd runs as root, it transitions into the
      su domain. Add the various rules to support this.
      
      This is needed to run the adbd and shell domains in
      enforcing on userdebug / eng devices without breaking
      developer workflows.
      
      Change-Id: Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6
      7d0f955e
  34. Jan 13, 2014
Loading