Skip to content
Snippets Groups Projects
  1. Jan 16, 2020
  2. Sep 27, 2018
    • Nick Kralevich's avatar
      Introduce system_file_type · 5e37271d
      Nick Kralevich authored
      system_file_type is a new attribute used to identify files which exist
      on the /system partition. It's useful for allow rules in init, which are
      based off of a blacklist of writable files. Additionally, it's useful
      for constructing neverallow rules to prevent regressions.
      
      Additionally, add commented out tests which enforce that all files on
      the /system partition have the system_file_type attribute. These tests
      will be uncommented in a future change after all the device-specific
      policies are cleaned up.
      
      Test: Device boots and no obvious problems.
      Change-Id: Id9bae6625f042594c8eba74ca712abb09702c1e5
      5e37271d
  3. Jun 26, 2018
    • Samuel Ha's avatar
      Revert "Revert "Reduce the number of processes that can start adbd"" · 22f98197
      Samuel Ha authored
      This reverts commit b5dc6137.
      
      Reason for revert: Reverted incorrect change
      
      Change-Id: Ieafa3338e28ffeed40bcceb73486cffbfbd08b9d
      22f98197
    • Samuel Ha's avatar
      Revert "Reduce the number of processes that can start adbd" · b5dc6137
      Samuel Ha authored
      This reverts commit faebeaca.
      
      Reason for revert: broke the build
      
      Change-Id: I3d61ce011ad42c6ff0e9f122de3daa37e846407a
      b5dc6137
    • Luis Hector Chavez's avatar
      Reduce the number of processes that can start adbd · faebeaca
      Luis Hector Chavez authored
      This change makes it such that only init can start adbd directly. It
      also introduces new rules for ctl.{start,stop,restart} properties such
      that only usbd and recovery (and su, since it's permissive) can directly
      ask init to start adbd.
      
      Bug: 64720460
      Test: adbd still runs
      Test: /data/nativetest64/adbd_test/adbd_test
      Test: python system/core/adb/test_adb.py
      Test: "USB debugging" in System Settings still start/stop adbd
      Test: Recovery menu still make the device show as "recovery" in adb
            devices
      Test: "Apply update from ADB" in recovery menu still works
      Change-Id: Iafcda8aa44e85129afcc958036b472d856fa1192
      faebeaca
  4. Aug 28, 2017
    • Bowgo Tsai's avatar
      Moving adbd from rootdir to system/bin · 5846c79e
      Bowgo Tsai authored
      Bug: 63910933
      Test: boot sailfish in normal mode, checks adbd is started
      Test: boot sailfish in recovery mode, checks adbd is started
      Test: boot bullhead in normal mode, checks adbd is started
      Test: boot bullhead in recovery mode, checks adbd is started
      
      Change-Id: I35ed78a15a34626fbd3c21d030e2bf51033f7b79
      Merged-In: I35ed78a15a34626fbd3c21d030e2bf51033f7b79
      (cherry picked from commit e2423d14)
      5846c79e
  5. Aug 16, 2017
    • Bowgo Tsai's avatar
      Moving adbd from rootdir to system/bin · e2423d14
      Bowgo Tsai authored
      Bug: 63910933
      Test: boot sailfish in normal mode, checks adbd is started
      Test: boot sailfish in recovery mode, checks adbd is started
      Test: boot bullhead in normal mode, checks adbd is started
      Test: boot bullhead in recovery mode, checks adbd is started
      
      Change-Id: I35ed78a15a34626fbd3c21d030e2bf51033f7b79
      e2423d14
  6. Feb 07, 2017
    • Alex Klyubin's avatar
      Move adbd policy to private · 8309f0a2
      Alex Klyubin authored
      This leaves only the existence of adbd domain as public API. All other
      rules are implementation details of this domain's policy and are thus
      now private.
      
      Test: No change to policy according to sesearch, except for
            disappearance of all allow rules to do with adbd_current except
            those created by other domains' allow rules referencing adbd
            domain from public and vendor policies.
      
      Bug: 31364497
      Change-Id: Icdce8b89f67c70c6c4c116471aaa412e55028cd8
      8309f0a2
  7. Feb 06, 2017
  8. Jan 20, 2017
  9. Jan 18, 2017
    • Josh Gao's avatar
      Introduce crash_dump debugging helper. · cb3eb4ee
      Josh Gao authored
      Replace the global debuggerd with a per-process debugging helper that
      gets exec'ed by the process that crashed.
      
      Bug: http://b/30705528
      Test: crasher/crasher64, `debuggerd <pid>`, `kill -ABRT <pid>`
      Change-Id: Iad1b7478f7a4e2690720db4b066417d8b66834ed
      cb3eb4ee
  10. Jan 11, 2017
  11. 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
  12. Oct 07, 2016
  13. 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
  14. 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
  15. Jul 19, 2016
  16. Jun 01, 2016
  17. 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
  18. 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
  19. 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
  20. 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
  21. Jan 15, 2016
  22. 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
  23. 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
  24. 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
  25. 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
  26. Nov 25, 2015
  27. 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
  28. Sep 15, 2015
  29. 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
  30. 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
  31. Apr 24, 2015
  32. 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
  33. Feb 23, 2015
Loading