Skip to content
Snippets Groups Projects
  1. May 07, 2015
    • William Roberts's avatar
      Replace unix_socket_connect() and explicit property sets with macro · 625a3526
      William Roberts authored
      
      A common source of mistakes when authoring sepolicy is properly
      setting up property sets. This is a 3 part step of:
      1. Allowing the unix domain connection to the init/property service
      2. Allowing write on the property_socket file
      3. Allowing the set on class property_service
      
      The macro unix_socket_connect() handled 1 and 2, but could be
      confusing for first time policy authors. 3 had to be explicitly
      added.
      
      To correct this, we introduce a new macros:
      set_prop(sourcedomain, targetprop)
      
      This macro handles steps 1, 2 and 3.
      
      No difference in sediff is expected.
      
      Change-Id: I630ba0178439c935d08062892990d43a3cc1239e
      Signed-off-by: default avatarWilliam Roberts <william.c.roberts@linux.intel.com>
      625a3526
  2. Apr 09, 2015
    • dcashman's avatar
      Enforce more specific service access. · bd7f5803
      dcashman authored
      Move the remaining services from tmp_system_server_service to appropriate
      attributes and remove tmp_system_server and associated logging:
      
      registry
      restrictions
      rttmanager
      scheduling_policy
      search
      sensorservice
      serial
      servicediscovery
      statusbar
      task
      textservices
      telecom_service
      trust_service
      uimode
      updatelock
      usagestats
      usb
      user
      vibrator
      voiceinteraction
      wallpaper
      webviewupdate
      wifip2p
      wifi
      window
      
      Bug: 18106000
      Change-Id: Ia0a6d47099d82c53ba403af394537db6fbc71ca0
      bd7f5803
  3. Apr 08, 2015
    • dcashman's avatar
      Enforce more specific service access. · 03a6f64f
      dcashman authored
      Move the following services from tmp_system_server_service to appropriate
      attributes:
      
      network_management
      network_score
      notification
      package
      permission
      persistent
      power
      print
      processinfo
      procstats
      
      Bug: 18106000
      Change-Id: I9dfb41fa41cde72ef0059668410a2e9eb1af491c
      03a6f64f
  4. Apr 06, 2015
    • dcashman's avatar
      Assign app_api_service attribute to services. · 4cdea7fc
      dcashman authored
      Assign the alarm, appwidget, assetatlas, audio, backup and batterystats services
      the appropriate service access levels and move into enforcing.
      
      Bug: 18106000
      Change-Id: If3210bb25f3076edfdb6eec36ef6521ace1bd8d7
      4cdea7fc
  5. Apr 03, 2015
    • dcashman's avatar
      Assign app_api_service attribute to services. · b075338d
      dcashman authored
      Move accessibility, account, appops and activity services into enforcing with
      app_api_service level of access, with additional grants to mediaserver and
      isolated app.
      
      Bug: 18106000
      Change-Id: I1d5a79b9223026415f1690e8e9325ec4c270e3dd
      b075338d
    • dcashman's avatar
      Add system_api_service and app_api_service attributes. · d12993f0
      dcashman authored
      System services differ in designed access level.  Add attributes reflecting this
      distinction and label services appropriately.  Begin moving access to the newly
      labeled services by removing them from tmp_system_server_service into the newly
      made system_server_service attribute.  Reflect the move of system_server_service
      from a type to an attribute by removing access to system_server_service where
      appropriate.
      
      Change-Id: I7fd06823328daaea6d6f96e4d6bd00332382230b
      d12993f0
  6. Apr 01, 2015
    • dcashman's avatar
      Record observed service accesses. · 8af4e9cb
      dcashman authored
      Get ready to switch system_server service lookups into enforcing.
      
      Bug: 18106000
      Change-Id: Iefd4b2eee6cdd680f5ab423d15cc72a2a30e27cf
      8af4e9cb
  7. Mar 03, 2015
    • dcashman's avatar
      Record observed system_server servicemanager service requests. · 23f33615
      dcashman authored
      Also formally allow dumpstate access to all services and grant system_server
      access to address the following non-system_server_service entries:
      
      avc:  granted  { find } for service=drm.drmManager scontext=u:r:system_server:s0 tcontext=u:object_r:drmserver_service:s0 tclass=service_manager
      avc:  granted  { find } for service=nfc scontext=u:r:system_server:s0 tcontext=u:object_r:nfc_service:s0 tclass=service_manager
      
      Bug: 18106000
      Change-Id: Iad16b36acf44bce52c4824f8b53c0e7731c25602
      23f33615
  8. Feb 25, 2015
    • Nick Kralevich's avatar
      Revert /proc/net related changes · 5cf3994d
      Nick Kralevich authored
      Revert the tightening of /proc/net access. These changes
      are causing a lot of denials, and I want additional time to
      figure out a better solution.
      
      Addresses the following denials (and many more):
      
        avc: denied { read } for comm="SyncAdapterThre" name="stats" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="facebook.katana" name="iface_stat_fmt" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="IntentService[C" name="if_inet6" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
        avc: denied { read } for comm="dumpstate" name="iface_stat_all" dev="proc" ino=X scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file
      
      This reverts commit 0f0324cc
      and commit 99940d1a
      
      Bug: 9496886
      Bug: 19034637
      Change-Id: I436a6e3638ac9ed49afbee214e752fe2b0112868
      5cf3994d
  9. Jan 14, 2015
    • Nick Kralevich's avatar
      remove /proc/net read access from domain.te · 99940d1a
      Nick Kralevich authored
      SELinux domains wanting read access to /proc/net need to
      explicitly declare it.
      
      TODO: fixup the ListeningPortsTest cts test so that it's not
      broken.
      
      Bug: 9496886
      Change-Id: Ia9f1214348ac4051542daa661d35950eb271b2e4
      99940d1a
    • dcashman's avatar
      Make system_server_service an attribute. · 4a89cdfa
      dcashman authored
      Temporarily give every system_server_service its own
      domain in preparation for splitting it and identifying
      special services or classes of services.
      
      Change-Id: I81ffbdbf5eea05e0146fd7fd245f01639b1ae0ef
      4a89cdfa
  10. 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
  11. Oct 10, 2014
    • Nick Kralevich's avatar
      allow oemfs:dir search · ebfd9f87
      Nick Kralevich authored
      mediaserver and drmserver both have permission to read oemfs
      related files. However, there are no search permissions on the
      directory, so the files would be unreachable.
      
      Grant search permissions on the oemfs directory, so that the files
      within that directory can be read.
      
      Bug: 17954291
      Change-Id: I9e36dc7b940bd46774753c1fa07b0f47c36ff0db
      ebfd9f87
  12. Sep 17, 2014
  13. Sep 16, 2014
  14. 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
  15. Jul 24, 2014
  16. Jul 18, 2014
  17. Jul 15, 2014
    • Riley Spahn's avatar
      Add access control for each service_manager action. · 344fc109
      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.
      
      (cherry picked from commit b8511e0d)
      
      Change-Id: I980d4a8acf6a0c6e99a3a7905961eb5564b1be15
      344fc109
  18. 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
  19. Jun 12, 2014
  20. May 14, 2014
  21. May 13, 2014
  22. May 10, 2014
  23. May 07, 2014
  24. Mar 27, 2014
    • Stephen Smalley's avatar
      Allow reading of radio data files passed over binder. · 3fbc536d
      Stephen Smalley authored
      
      Addresses denials such as:
       avc:  denied  { read } for  pid=5114 comm="le.android.talk" path="/data/data/com.android.providers.telephony/app_parts/PART_1394223232515_recording88476874.amr" dev="mmcblk0p23" ino=64522 scontext=u:r:mediaserver:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
       avc:  denied  { getattr } for  pid=29199 comm="Binder_4" path="/data/data/com.android.providers.telephony/app_parts/PART_1394223232515_recording88476874.amr" dev="mmcblk0p23" ino=64522 scontext=u:r:mediaserver:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
       avc:  denied  { read } for  pid=29199 comm="Binder_4" path="/data/data/com.android.providers.telephony/app_parts/PART_1394223232515_recording88476874.amr" dev="mmcblk0p23" ino=64522 scontext=u:r:drmserver:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
       avc:  denied  { getattr } for  pid=9338 comm="MediaLoader" path="/data/data/com.android.providers.telephony/app_parts/PART_1394848620510_image.jpg" dev="mmcblk0p28" ino=287374 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
       avc:  denied  { read } for  pid=9896 comm="Binder_7" path="/data/data/com.android.providers.telephony/app_parts/PART_1394594346187_image.jpg" dev="mmcblk0p28" ino=287522 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
      
      This does not allow write denials such as:
       avc:  denied  { write } for  pid=1728 comm="Binder_4" path="/data/data/com.android.providers.telephony/app_parts/PART_1394818738798_image.jpg" dev="mmcblk0p28" ino=82279 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:radio_data_file:s0 tclass=file
      
      Need to understand whether write access is in fact required.
      
      Change-Id: I7693d16cb4f9855909d790d3f16f8bf281764468
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      3fbc536d
  25. Mar 15, 2014
    • Stephen Smalley's avatar
      Allow drmserver and mediaserver to read apk files. · 721f1adf
      Stephen Smalley authored
      
      Required to support passing resources via open apk files over Binder.
      Resolves denials such as:
       avc:  denied  { read } for  pid=31457 comm="SoundPoolThread" path="/mnt/asec/au.com.shiftyjelly.pocketcasts-1/pkg.apk" dev="dm-10" ino=12 scontext=u:r:mediaserver:s0 tcontext=u:object_r:asec_apk_file:s0 tclass=file
       avc:  denied  { read } for  pid=31439 comm="Binder_2" path="/mnt/asec/au.com.shiftyjelly.pocketcasts-1/pkg.apk" dev="dm-10" ino=12 scontext=u:r:drmserver:s0 tcontext=u:object_r:asec_apk_file:s0 tclass=file
      
      We do not allow open as it is not required (i.e. the files
      are passed as open files over Binder or local socket and opened by the
      client).
      
      Change-Id: Ib0941df1e9aac8d20621a356d2d212b98471abbc
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      721f1adf
  26. Mar 13, 2014
    • Stephen Smalley's avatar
      Get rid of separate platform_app_data_file type. · dc88dca1
      Stephen Smalley authored
      
      The original concept was to allow separation between /data/data/<pkgdir>
      files of "platform" apps (signed by one of the four build keys) and
      untrusted apps.  But we had to allow read/write to support passing of
      open files via Binder or local socket for compatibilty, and it seems
      that direct open by pathname is in fact used in Android as well,
      only passing the pathname via Binder or local socket.  So there is no
      real benefit to keeping it as a separate type.
      
      Retain a type alias for platform_app_data_file to app_data_file until
      restorecon /data/data support is in place to provide compatibility.
      
      Change-Id: Ic15066f48765322ad40500b2ba2801bb3ced5489
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      dc88dca1
  27. Mar 06, 2014
    • Stephen Smalley's avatar
      Allow mediaserver to connect to tee service. · ba745673
      Stephen Smalley authored
      
      Resolves denials such as:
      
      avc:  denied  { connectto } for  pid=7028 comm="wfd_looper" path=006D636461656D6F6E scontext=u:r:mediaserver:s0 tcontext=u:r:tee:s0 tclass=unix_stream_socket
      
      This is a socket in the abstract namespace so no socket file is involved.
      
      Change-Id: Ia0e384c08063466cfd0f17af3bccf294c7f9dbbd
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      ba745673
  28. Mar 03, 2014
  29. Feb 25, 2014
  30. Feb 11, 2014
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. Jan 07, 2014
    • Nick Kralevich's avatar
      fix mediaserver selinux denials. · 740ce654
      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
      740ce654
Loading