Skip to content
Snippets Groups Projects
  1. Feb 06, 2014
    • rpcraig's avatar
      Address screenrecord denials. · e21871c8
      rpcraig authored
      
      Steps to reproduce across devices.
        adb shell screenrecord --bit-rate 8000000 --time-limit 10 /data/local/tmp/test.mp4
      
      * Allow surfaceflinger to talk to mediaserver
         avc:  denied  { call } for  pid=122 comm="surfaceflinger" scontext=u:r:surfaceflinger:s0 tcontext=u:r:mediaserver:s0 tclass=binder
      
      * Give mediaserver access to gpu_device
         avc:  denied  { read write } for  pid=2793 comm="VideoEncMsgThre" name="kgsl-3d0" dev="tmpfs" ino=6556 scontext=u:r:mediaserver:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
         avc:  denied  { open } for  pid=2793 comm="VideoEncMsgThre" name="kgsl-3d0" dev="tmpfs" ino=6556 scontext=u:r:mediaserver:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
         avc:  denied  { ioctl } for  pid=2793 comm="VideoEncMsgThre" path="/dev/kgsl-3d0" dev="tmpfs" ino=6556 scontext=u:r:mediaserver:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file
      
      Change-Id: Id1812ec95662f4b2433e2989f5fccce6a85c3a41
      Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
      e21871c8
  2. Jan 21, 2014
    • rpcraig's avatar
      Allow mediaserver to create dirs under /data/mediadrm. · 129f8df9
      rpcraig authored
      
      Addresses the following denial.
        avc:  denied  { create } for  pid=605 comm="Binder_2" name="IDM1013" scontext=u:r:mediaserver:s0 tcontext=u:object_r:media_data_file:s0 tclass=dir
      
      Witnessed denial on grouper. Policy change
      seems appropriate for core policy though. To
      reproduce:
      * erase data partition or just delete all dirs
        under /data/mediadrm
      * start netflix app and watch a movie
      
      Change-Id: I515a195d45223249847fae70dc2ea9c9b216042f
      Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
      129f8df9
  3. Jan 16, 2014
    • Stephen Smalley's avatar
      Allow mediaserver to connect to bluetooth. · 09f6a99b
      Stephen Smalley authored
      
      Re-purpose the existing bluetooth_socket type, originally
      for /dev/socket/bluetooth used by bluetoothd in the old
      bluetooth stack, for sockets created by bluedroid under
      /data/misc/bluedroid, and allow mediaserver to connect
      to such sockets.  This is required for playing audio
      on paired BT devices.
      
      Based on b/12417855.
      
      Change-Id: I24ecdf407d066e7c4939ed2a0edb97222a1879f6
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      09f6a99b
  4. Jan 11, 2014
    • Nick Kralevich's avatar
      Support forcing permissive domains to unconfined. · 623975fa
      Nick Kralevich authored
      Permissive domains are only intended for development.
      When a device launches, we want to ensure that all
      permissive domains are in, at a minimum, unconfined+enforcing.
      
      Add FORCE_PERMISSIVE_TO_UNCONFINED to Android.mk. During
      development, this flag is false, and permissive domains
      are allowed. When SELinux new feature development has been
      frozen immediately before release, this flag will be flipped
      to true. Any previously permissive domains will move into
      unconfined+enforcing.
      
      This will ensure that all SELinux domains have at least a
      minimal level of protection.
      
      Unconditionally enable this flag for all user builds.
      
      Change-Id: I1632f0da0022c80170d8eb57c82499ac13fd7858
      623975fa
  5. Jan 08, 2014
    • 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
  6. Jan 07, 2014
  7. Jan 06, 2014
    • 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
  8. Dec 06, 2013
  9. Nov 12, 2013
    • Stephen Smalley's avatar
      Rename camera_calibration_file and audio_firmware_file. · 8510d31e
      Stephen Smalley authored
      
      Use more general type names for the contents of /data/misc/camera and
      /data/misc/audio.  These were the names used in our policy until 4.3
      was released, at which point we switched to be consistent with AOSP.
      However, the Galaxy S4 4.2.2 image, Galaxy S4 4.3 image, and
      Galaxy Note 3 4.3 image all shipped with policies using _data_file names
      because they were based on our older policy.  So we may as well switch
      AOSP to these names.
      
      Not sure if in fact these could be all coalesced to the new media_data_file
      type for /data/misc/media introduced by
      Ic374488f8b62bd4f8b3c90f30da0e8d1ed1a7343.
      
      Options to fix already existing devices, which would only apply
      to Nexus devices with 4.3 or 4.4 at this point:
      1) Add restorecon_recursive /data/misc/audio /data/misc/camera to either
      the system/core init.rc or to the device-specific init.*.rc files.
      -or-
      2) Add a typealias declaration in the policy to remap the old type names.
      to the new ones.  Then existing types on persistent storage will be
      remapped internally to the new ones.
      -or-
      3) Some sort of relabeld.
      
      Option #2 is implemented by this change.
      
      Change-Id: Id36203f5bb66b5200efc1205630b5b260ef97496
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      8510d31e
  10. Nov 08, 2013
    • Stephen Smalley's avatar
      Label /data/misc/media and allow mediaserver access to it. · a7716718
      Stephen Smalley authored
      
      Otherwise we get denials like these on 4.4:
      
      type=1400 audit(1383590170.360:29): avc:  denied  { write } for  pid=61 comm="mediaserver" name="media" dev="mtdblock1" ino=6416 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
      type=1400 audit(1383590170.360:29): avc:  denied  { add_name } for  pid=61 comm="mediaserver" name="emulator.camera.hotplug.0" scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
      type=1400 audit(1383590170.360:29): avc:  denied  { create } for  pid=61 comm="mediaserver" name="emulator.camera.hotplug.0" scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
      type=1400 audit(1383590170.360:29): avc:  denied  { write open } for  pid=61 comm="mediaserver" name="emulator.camera.hotplug.0" dev="mtdblock1" ino=6431 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
      type=1400 audit(1383590255.100:231): avc:  denied  { write } for  pid=832 comm="mediaserver" name="emulator.camera.hotplug.0" dev="mtdblock1" ino=6431 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
      type=1400 audit(1383590255.100:231): avc:  denied  { open } for  pid=832 comm="mediaserver" name="emulator.camera.hotplug.0" dev="mtdblock1" ino=6431 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
      
      Change-Id: Ic374488f8b62bd4f8b3c90f30da0e8d1ed1a7343
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      a7716718
  11. Nov 06, 2013
  12. Oct 23, 2013
  13. 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
  14. May 20, 2013
    • repo sync's avatar
      Make all domains unconfined. · 77d4731e
      repo sync authored
      This prevents denials from being generated by the base policy.
      Over time, these rules will be incrementally tightened to improve
      security.
      
      Change-Id: I4be1c987a5d69ac784a56d42fc2c9063c402de11
      77d4731e
  15. May 15, 2013
  16. Mar 27, 2013
  17. Mar 22, 2013
  18. Mar 19, 2013
    • Stephen Smalley's avatar
      Update binder-related policy. · 9ce99e39
      Stephen Smalley authored
      
      The binder_transfer_binder hook was changed in the kernel, obsoleting
      the receive permission and changing the target of the transfer permission.
      Update the binder-related policy to match the revised permission checking.
      
      Change-Id: I1ed0dadfde2efa93296e967eb44ca1314cf28586
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      9ce99e39
  19. Nov 28, 2012
  20. Sep 13, 2012
  21. Aug 13, 2012
  22. Aug 10, 2012
  23. Jul 27, 2012
  24. Jul 24, 2012
  25. Jul 19, 2012
    • hqjiang's avatar
      Target the denials/policies over qtaguid file and device: 1. Relabel... · 4c06d273
      hqjiang authored
      Target the denials/policies over qtaguid file and device: 1. Relabel /proc/net/xt_qtaguid/ctrl from "qtaguid" to "qtaguid_proc"; 2. Label /dev/xt_qtaguid with "qtaguid_device"; 3. Allow mediaserver read/[write] to qtaguid_proc and qtaguid_device; 4. Allow media apps read/[write] to qtaguid_proc and qtaguid_device; 5. Allow system read/[write] to qtaguid_proc and qtaguid_device.
      
      Actually, some of policies related to qtaguid have been there already, but
      we refind existing ones and add new ones.
      4c06d273
    • hqjiang's avatar
      allow camera calibration · 20d6963a
      hqjiang authored
      20d6963a
  26. Jul 12, 2012
  27. Jun 20, 2012
  28. Jan 04, 2012
Loading