Skip to content
Snippets Groups Projects
  1. Dec 19, 2013
  2. Dec 18, 2013
  3. Dec 17, 2013
    • Nick Kralevich's avatar
    • Stephen Smalley's avatar
      Label /data/media with its own type and allow access. · e13fabd7
      Stephen Smalley authored
      
      /data/media presently is left in system_data_file, which requires
      anything that wants to write to it to be able to write to system_data_file.
      Introduce a new type for /data/media, media_rw_data_file (to match
      the media_rw UID assigned to it and distinguish it from /data/misc/media
      which has media UID and media_data_file type), and allow access to it.
      
      We allow this for all platform app domains as WRITE_MEDIA_STORAGE permission is granted
      to signature|system.  We should not have to allow it to untrusted_app.
      
      Set up type transitions in sdcardd to automatically label any directories
      or files it creates with the new type.
      
      Change-Id: I5c7e6245b854a9213099e40a41d9583755d37d42
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      e13fabd7
    • Nick Kralevich's avatar
      system_server.te: allow getopt/getattr on zygote socket · c4d7c0d7
      Nick Kralevich authored
      In 61dc3507, I forgot to allow
      system_server to run getopt/getattr on the zygote socket.
      
      Bug: 12061011
      Change-Id: I14f8fc98c1b08dfd3c2188d562e594547dba69e6
      c4d7c0d7
    • Nick Kralevich's avatar
      app.te: allow getopt/getattr on zygote socket · 61dc3507
      Nick Kralevich authored
      The closure of /dev/socket/zygote occurs in the zygote child
      process, after Zygote has dropped privileges and changed
      SELinux domains. In Google's internal tree, socket closures
      are following a different path, which is causing getopt/getattr
      to be used on the file descriptor. This is generating a large
      number of denials.
      
      Allow the operations for now. getopt/getattr are fairly harmless.
      Long term, we shouldn't be performing these operations on the
      zygote socket.
      
      Addresses the following denials:
      
      18.352783   type=1400 audit(1386374111.043:7): avc:  denied  { getattr } for  pid=682 comm="ndroid.systemui" path="socket:[9287]" dev="sockfs" ino=9287 scontext=u:r:platform_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      18.353088   type=1400 audit(1386374111.043:8): avc:  denied  { getopt } for  pid=682 comm="ndroid.systemui" path="/dev/socket/zygote" scontext=u:r:platform_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      18.833251   type=1400 audit(1386374111.524:9): avc:  denied  { getattr } for  pid=761 comm="d.process.acore" path="socket:[9287]" dev="sockfs" ino=9287 scontext=u:r:shared_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      18.833557   type=1400 audit(1386374111.524:10): avc:  denied  { getopt } for  pid=761 comm="d.process.acore" path="/dev/socket/zygote" scontext=u:r:shared_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      19.042419   type=1400 audit(1386374111.734:11): avc:  denied  { getattr } for  pid=806 comm="d.process.media" path="socket:[9287]" dev="sockfs" ino=9287 scontext=u:r:media_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      19.042724   type=1400 audit(1386374111.734:12): avc:  denied  { getopt } for  pid=806 comm="d.process.media" path="/dev/socket/zygote" scontext=u:r:media_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      19.182830   type=1400 audit(1386374111.874:14): avc:  denied  { getattr } for  pid=825 comm="putmethod.latin" path="socket:[9287]" dev="sockfs" ino=9287 scontext=u:r:untrusted_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      19.183105   type=1400 audit(1386374111.874:15): avc:  denied  { getopt } for  pid=825 comm="putmethod.latin" path="/dev/socket/zygote" scontext=u:r:untrusted_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      19.235473   type=1400 audit(1386374111.924:16): avc:  denied  { getattr } for  pid=840 comm="ndroid.settings" path="socket:[9287]" dev="sockfs" ino=9287 scontext=u:r:system_app:s0 tcontext=u:r:zygote:s0 tclass=unix_stream_socket
      
      Bug: 12061011
      Change-Id: Ie1ec7636185aba7954656802e5eed735f49830c9
      61dc3507
  4. Dec 16, 2013
  5. Dec 15, 2013
  6. Dec 13, 2013
  7. Dec 12, 2013
  8. Dec 11, 2013
    • Nick Kralevich's avatar
      Allow apps to execute ping · cf6b350a
      Nick Kralevich authored
      Addresses the following denials:
      
      <5>[  170.166218] type=1400 audit(1386789488.029:57): avc:  denied  { getattr } for  pid=4352 comm="sh" path="/system/bin/ping" dev="mmcblk0p25" ino=182 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:ping_exec:s0 tclass=file
      <5>[  170.166356] type=1400 audit(1386789488.029:58): avc:  denied  { execute } for  pid=4352 comm="sh" name="ping" dev="mmcblk0p25" ino=182 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:ping_exec:s0 tclass=file
      <5>[  170.166841] type=1400 audit(1386789488.029:59): avc:  denied  { read open } for  pid=4389 comm="sh" name="ping" dev="mmcblk0p25" ino=182 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:ping_exec:s0 tclass=file
      <5>[  170.166962] type=1400 audit(1386789488.029:60): avc:  denied  { execute_no_trans } for  pid=4389 comm="sh" path="/system/bin/ping" dev="mmcblk0p25" ino=182 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:ping_exec:s0 tclass=file
      
      Change-Id: Ic175ef7392897a3941c36db67dfa59ded35204b5
      cf6b350a
    • Nick Kralevich's avatar
      Merge "Make ping enforcing." · ca9ba328
      Nick Kralevich authored
      ca9ba328
    • Nick Kralevich's avatar
      21a6a6b5
    • Nick Kralevich's avatar
      Merge "Make the runas domain enforcing." · b71be5cf
      Nick Kralevich authored
      b71be5cf
    • Nick Kralevich's avatar
      Allow system_app to set properties · 3e78000e
      Nick Kralevich authored
      Settings > Developer Options > Profile GPU Rendering was broken,
      as it couldn't set a debug.* system property.
      
      In addition, system_app wasn't allowed to access init's property_service socket.
      
      Both fixed.
      
      In addition, allow system_app to write to radio_prop.
      
      Fixes the following denials:
      
      <5>[  170.769658] type=1400 audit(1386722177.029:57): avc:  denied  { write } for  pid=4142 comm="ndroid.settings" name="property_service" dev="tmpfs" ino=7457 scontext=u:r:system_app:s0 tcontext=u:object_r:property_socket:s0 tclass=sock_file
      <4>[  170.770064] avc:  denied  { set } for property=debug.hwui.overdraw scontext=u:r:system_app:s0 tcontext=u:object_r:debug_prop:s0 tclass=property_service
      <3>[  170.770148] init: sys_prop: permission denied uid:1000  name:debug.hwui.overdraw
      
      Bug: 12037026
      Change-Id: I5e879ab339e68e9e4715266fc8a698ab6ad5756e
      3e78000e
    • Stephen Smalley's avatar
      Allow untrusted apps to execute binaries from their sandbox directories. · 65317124
      Stephen Smalley authored
      
      Various third party apps come with their own binaries that they write out to
      their sandbox directories and then execute, e.g.:
      audit(1386527439.462:190): avc:  denied  { execute_no_trans } for  pid=1550 comm="Thread-79" path="/data/data/com.cisco.anyconnect.vpn.android.avf/app_bin/busybox" dev="mmcblk0p23" ino=602891 scontext=u:r:untrusted_app:s0:c39,c256 tcontext=u:object_r:app_data_file:s0:c39,c256 tclass=file
      
      While this is not ideal from a security POV, it seems necessary to support for
      compatibility with Android today.
      
      Split out the execute-related permissions to a separate allow rule as it
      only makes sense for regular files (class file) not other kinds of files
      (e.g. fifos, sockets, symlinks), and use the rx_file_perms macro.
      
      Move the rule to untrusted_app only so that we do not permit system apps
      to execute files written by untrusted apps.
      
      Change-Id: Ic9bfe80e9b14f2c0be14295c70f23f09691ae66c
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      65317124
    • Stephen Smalley's avatar
      Make the runas domain enforcing. · 27daf189
      Stephen Smalley authored
      
      Change-Id: I4b3dda1d08e8bfc523493f4b8d79a4cc3e7e7787
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      27daf189
  9. Dec 10, 2013
  10. Dec 09, 2013
  11. Dec 06, 2013
    • Nick Kralevich's avatar
      Allow app-app communication via pipes · 82fc3b52
      Nick Kralevich authored
      Allow apps to communicate with each other via pipes.
      In particular, this fixes a bug where printing from Chrome wasn't
      working.
      
        STEPS TO REPRODUCE:
        1. Launch Chrome
        2. From menu tap print and observe
              OR
        1. Launch Drive, Select any file (*.txt, *.doc. *.pdf.........)
        2. Select print
      
      Addresses the following denials:
      
      <5>[  122.352797] type=1400 audit(1386363998.374:18): avc:  denied  { write } for  pid=3786 comm=4173796E635461736B202332 path="pipe:[19164]" dev="pipefs" ino=19164 scontext=u:r:untrusted_app:s0 tcontext=u:r:release_app:s0 tclass=fifo_file
      <5>[  123.248363] type=1400 audit(1386363999.264:19): avc:  denied  { getattr } for  pid=2677 comm=".android.chrome" path="pipe:[19164]" dev="pipefs" ino=19164 scontext=u:r:untrusted_app:s0 tcontext=u:r:release_app:s0 tclass=fifo_file
      <5>[  123.248620] type=1400 audit(1386363999.264:20): avc:  denied  { write } for  pid=3308 comm="ChildProcessMai" path="pipe:[19164]" dev="pipefs" ino=19164 scontext=u:r:isolated_app:s0 tcontext=u:r:release_app:s0 tclass=fifo_file
      
      Bug: 12032455
      Change-Id: Ic1cb5c1d42596f5a8fc3fe82fcbfe47aa43a7d6c
      82fc3b52
    • Nick Kralevich's avatar
      Merge "Make debuggerd enforcing." · 49db2680
      Nick Kralevich authored
      49db2680
    • Stephen Smalley's avatar
      am fea6e66f: Allow kernel domain, not init domain, to set SELinux enforcing mode. · 2c55c539
      Stephen Smalley authored
      * commit 'fea6e66f':
        Allow kernel domain, not init domain, to set SELinux enforcing mode.
      2c55c539
    • Stephen Smalley's avatar
      Allow kernel domain, not init domain, to set SELinux enforcing mode. · fea6e66f
      Stephen Smalley authored
      As per the discussion in:
      https://android-review.googlesource.com/#/c/71184/
      
      
      
      init sets the enforcing mode in its code prior to switching to
      the init domain via a setcon command in the init.rc file.  Hence,
      the setenforce permission is checked while still running in the
      kernel domain.  Further, as init has no reason to ever set the
      enforcing mode again, we do not need to allow setenforce to the
      init domain and this prevents reverting to permissive
      mode via an errant write by init later.  We could technically
      dontaudit the kernel setenforce access instead since the first
      call to setenforce happens while still permissive (and thus we
      never need to allow it in policy) but we allow it to more accurately
      represent what is possible.
      
      Change-Id: I70b5e6d8c99e0566145b9c8df863cc8a34019284
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      fea6e66f
    • Nick Kralevich's avatar
      am 9e8b8d9f: Revert "Allow kernel domain, not init domain, to set SELinux enforcing mode." · a6c9cdff
      Nick Kralevich authored
      * commit '9e8b8d9f':
        Revert "Allow kernel domain, not init domain, to set SELinux enforcing mode."
      a6c9cdff
    • Nick Kralevich's avatar
      Revert "Allow kernel domain, not init domain, to set SELinux enforcing mode." · 9e8b8d9f
      Nick Kralevich authored
      The build is broken. Reverting temporarily to fix breakage.
      
      libsepol.check_assertion_helper: neverallow on line 4758 violated by allow init kernel:security { setenforce };
      Error while expanding policy
      make: *** [out/target/product/mako/obj/ETC/sepolicy_intermediates/sepolicy] Error 1
      make: *** Waiting for unfinished jobs....
      
      
      This reverts commit bf12e225.
      
      Change-Id: I78a05756d8ce3c7d06e1d9d27e6135f4b352bb85
      9e8b8d9f
    • Stephen Smalley's avatar
      am bf12e225: Allow kernel domain, not init domain, to set SELinux enforcing mode. · 6c8cbac3
      Stephen Smalley authored
      * commit 'bf12e225':
        Allow kernel domain, not init domain, to set SELinux enforcing mode.
      6c8cbac3
    • Stephen Smalley's avatar
      Allow kernel domain, not init domain, to set SELinux enforcing mode. · bf12e225
      Stephen Smalley authored
      As per the discussion in:
      https://android-review.googlesource.com/#/c/71184/
      
      
      
      init sets the enforcing mode in its code prior to switching to
      the init domain via a setcon command in the init.rc file.  Hence,
      the setenforce permission is checked while still running in the
      kernel domain.  Further, as init has no reason to ever set the
      enforcing mode again, we do not need to allow setenforce to the
      init domain and this prevents reverting to permissive
      mode via an errant write by init later.  We could technically
      dontaudit the kernel setenforce access instead since the first
      call to setenforce happens while still permissive (and thus we
      never need to allow it in policy) but we allow it to more accurately
      represent what is possible.
      
      Change-Id: I617876c479666a03167b8fce270c82a8d45c7cc6
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      bf12e225
Loading