Skip to content
Snippets Groups Projects
  1. Jan 07, 2017
    • ynwang's avatar
      Storaged permission setting · 9fa8823c
      ynwang authored
      Allowing storaged for reading from pseudo filesystems and debugfs.
      
      Bug: 32221677
      
      Change-Id: I837cead9a68f0b399703b64d724cb9c4b205c335
      9fa8823c
  2. Jan 04, 2017
    • Nick Kralevich's avatar
      untrusted_app: allow access to /proc/tty/drivers · e427a2b2
      Nick Kralevich authored
      /proc/tty/drivers is read by applications to figure out if they are
      running in an emulated environment. Specifically, they look for the
      string "goldfish" within that file.
      
      Arguably this is not an Android API, and really shouldn't be exposed to
      applications, but:
      
      1) A largish number of applications break if they can't read this file;
      2) The information here isn't particularly sensitive
      
      While we could spend a bunch of time trying to get applications fixed,
      there are bigger fish to fry. It's not worth the battle.
      
      Test: "ls -laZ /proc/tty/drivers" is labeled properly.
      Bug: 33214085
      Bug: 33814662
      Bug: 33791054
      Bug: 33211769
      Bug: 26813932
      Change-Id: Icc05bdc1c917547a6dca7d76636a1009369bde49
      e427a2b2
  3. Dec 12, 2016
    • Jerry Zhang's avatar
      Move MediaProvider to its own domain, add new MtpServer permissions · f921dd9c
      Jerry Zhang authored
      Also move necessary priv_app permissions into MediaProvider domain and
      remove MediaProvider specific permissions from priv_app.
      
      The new MtpServer permissions fix the following denials:
      
      avc: denied { write } for comm=6D747020666673206F70656E name="ep0" dev="functionfs" ino=12326 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:functionfs:s0 tclass=file permissive=1
      
      denial from setting property sys.usb.ffs.mtp.ready, context priv_app
      
      Bug: 30976142
      Test: Manual, verify permissions are allowed
      Change-Id: I4e66c5a8b36be21cdb726b5d00c1ec99c54a4aa4
      f921dd9c
  4. Dec 09, 2016
    • Jeff Sharkey's avatar
      installd has moved on to Binder; goodbye socket! · 8b1d4520
      Jeff Sharkey authored
      After a series of recent commits, installd has fully migrated over
      to Binder, and all socket-based communication has been removed.
      
      Test: builds, boots, apps install fine, pre-OTA dexopt works
      Bug: 13758960, 30944031
      Change-Id: Ia67b6260de58240d057c99b1bbd782b44376dfb5
      8b1d4520
  5. 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
  6. Nov 12, 2016
  7. Nov 11, 2016
    • Robert Sesek's avatar
      Add the "webview_zygote" domain. · dc43f7cd
      Robert Sesek authored
      The webview_zygote is a new unprivileged zygote and has its own sockets for
      listening to fork requests. However the webview_zygote does not run as root
      (though it does require certain capabilities) and only allows dyntransition to
      the isolated_app domain.
      
      Test: m
      Test: angler boots
      
      Bug: 21643067
      Change-Id: I89a72ffe6dcb983c4a44048518efd7efb7ed8e83
      dc43f7cd
  8. Oct 21, 2016
  9. Oct 13, 2016
    • Prashant Malani's avatar
      sepolicy: Add policy for vibrator HIDL service · b32b4a11
      Prashant Malani authored
      Fixes the following denials:
      avc: denied { open } for pid=7530 comm="android.hardwar" path="/sys/devices/virtual/timed_output/vibrator/enable" dev="sysfs" ino=20519 scontext=u:r:android_hardware_vibrator_1_0_service:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
      avc: denied { call } for pid=9173 comm="Binder:7735_C" scontext=u:r:system_server:s0 tcontext=u:r:android_hardware_vibrator_1_0_service:s0 tclass=binder permissive=1
      
      Test: m
      Bug: 32021191
      Change-Id: I243a86b449794e3c2f0abf91ddcf405eff548d0c
      b32b4a11
  10. Oct 07, 2016
  11. 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
  12. Sep 27, 2016
    • Jeff Vander Stoep's avatar
      Audit access to libart · 88cef4df
      Jeff Vander Stoep authored
      Grant access to all processes and audit access. The end goal is to
      whitelist all access to the interpreter. Several processes including
      dex2oat, apps, and zygote were observed using libart, so omit them
      from auditing and explicitly grant them access.
      
      Test: Angler builds and boots
      
      Bug: 29795519
      Change-Id: I9b93c7dbef5c49b95a18fd26307955d05a1c8e88
      88cef4df
  13. Sep 16, 2016
  14. Sep 13, 2016
    • Tao Bao's avatar
      Add ota_package_file label for OTA packages. · e06ed7d0
      Tao Bao authored
      (cherry picked from commit 6c3f2831)
      
      Allow priv_app, uncrypt, update_engine to access the OTA packages at
      /data/ota_package (both A/B and non-A/B). GMSCore (priv_app) checks
      the existence of the folder, and downloads the package there if present.
      
      Bug: 28944800
      Change-Id: I3c0717861fce7f93b33874a99f6a4a55567612a5
      e06ed7d0
  15. Aug 26, 2016
    • Christopher Wiley's avatar
      SEPolicy to start hostapd via init · d29c1a0a
      Christopher Wiley authored
      While here, remove a lot of extra permissions that we apparently
      had because hostapd was inheriting fds from netd.
      
      Bug: 30041118
      Test: netd can request init to start/stop hostapd without denials.
      
      Change-Id: Ia777497443a4226a201030eccb9dfc5a40f015dd
      (cherry picked from commit 8a6c5f85)
      d29c1a0a
    • Christopher Wiley's avatar
      Define explicit label for wlan sysfs fwpath · 97db27d8
      Christopher Wiley authored
      avc: denied { write } for name="fwpath" dev="sysfs" ino=6863
      scontext=u:r:wificond:s0 tcontext=u:object_r:sysfs_wlan_fwpath:s0
      tclass=file permissive=0
      
      Test: wificond and netd can write to this path, wifi works
      Test: `runtest frameworks-wifi` passes
      
      Bug: 29579539
      
      Change-Id: Ia21c654b00b09b9fe3e50d564b82966c9c8e6994
      (cherry picked from commit 7d13dd80)
      97db27d8
  16. Aug 08, 2016
  17. Aug 05, 2016
    • Daniel Micay's avatar
      restrict access to timing information in /proc · 5423db6e
      Daniel Micay authored
      These APIs expose sensitive information via timing side channels. This
      leaves access via the adb shell intact along with the current uses by
      dumpstate, init and system_server.
      
      The /proc/interrupts and /proc/stat files were covered in this paper:
      
      https://www.lightbluetouchpaper.org/2016/07/29/yet-another-android-side-channel/
      
      The /proc/softirqs, /proc/timer_list and /proc/timer_stats files are
      also relevant.
      
      Access to /proc has been greatly restricted since then, with untrusted
      apps no longer having direct access to these, but stricter restrictions
      beyond that would be quite useful.
      
      Change-Id: Ibed16674856569d26517e5729f0f194b830cfedd
      5423db6e
  18. Jul 22, 2016
  19. Jun 28, 2016
    • Jeff Vander Stoep's avatar
      domain: allow reading /proc/sys/vm/overcommit_memory · bc1986fb
      Jeff Vander Stoep authored
      Needed for jemalloc commit:
      
      2f970c32b527660a33fa513a76d913c812dcf7c
      Modify pages_map() to support mapping uncommitted virtual memory.
      
      avc: denied { read } for name="overcommit_memory" dev="proc" ino=10544
      scontext=u:r:wificond:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      Bug: 29773242
      Change-Id: I78054c1ed576a7998c4ee1d1beca2f610c589c3a
      bc1986fb
  20. Jun 10, 2016
    • dcashman's avatar
      Allow access to sysfs usb nodes. · b144ebab
      dcashman authored
      Some legitimate functionality currently requires direct sysfs access
      that is not otherwise possible via the android APIs.  Specifically,
      isochronous USB transfers require this direct access, without which USB
      audio applications would noticibly suffer.
      
      Grant read access to the usb files under /sys/devices to prevent this
      regression.
      
      Bug: 28417852
      Change-Id: I3424bf3498ffa0eb647a54cc962ab8c54f291728
      b144ebab
  21. Jun 06, 2016
    • Tao Bao's avatar
      Add ota_package_file label for OTA packages. · 6c3f2831
      Tao Bao authored
      Allow priv_app, uncrypt, update_engine to access the OTA packages at
      /data/ota_package (both A/B and non-A/B). GMSCore (priv_app) checks
      the existence of the folder, and downloads the package there if present.
      
      Bug: 28944800
      Change-Id: I3c0717861fce7f93b33874a99f6a4a55567612a5
      6c3f2831
  22. Jun 01, 2016
  23. May 24, 2016
    • Fyodor Kupolov's avatar
      SELinux policies for /data/preloads directory · 49ac2a3d
      Fyodor Kupolov authored
      A new directory is created in user data partition that contains preloaded
      content such as a retail mode demo video and pre-loaded APKs.
      
      The new directory is writable/deletable by system server. It can only be
      readable (including directory list) by privileged or platform apps
      
      Bug: 28855287
      Change-Id: I3816cd3a1ed5b9a030965698a66265057214f037
      49ac2a3d
  24. May 13, 2016
    • Christian Poetzsch's avatar
      sepolicy: add support for new tracefs · 97573fdf
      Christian Poetzsch authored
      Since kernel 4.1 ftrace is supported as a new separate filesystem. It
      gets automatically mounted by the kernel under the old path
      /sys/kernel/debug/tracing. Because it lives now on a separate device
      some sepolicy rules need to be updated. This patch is doing that. Most
      of the rules are created based on a conversation happened on the SELinux
      Android mailing list:
      
      http://comments.gmane.org/gmane.comp.security.seandroid/2799
      
      
      
      Note, that this also needs 3a343a1 from the 4.4 branch in kernel/common.
      Also note that when tracefs is auto mounted by the kernel, the kernel
      does not use the "mode" parameter specified to mount debugfs for
      tracefs. So an extra line like
      
         chmod 0755 /sys/kernel/debug/tracing
      
      is necessary in init.${ro.hardware}.rc after debugfs was mounted.
      
      Signed-off-by: default avatarChristian Poetzsch <christian.potzsch@imgtec.com>
      
      (cherry picked from commit 4dafa72a)
      
      Change-Id: I75738c756b49da4ac109ae442ee37c1e2844ff0a
      97573fdf
    • Christian Poetzsch's avatar
      sepolicy: add support for new tracefs · 4dafa72a
      Christian Poetzsch authored
      Since kernel 4.1 ftrace is supported as a new separate filesystem. It
      gets automatically mounted by the kernel under the old path
      /sys/kernel/debug/tracing. Because it lives now on a separate device
      some sepolicy rules need to be updated. This patch is doing that. Most
      of the rules are created based on a conversation happened on the SELinux
      Android mailing list:
      
      http://comments.gmane.org/gmane.comp.security.seandroid/2799
      
      
      
      Note, that this also needs 3a343a1 from the 4.4 branch in kernel/common.
      Also note that when tracefs is auto mounted by the kernel, the kernel
      does not use the "mode" parameter specified to mount debugfs for
      tracefs. So an extra line like
      
         chmod 0755 /sys/kernel/debug/tracing
      
      is necessary in init.${ro.hardware}.rc after debugfs was mounted.
      
      Change-Id: I60fb7a90e24628e0370c3bca57644451fce5646d
      Signed-off-by: default avatarChristian Poetzsch <christian.potzsch@imgtec.com>
  25. May 12, 2016
  26. May 06, 2016
    • William Roberts's avatar
      property_socket: add mlstrustedobject attribute · 9fca8a39
      William Roberts authored
      
      In order to allow set_prop() to function with platform_apps,
      the property_socket file requires mlstrustedobject since
      platform app uses category sets.
      
      This does not allow untrusted_app access, as the following
      neverallows still prevent type access:
      
      untrusted_app.te:118:neverallow untrusted_app property_socket:sock_file write;
      untrusted_app.te:120:neverallow untrusted_app property_type:property_service set;
      
      Lastly, the internal socket to property_service is labeled with init
      which is mlstrustedsubject, so no changes are required there.
      
      Change-Id: I47296a2dc24b16785fd296deea7a54ae9966226a
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@intel.com>
      9fca8a39
  27. Apr 18, 2016
  28. Apr 09, 2016
    • Alex Deymo's avatar
      Allow postinstall_file to be an entrypoint. · ac52f460
      Alex Deymo authored
      postinstall_file was an exec_type so it could be an entrypoint for the
      domain_auto_trans from update_engine domain to postinstall domain. This
      patch removes the exec_type from postinstall_file and exempts it from
      the neverallow rule to become an entrypoint.
      
      Bug: 28008031
      TEST=postinstall_example still runs as the "postinstall" domain on edison-eng.
      
      (cherry picked from commit a9671c6b)
      
      Change-Id: I2e1f61ed42f8549e959edbe047c56513903e8e9c
      ac52f460
  29. Apr 06, 2016
    • Alex Deymo's avatar
      Allow postinstall_file to be an entrypoint. · a9671c6b
      Alex Deymo authored
      postinstall_file was an exec_type so it could be an entrypoint for the
      domain_auto_trans from update_engine domain to postinstall domain. This
      patch removes the exec_type from postinstall_file and exempts it from
      the neverallow rule to become an entrypoint.
      
      Bug: 28008031
      TEST=postinstall_example still runs as the "postinstall" domain on edison-eng.
      
      Change-Id: Icbf5b262c6f971ce054f1b4896c611b32a6d66b5
      a9671c6b
  30. Apr 05, 2016
    • Alex Deymo's avatar
      Revert "Remove "exec_type" from postinstall_file." · f43af3a6
      Alex Deymo authored
      We decided a different approach for these policies in the
      meeting today.
      
      This reverts commit 5507fa66.
      
      Bug: 28008031
      Change-Id: Id86520660bdbc3fc36ac4acf51082547d6a559eb
      f43af3a6
    • Alex Deymo's avatar
      Remove "exec_type" from postinstall_file. · 5507fa66
      Alex Deymo authored
      update_engine had an automatic transition to the "postinstall" domain
      when executing a "postinstall_file" which required it to be an
      entrypoint. This patch removes this automatic transition and the
      associated rules in update_engine.te, removing as well the need to
      add exec_type to postinstall_file. Instead, update_engine now makes
      this transition explicit by calling setexeccon(3).
      
      Bug: 28008031
      TEST=make dist; Deployed an update to edison-eng: postinstall runs as "postinstall" domain.
      
      Change-Id: I2b799ac4808c90b010a9e776aaa7015020a94b49
      5507fa66
  31. Mar 29, 2016
    • Daichi Hirono's avatar
      Add mlstrustedobject to appfuse object type. · f19fb0c9
      Daichi Hirono authored
      To write bytes to appfuse file from priv_app, we need to specify
      mlstrustedobject.
      The CL fixes the following denial.
      
      type=1400 audit(0.0:77): avc: denied { write } for name="10" dev="fuse" ino=10 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:app_fuse_file:s0 tclass=file permissive=0
      
      BUG=23093747
      
      (cherry picked from commit 4d19f98c)
      
      Change-Id: I9901033bb3349d5def0bd7128db45a1169856dc1
      f19fb0c9
  32. Mar 28, 2016
    • Daichi Hirono's avatar
      Add mlstrustedobject to appfuse object type. · 4d19f98c
      Daichi Hirono authored
      To write bytes to appfuse file from priv_app, we need to specify
      mlstrustedobject.
      The CL fixes the following denial.
      
      type=1400 audit(0.0:77): avc: denied { write } for name="10" dev="fuse" ino=10 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:app_fuse_file:s0 tclass=file permissive=0
      
      BUG=23093747
      
      Change-Id: I9901033bb3349d5def0bd7128db45a1169856dc1
      4d19f98c
  33. Mar 25, 2016
  34. Mar 24, 2016
    • dcashman's avatar
      Move sysfs_thermal to global policy and grant access. · df72abb3
      dcashman authored
      sysfs_thermal nodes are common enough to warrant an entry in global
      policy and the new HardwarePropertiesManagerService exists explicitly to
      expose some of this information.
      
      Address the following denials:
      avc: denied { search } for name="thermal" dev="sysfs" ino=17509 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=1
      avc: denied { read } for name="temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      avc: denied { open } for path="/sys/devices/virtual/thermal/thermal_zone8/temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      avc: denied { getattr } for path="/sys/devices/virtual/thermal/thermal_zone8/temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
      
      (cherry-pick of internal commit: 98eff7c3)
      
      Bug: 27809332
      Change-Id: I6f812a7e281e348aa24c76b119e71ed95e1a1d9f
      df72abb3
    • Mark Salyzyn's avatar
      Add recovery_persist & recovery_refresh · 05806470
      Mark Salyzyn authored
      (cherry pick from commit 16fe52c9)
      
      One time executables. recovery_refresh can be used at any time to
      ensure recovery logs in pmsg are re-placed at the end of the FIFO.
      recovery_persist takes the recovery logs in pmsg and drops them
      into /data/misc/recovery/ directory.
      
      Bug: 27176738
      Change-Id: Ife3cf323930fb7a6a5d1704667961f9d42bfc5ac
      05806470
    • Mark Salyzyn's avatar
      Add recovery_persist & recovery_refresh · 16fe52c9
      Mark Salyzyn authored
      One time executables. recovery_refresh can be used at any time to
      ensure recovery logs in pmsg are re-placed at the end of the FIFO.
      recovery_persist takes the recovery logs in pmsg and drops them
      into /data/misc/recovery/ directory.
      
      Bug: 27176738
      Change-Id: Ife3cf323930fb7a6a5d1704667961f9d42bfc5ac
      16fe52c9
Loading