Skip to content
Snippets Groups Projects
  1. Jan 10, 2014
  2. Jan 09, 2014
  3. Jan 08, 2014
    • Nick Kralevich's avatar
    • Nick Kralevich's avatar
      Allow keystore to talk to the tee · b23d2876
      Nick Kralevich authored
      On manta, the keystore CTS tests are failing, because
      keystore isn't allowed to talk to the tee. Allow it.
      
      I've only seen this bug on manta, but it seems appropriate
      for all domains.
      
      Fixes the following denial:
      
      <5>[  286.249563] type=1400 audit(1389210059.924:6): avc:  denied  { connectto } for  pid=126 comm="keystore" path=006D636461656D6F6E scontext=u:r:keystore:s0 tcontext=u:r:tee:s0 tclass=unix_stream_socket
      
      Bug: 12450710
      Change-Id: I07133d9abeaf967392118ba478a5a391cf0c5fa5
      b23d2876
    • Nick Kralevich's avatar
      address denials when playing protected content. · e45603d3
      Nick Kralevich authored
      When playing protected content on manta, surfaceflinger would crash.
      
        STEPS TO REPRODUCE:
        1. Launch Play Movies & TV
        2. Play any movie and observe
      
        OBSERVED RESULTS:
        Device reboot while playing movies
      
        EXPECTED RESULTS:
        No device reboot
      
      Even though this only reproduces on manta, this seems appropriate
      for a general policy.
      
      Addresses the following denials:
      
      <5>[   36.066819] type=1400 audit(1389141624.471:9): avc:  denied  { write } for  pid=1855 comm="TimedEventQueue" name="tlcd_sock" dev="mmcblk0p9" ino=627097 scontext=u:r:mediaserver:s0 tcontext=u:object_r:drmserver_socket:s0 tclass=sock_file
      <5>[   36.066985] type=1400 audit(1389141624.471:10): avc:  denied  { connectto } for  pid=1855 comm="TimedEventQueue" path="/data/app/tlcd_sock" scontext=u:r:mediaserver:s0 tcontext=u:r:drmserver:s0 tclass=unix_stream_socket
      <5>[   41.379708] type=1400 audit(1389141629.786:15): avc:  denied  { connectto } for  pid=120 comm="surfaceflinger" path=006D636461656D6F6E scontext=u:r:surfaceflinger:s0 tcontext=u:r:tee:s0 tclass=unix_stream_socket
      <5>[   41.380051] type=1400 audit(1389141629.786:16): avc:  denied  { read write } for  pid=120 comm="surfaceflinger" name="mobicore-user" dev="tmpfs" ino=4117 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:tee_device:s0 tclass=chr_file
      <5>[   41.380209] type=1400 audit(1389141629.786:17): avc:  denied  { open } for  pid=120 comm="surfaceflinger" name="mobicore-user" dev="tmpfs" ino=4117 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:tee_device:s0 tclass=chr_file
      <5>[   41.380779] type=1400 audit(1389141629.786:18): avc:  denied  { ioctl } for  pid=120 comm="surfaceflinger" path="/dev/mobicore-user" dev="tmpfs" ino=4117 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:tee_device:s0 tclass=chr_file
      
      Change-Id: I20286ec2a6cf0d190a84ad74e88e94468bab9fdb
      Bug: 12434847
      e45603d3
    • rpcraig's avatar
      Apply a label to /data/mediadrm files. · d362cdf8
      rpcraig authored
      
      /data/mediadrm is appearing on devices but is
      receiving the system_data_file type. Use the
      media_data_file label to help classify these files.
      This new label will help with the following denials.
      with exisiting allow rules for mediaserver are already
      in place.
      
      type=1400 msg=audit(1389139139.551:308): avc:  denied  { open } for  pid=179 comm="mediaserver" name="ay64.dat" dev="mmcblk0p23" ino=136819 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
      type=1400 msg=audit(1389139140.783:309): avc:  denied  { read } for  pid=179 comm="mediaserver" name="IDM1013" dev="mmcblk0p23" ino=136818 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
      type=1400 msg=audit(1389139140.783:310): avc:  denied  { open } for  pid=179 comm="mediaserver" name="IDM1013" dev="mmcblk0p23" ino=136818 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
      
      Change-Id: I84ac78517fdbb0264cf07379120a62675505fc95
      Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
      d362cdf8
    • Nick Kralevich's avatar
      84a81d1e
    • Stephen Smalley's avatar
      Strip file execute permissions from unconfined domains. · 5da08810
      Stephen Smalley authored
      
      Exclude execute from the rules allowing access to files,
      and only add it back for the rootfs and files labeled
      with system_file (/system, /vendor) or one of the types in exec_type
      (files under /system that cause domain transitions).
      
      Change-Id: Ic72d76dc92e79bcc75a38398425af3bb1274a009
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      5da08810
    • Stephen Smalley's avatar
      Drop extra _system_file types. · c0493c8d
      Stephen Smalley authored
      
      They serve no purpose; these directories/files are normally accessible
      in the same way as the rest of /system.  Also one of them has the wrong
      attributes (data_file_type), thereby making it writable by some domains,
      and under current policy, shell and apps cannot do ls -l /etc/ppp /etc/dhcpcd.
      
      Change-Id: I0c1baa434fe78373684f4eaab40a41fddf2bdd79
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      c0493c8d
    • Stephen Smalley's avatar
      Strip exec* permissions from unconfined domains. · 4e416ea4
      Stephen Smalley authored
      
      This ensures that only domains that are explicitly allowed executable
      memory permissions are granted them.
      
      Unconfined domains retain full write + execute access to all file
      types.  A further change could possibly restrict execute access to
      a subset of file types, e.g. system_file + exec_type.
      
      Change-Id: I842f5a2ac5921cc2bd0ab23a091eb808fdd89565
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      4e416ea4
    • Stephen Smalley's avatar
      Restrict ability to set checkreqprot. · 8b51674b
      Stephen Smalley authored
      
      Now that we set /sys/fs/selinux/checkreqprot via init.rc,
      restrict the ability to set it to only the kernel domain.
      
      Change-Id: I975061fd0e69c158db9bdb23e6ba77948e3fead1
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      8b51674b
    • Nick Kralevich's avatar
      fa4002fc
  4. Jan 07, 2014
    • Robert Craig's avatar
      Make /proc/net a proc_net type. · 1bf61c43
      Robert Craig authored
      
      Change-Id: Iaee5e09712e7f27e0adf645f18554bf2ebd4e448
      Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
      1bf61c43
    • Robert Craig's avatar
      Create proc_net type for /proc/sys/net entries. · 529fcbe0
      Robert Craig authored
      
      /proc/sys/net could use its own type to help distinguish
      among some of the proc access rules. Fix dhcp and netd
      because of this.
      
      Change-Id: I6e16cba660f07bc25f437bf43e1eba851a88d538
      Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
      529fcbe0
    • Nick Kralevich's avatar
      Merge "Remove ping domain." · 11c48d4c
      Nick Kralevich authored
      11c48d4c
    • Stephen Smalley's avatar
      Fix denials triggered by adb shell screencap. · a5066135
      Stephen Smalley authored
      
      Change-Id: Ief925f1f49a6579d5a7a1035f3732834238fa590
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      a5066135
    • Stephen Smalley's avatar
      Remove ping domain. · 396015c3
      Stephen Smalley authored
      
      ping in Android no longer requires any additional privileges beyond
      the caller.  Drop the ping domain and executable file type entirely.
      
      Also add net_domain() to shell domain so that it can create and
      use network sockets.
      
      Change-Id: If51734abe572aecf8f510f1a55782159222e5a67
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      396015c3
    • Nick Kralevich's avatar
      Revert "Make surfaceflinger domain enforcing." · 5f290264
      Nick Kralevich authored
      There are continued complaints about not being able to generate
      bug reports and surfaceflinger crashes. Move surfaceflinger
      out of enforcing until I can resolve this.
      
      Here are some denials I'm seeing. I'm not sure what binder service is
      running in the shell domain... Need to do more digging.
      
      nnk@nnk:~/Downloads$ grep "avc: " screenshot_runtime_restart.txt  | grep surfaceflinger
      <5>[    5.182699] type=1400 audit(1389111729.860:9): avc:  denied  { search } for  pid=186 comm="surfaceflinger" name="tmp" dev="mmcblk0p28" ino=627090 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir
      <5>[  744.988702] type=1400 audit(1389112469.578:188): avc:  denied  { call } for  pid=596 comm="Binder_3" scontext=u:r:surfaceflinger:s0 tcontext=u:r:shell:s0 tclass=binder
      
      This reverts commit a11c56e1.
      
      Bug: 12416329
      Change-Id: I7b72608c760c4087f73047ad751a5bd069fa2ec7
      5f290264
    • Nick Kralevich's avatar
      Revert "Make ping enforcing." · a6f88c73
      Nick Kralevich authored
      Causing adbd to run at 100% cpu utilization when the following
      sequence of commands are run:
      
      1) Run the command "adb shell ping -c 1 -w 5 www.google.com" for 5 times
      2) Run "adb shell top -m 5"
      
      The following denial occurs:
      
      <5>[   20.647559] type=1400 audit(1389054327.861:21): avc:  denied  { sigchld } for  pid=1989 comm="adbd" scontext=u:r:ping:s0 tcontext=u:r:adbd:s0 tclass=process
      
      Reverting for now.
      
      This reverts commit 1b556c32.
      
      Bug: 12251052
      Change-Id: I1b9920624f49b0aed2226c41a45005aff228d9e8
      a6f88c73
    • Nick Kralevich's avatar
      Revert "Make mediaserver enforcing." · b8ac06f3
      Nick Kralevich authored
      Too many bugs.
      
      This reverts commit cc964543.
      b8ac06f3
  5. Jan 06, 2014
    • Nick Kralevich's avatar
      surfaceflinger: fix bugreport screenshot functionality · 3d770d25
      Nick Kralevich authored
      When a bugreport is triggered using the device keys,
      it generates a screenshot and places it into
      /data/data/com.android.shell/files/bugreports. SELinux is denying
      those writes.
      
      Addresses the following denials:
      
      <5> type=1400 audit(1389047451.385:23): avc:  denied  { call } for  pid=267 comm="Binder_1" scontext=u:r:surfaceflinger:s0 tcontext=u:r:dumpstate:s0 tclass=binder
      <5> type=1400 audit(1389046083.780:37): avc:  denied  { write } for  pid=4191 comm="dumpsys" path="/data/data/com.android.shell/files/bugreports/bugreport-2014-01-06-14-07-35.txt.tmp" dev="mmcblk0p28" ino=81874 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file
      
      Bug: 12416329
      Change-Id: I318145591cda500094d98103d30b784df48a67be
      3d770d25
    • Nick Kralevich's avatar
      fix mediaserver selinux denials. · 37339c76
      Nick Kralevich authored
      mediaserver needs the ability to read media_rw_data_file files.
      Allow it. Similarly, this is also needed for drmserver. Addresses
      the following denials:
      
      <5>[   22.812859] type=1400 audit(1389041093.955:17): avc:  denied  { read } for  pid=1655 comm="MediaScannerSer" path="/data/media/0/DCIM/Camera/VID_20140106_124115.mp4" dev="mmcblk0p28" ino=122204 scontext=u:r:mediaserver:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file
      <5>[   22.813103] type=1400 audit(1389041093.955:18): avc:  denied  { getattr } for  pid=849 comm="Binder_2" path="/data/media/0/DCIM/Camera/VID_20140106_124115.mp4" dev="mmcblk0p28" ino=122204 scontext=u:r:mediaserver:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file
      <5>[   22.832041] type=1400 audit(1389041093.975:19): avc:  denied  { read } for  pid=849 comm="Binder_2" path="/data/media/0/DCIM/Camera/VID_20140106_124115.mp4" dev="mmcblk0p28" ino=122204 scontext=u:r:drmserver:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file
      <5>[   52.357470] type=1400 audit(1389041123.494:29): avc:  denied  { read } for  pid=2757 comm="ImageLoader" path="/data/media/0/DCIM/Camera/VID_20140106_124520.mp4" dev="mmcblk0p28" ino=122211 scontext=u:r:mediaserver:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file
      <5>[   52.357717] type=1400 audit(1389041123.494:30): avc:  denied  { getattr } for  pid=849 comm="Binder_2" path="/data/media/0/DCIM/Camera/VID_20140106_124520.mp4" dev="mmcblk0p28" ino=122211 scontext=u:r:mediaserver:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file
      <5>[   52.382276] type=1400 audit(1389041123.524:31): avc:  denied  { read } for  pid=849 comm="Binder_2" path="/data/media/0/DCIM/Camera/VID_20140106_124520.mp4" dev="mmcblk0p28" ino=122211 scontext=u:r:drmserver:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file
      
      Allow anyone who has access to video_device:chr_file to also
      have read access to video_device:dir. Otherwise, the
      chracter devices may not be reachable.
      
      Bug: 12416198
      Change-Id: I649cd52ec7f1a25afb3aea479482e3f270bfe074
      37339c76
    • Nick Kralevich's avatar
      a4e28f2e
Loading