Skip to content
Snippets Groups Projects
  1. 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
  2. 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
  3. Jul 21, 2014
    • Colin Cross's avatar
      sepolicy: allow charger to read /sys/fs/pstore/console-ramoops · 3cfc7ea8
      Colin Cross authored
      Addresses the denial in charger mode:
      [   17.993733] type=1400 audit(1405412231.119:4): avc:  denied  { search } for  pid=123 comm="charger" name="/" dev="pstore" ino=10287 scontext=u:r:healthd:s0 tcontext=u:object_r:pstorefs:s0 tclass=dir permissive=0
      
      (cherry picked from commit bb96bffc)
      
      Change-Id: I2dde6adc3ff99df99409d4da3ef32c3987228801
      3cfc7ea8
    • Colin Cross's avatar
      sepolicy: allow charger to read /sys/fs/pstore/console-ramoops · bb96bffc
      Colin Cross authored
      Addresses the denial in charger mode:
      [   17.993733] type=1400 audit(1405412231.119:4): avc:  denied  { search } for  pid=123 comm="charger" name="/" dev="pstore" ino=10287 scontext=u:r:healthd:s0 tcontext=u:object_r:pstorefs:s0 tclass=dir permissive=0
      
      Change-Id: I95e65753a99aa61ef86b8eebb7083b3d450e6b7b
      bb96bffc
  4. Jul 18, 2014
  5. Jul 15, 2014
  6. 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
  7. 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
  8. Jun 23, 2014
    • Riley Andrews's avatar
      Give healthd permission to write sys properties to allow quick boot from charger mode. · 51df227d
      Riley Andrews authored
      Property being set: sys.boot_from_charger_mode. If healthd attempts to write
      this property without the policy changes we get the following audit message:
      
      [   45.751195] type=1400 audit(1403556447.444:7): avc:  denied  { write } for pid=99 comm="charger" name="property_service" dev="tmpfs" ino=3229 scontext=u:r:healthd:s0 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
      
      These changes are needed to support the following system/core commit:
      faster booting from charger mode
      * Ieec4494d929e92806e039f834d78b9002afd15c4
      
      Change-Id: I9f198cd73c7b2f1e372c3793dc2b8d5ef26b3a0f
      51df227d
  9. 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
  10. Jun 04, 2014
  11. May 23, 2014
    • Nick Kralevich's avatar
      Introduce wakelock_use() · 8599e34b
      Nick Kralevich authored
      Introduce wakelock_use(). This macro declares that a domain uses
      wakelocks.
      
      Wakelocks require both read-write access to files in /sys/power, and
      CAP_BLOCK_SUSPEND. This macro helps ensure that both capabilities and
      file access are granted at the same time.
      
      Still TODO: fix device specific wakelock use.
      
      Change-Id: Ib98ff374a73f89e403acd9f5e024988f59f08115
      8599e34b
  12. May 13, 2014
    • Nick Kralevich's avatar
      DO NOT MERGE: Fix broken halt while in healthd charger mode · 3ff8b536
      Nick Kralevich authored
      Reboots/halts aren't working in healthd charger mode. This is
      causing high power draw in an unplugged, powered off state.
      
      Steps to reproduce (on Nexus 5):
        Unplug device from USB charger/computer
        Turn device off
        Wait for device to turn off
        Plug in USB cable/charger
        Wait for charge animation (wait for animation, not just lightning bolt, may have to press power button briefly to get animation going)
        Wait for panel to turn off
        Unplug USB cable/charger
        Press power button again, notice screen turns on at some frame in the animation.
        (not important) Each press of the power button advances the animation
        Power on.
        Examine denials from /proc/last_kmsg
      
      Addresses the following denials:
      
      [   24.934809] type=1400 audit(12534308.640:8): avc:  denied  { write } for  pid=130 comm="healthd" name="sysrq-trigger" dev="proc" ino=4026533682 scontext=u:r:healthd:s0 tcontext=u:object_r:proc_sysrq:s0 tclass=file
      [   24.935395] type=1400 audit(12534308.640:9): avc:  denied  { sys_boot } for  pid=130 comm="healthd" capability=22  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability
      
      Bug: 13229119
      Bug: 14833575
      
      (cherry picked from commit 9ada894a)
      
      Change-Id: I6175ad9225e847a0a40d558ac65c3544b22803d5
      3ff8b536
  13. May 07, 2014
    • Greg Hackmann's avatar
      Add policies for Atomic Display Framework · 7004789d
      Greg Hackmann authored
      
      ADF is a modern replacement for fbdev.
      
      ADF's device nodes (/dev/adf[X]), interface nodes
      (/dev/adf-interface[X].[Y]), and overlay engine nodes
      (/dev/adf-overlay-engine[X].[Y]) are collectively used in similar
      contexts as fbdev nodes.  Vendor HW composers (via SurfaceFlinger) and
      healthd will need to send R/W ioctls to these nodes to prepare and
      update the display.
      
      Ordinary apps should not talk to ADF directly.
      
      Change-Id: Ic0a76b1e82c0cc1e8f240f219928af1783e79343
      Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
      7004789d
  14. Mar 17, 2014
    • Nick Kralevich's avatar
      Allow healthd sys_tty_config · 6ae2d6e2
      Nick Kralevich authored
      healthd performs privileged ioctls on the tty device
      when in charger mode. Allow it.
      
      This fixes a bug where off charging mode is forcing the device
      to reboot into recovery.
      
      Addresses the following denial:
      
      type=1400 audit(15080631.900:4): avc:  denied  { sys_tty_config } for  pid=130 comm="healthd" capability=26  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability
      
      Bug: 13472365
      
      (cherry picked from commit c8012152)
      
      Change-Id: I701ad577c6814b0dafaef1367d0445b47a104f3c
      6ae2d6e2
    • Stephen Smalley's avatar
      Address healthd denials. · 74ac8c33
      Stephen Smalley authored
      
      Resolve denials such as:
      avc:  denied  { write } for  pid=130 comm="healthd" name="state" dev="sysfs" ino=57 scontext=u:r:healthd:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      avc:  denied  { read write } for  pid=130 comm="healthd" name="tty0" dev="tmpfs" ino=5677 scontext=u:r:healthd:s0 tcontext=u:object_r:tty_device:s0 tclass=chr_file
      
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      
      (cherry picked from commit ebc08e82)
      
      Change-Id: Ib72388cc2d192fe78397e3a2a401db08b5b6c267
      74ac8c33
    • Nick Kralevich's avatar
      Fix broken halt while in healthd charger mode · 9ada894a
      Nick Kralevich authored
      Reboots/halts aren't working in healthd charger mode. This is
      causing high power draw in an unplugged, powered off state.
      
      Steps to reproduce (on Nexus 5):
        Unplug device from USB charger/computer
        Turn device off
        Wait for device to turn off
        Plug in USB cable/charger
        Wait for charge animation (wait for animation, not just lightning bolt, may have to press power button briefly to get animation going)
        Wait for panel to turn off
        Unplug USB cable/charger
        Press power button again, notice screen turns on at some frame in the animation.
        (not important) Each press of the power button advances the animation
        Power on.
        Examine denials from /proc/last_kmsg
      
      Addresses the following denials:
      
      [   24.934809] type=1400 audit(12534308.640:8): avc:  denied  { write } for  pid=130 comm="healthd" name="sysrq-trigger" dev="proc" ino=4026533682 scontext=u:r:healthd:s0 tcontext=u:object_r:proc_sysrq:s0 tclass=file
      [   24.935395] type=1400 audit(12534308.640:9): avc:  denied  { sys_boot } for  pid=130 comm="healthd" capability=22  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability
      
      Bug: 13229119
      Change-Id: If14a9c373bbf156380a34fbd9aca6201997d5553
      9ada894a
  15. Mar 14, 2014
    • Nick Kralevich's avatar
      Allow healthd sys_tty_config · c8012152
      Nick Kralevich authored
      healthd performs privileged ioctls on the tty device
      when in charger mode. Allow it.
      
      This fixes a bug where off charging mode is forcing the device
      to reboot into recovery.
      
      Addresses the following denial:
      
      type=1400 audit(15080631.900:4): avc:  denied  { sys_tty_config } for  pid=130 comm="healthd" capability=26  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability
      
      Bug: 13472365
      Change-Id: I402987baf62ba0017e79e30e370850c32c286a6a
      c8012152
  16. Mar 11, 2014
    • Stephen Smalley's avatar
      Address healthd denials. · ebc08e82
      Stephen Smalley authored
      
      Resolve denials such as:
      avc:  denied  { write } for  pid=130 comm="healthd" name="state" dev="sysfs" ino=57 scontext=u:r:healthd:s0 tcontext=u:object_r:sysfs:s0 tclass=file
      avc:  denied  { read write } for  pid=130 comm="healthd" name="tty0" dev="tmpfs" ino=5677 scontext=u:r:healthd:s0 tcontext=u:object_r:tty_device:s0 tclass=chr_file
      
      Change-Id: Iff0609af924b4e5094be7512646140c3baa97549
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      ebc08e82
  17. Jan 28, 2014
    • Nick Kralevich's avatar
      fix healthd charger mode. · 0352393d
      Nick Kralevich authored
      Healthd has an optional "charger" mode. The device boots into a
      minimally running mode, and healthd displays the battery indicator.
      
      Without this patch, when a manta device boots into charger mode,
      the screen will never turn off and the battery indicator will not move.
      
      From reviewing the healthd code, it looks like this may affect lots
      of devices, not just manta. I'm adding this change to the generic
      policy.
      
      Steps to reproduce:
      
      1) Make sure the device is unplugged.
      2) Boot into a normal system.
      3) Shutdown the system normally using the power button.
      4) After shutdown, plugin the power cord.
      5) Device will boot into charger mode. Battery icon will display.
      6) Press the button to reboot into a normal mode.
      7) Examine /proc/last_kmsg and look for denials.
      
      Addresses the following denials:
      
      [    3.908457] type=1400 audit(1390866386.620:3): avc:  denied  { read write } for  pid=98 comm="charger" name="fb0" dev="tmpfs" ino=4286 scontext=u:r:healthd:s0 tcontext=u:object_r:graphics_device:s0 tclass=chr_file
      [    3.909085] type=1400 audit(1390866386.620:4): avc:  denied  { open } for  pid=98 comm="charger" name="fb0" dev="tmpfs" ino=4286 scontext=u:r:healthd:s0 tcontext=u:object_r:graphics_device:s0 tclass=chr_file
      [    3.909749] type=1400 audit(1390866386.620:5): avc:  denied  { ioctl } for  pid=98 comm="charger" path="/dev/graphics/fb0" dev="tmpfs" ino=4286 scontext=u:r:healthd:s0 tcontext=u:object_r:graphics_device:s0 tclass=chr_file
      [    4.889857] type=1400 audit(1390866387.605:6): avc:  denied  { read } for  pid=98 comm="charger" name="input" dev="tmpfs" ino=4153 scontext=u:r:healthd:s0 tcontext=u:object_r:input_device:s0 tclass=dir
      [    4.890873] type=1400 audit(1390866387.605:7): avc:  denied  { open } for  pid=98 comm="charger" name="input" dev="tmpfs" ino=4153 scontext=u:r:healthd:s0 tcontext=u:object_r:input_device:s0 tclass=dir
      [    4.891949] type=1400 audit(1390866387.605:8): avc:  denied  { search } for  pid=98 comm="charger" name="input" dev="tmpfs" ino=4153 scontext=u:r:healthd:s0 tcontext=u:object_r:input_device:s0 tclass=dir
      [    4.892677] type=1400 audit(1390866387.605:9): avc:  denied  { read } for  pid=98 comm="charger" name="event2" dev="tmpfs" ino=4279 scontext=u:r:healthd:s0 tcontext=u:object_r:input_device:s0 tclass=chr_file
      [    4.893576] type=1400 audit(1390866387.605:10): avc:  denied  { open } for  pid=98 comm="charger" name="event2" dev="tmpfs" ino=4279 scontext=u:r:healthd:s0 tcontext=u:object_r:input_device:s0 tclass=chr_file
      [    7.288104] type=1400 audit(1390866389.999:12): avc:  denied  { execmem } for  pid=98 comm="charger" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=process
      [    7.288574] type=1400 audit(1390866389.999:13): avc:  denied  { execute } for  pid=98 comm="charger" path="/dev/ashmem" dev="tmpfs" ino=4113 scontext=u:r:healthd:s0 tcontext=u:object_r:ashmem_device:s0 tclass=chr_file
      
      Change-Id: I0118e08514caa0ad11d2aa7562c9846a96779a21
      0352393d
  18. Jan 27, 2014
    • Nick Kralevich's avatar
      Remove transition / dyntransition from unconfined · fed8a2a4
      Nick Kralevich authored
      Require all domain transitions or dyntransitions to be
      explicitly specified in SELinux policy.
      
      healthd: Remove healthd_exec / init_daemon_domain().
      Healthd lives on the rootfs and has no unique file type.
      It should be treated consistent with other similar domains.
      
      Change-Id: Ief3c1167379cfb5383073fa33c9a95710a883b29
      fed8a2a4
  19. Jan 22, 2014
  20. Dec 16, 2013
    • Nick Kralevich's avatar
      initial dumpstate domain · 09e6abd9
      Nick Kralevich authored
      Add the necessary rules to support dumpstate.
      Start off initially in permissive until it has more testing.
      
      Dumpstate is triggered by running "adb bugreport"
      
      Change-Id: Ic17a60cca1f6f40daa4f2c51e9ad6009ef36cfbd
      09e6abd9
  21. Nov 07, 2013
    • Stephen Smalley's avatar
      Confine healthd, but leave it permissive for now. · 2a604adf
      Stephen Smalley authored
      
      Remove unconfined_domain() and add the allow rules required for
      operation of healthd.  Restore the permissive declaration until
      I8a3e0db15ec5f4eb05d455a57e8446a8c2b484c2 is applied to the 3.4
      kernel.
      
      Resolves the following denials in 4.4:
      type=1400 audit(1383590167.750:14): avc:  denied  { read } for  pid=49 comm="healthd" path="/sbin/healthd" dev="rootfs" ino=1232 scontext=u:r:healthd:s0 tcontext=u:object_r:rootfs:s0 tclass=file
      type=1400 audit(1383590167.750:15): avc:  denied  { mknod } for  pid=49 comm="healthd" capability=27  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability
      type=1400 audit(1383590167.750:16): avc:  denied  { create } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=netlink_kobject_uevent_socket
      type=1400 audit(1383590167.750:17): avc:  denied  { setopt } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=netlink_kobject_uevent_socket
      type=1400 audit(1383590167.750:17): avc:  denied  { net_admin } for  pid=49 comm="healthd" capability=12  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability
      type=1400 audit(1383590167.750:18): avc:  denied  { bind } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=netlink_kobject_uevent_socket
      shell@generic:/ $ type=1400 audit(1383590168.800:21): avc:  denied  { call } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:servicemanager:s0 tclass=binder
      type=1400 audit(1383590168.800:22): avc:  denied  { transfer } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:servicemanager:s0 tclass=binder
      type=1400 audit(1383590168.800:23): avc:  denied  { 0x10 } for  pid=49 comm="healthd" capability=36  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability2
      type=1400 audit(1383590168.800:24): avc:  denied  { read } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=netlink_kobject_uevent_socket
      type=1400 audit(1383590212.320:161): avc:  denied  { call } for  pid=376 comm="system_server" scontext=u:r:system_server:s0 tcontext=u:r:healthd:s0 tclass=binder
      type=1400 audit(1383590212.320:161): avc:  denied  { transfer } for  pid=376 comm="system_server" scontext=u:r:system_server:s0 tcontext=u:r:healthd:s0 tclass=binder
      type=1400 audit(1383590212.320:162): avc:  denied  { call } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:system_server:s0 tclass=binder
      type=1400 audit(1383590275.930:463): avc:  denied  { call } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:system_server:s0 tclass=binder
      
      Change-Id: Iacd058edfa1e913a8f24ce8937d2d76c928d6740
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      2a604adf
  22. Oct 21, 2013
    • Nick Kralevich's avatar
      Move unconfined domains out of permissive mode. · 353c72e3
      Nick Kralevich authored
      This change removes the permissive line from unconfined
      domains. Unconfined domains can do (mostly) anything, so moving
      these domains into enforcing should be a no-op.
      
      The following domains were deliberately NOT changed:
      1) kernel
      2) init
      
      In the future, this gives us the ability to tighten up the
      rules in unconfined, and have those tightened rules actually
      work.
      
      When we're ready to tighten up the rules for these domains,
      we can:
      
      1) Remove unconfined_domain and re-add the permissive line.
      2) Submit the domain in permissive but NOT unconfined.
      3) Remove the permissive line
      4) Wait a few days and submit the no-permissive change.
      
      For instance, if we were ready to do this for adb, we'd identify
      a list of possible rules which allow adbd to work, re-add
      the permissive line, and then upload those changes to AOSP.
      After sufficient testing, we'd then move adb to enforcing.
      We'd repeat this for each domain until everything is enforcing
      and out of unconfined.
      
      Change-Id: If674190de3262969322fb2e93d9a0e734f8b9245
      353c72e3
  23. Aug 28, 2013
  24. Jun 18, 2013
Loading