Skip to content
Snippets Groups Projects
  1. Jun 08, 2017
  2. Jun 06, 2017
    • Jeff Vander Stoep's avatar
      Move sysfs cpu hotplug labeling to genfs_contexts · e5fe6a33
      Jeff Vander Stoep authored
      On Marlin ~120 ms of time is spent relabeling /sys/devices/system/cpu
      every time we come out of suspend. Moving from file_contexts to
      genfs_contexts as the labeling mechanism knocks this down to ~3 ms.
      
      Bug: 32938130
      Test: build and boot Marlin. Verify that files in
          /sys/devices/system/cpu have the proper label before and after
          suspend.
      
      Change-Id: Ie71ea7e3dd5df250cabe4ba9600afbf67e69f720
      e5fe6a33
    • Jeff Vander Stoep's avatar
      Move sysfs cpu hotplug labeling to genfs_contexts · f85be7f8
      Jeff Vander Stoep authored
      On Marlin ~120 ms of time is spent relabeling /sys/devices/system/cpu
      every time we come out of suspend. Moving from file_contexts to
      genfs_contexts as the labeling mechanism knocks this down to ~3 ms.
      
      Bug: 32938130
      Test: build and boot Marlin. Verify that files in
          /sys/devices/system/cpu have the proper label before and after
          suspend.
      
      Change-Id: Ie71ea7e3dd5df250cabe4ba9600afbf67e69f720
      f85be7f8
  3. May 31, 2017
    • Narayan Kamath's avatar
      SEPolicy: Changes for new stack dumping scheme. · f194aad2
      Narayan Kamath authored
      Applications connect to tombstoned via a unix domain socket and request
      an open FD to which they can write their traces. This socket has a new
      label (tombstoned_java_trace_socket) and appdomain and system_server are
      given permissions to connect and write to it.
      
      Apps no longer need permissions to open files under /data/anr/ and
      these permissions will be withdrawn in a future change.
      
      Bug: 32064548
      Test: Manual
      
      (cherry picked from commit a8832dabc7f3b7b2381760d2b95f81abf78db709)
      
      (cherry picked from commit 11bfcc1e)
      
      Change-Id: Icc60d227331c8eee70a9389ff1e7e78772f37e6f
      f194aad2
    • Narayan Kamath's avatar
      SEPolicy: Changes for new stack dumping scheme. · e628cb5b
      Narayan Kamath authored
      Applications connect to tombstoned via a unix domain socket and request
      an open FD to which they can write their traces. This socket has a new
      label (tombstoned_java_trace_socket) and appdomain and system_server are
      given permissions to connect and write to it.
      
      Apps no longer need permissions to open files under /data/anr/ and
      these permissions will be withdrawn in a future change.
      
      Bug: 32064548
      Test: Manual
      
      Merged-In: I70a3e6e230268d12b454e849fa88418082269c4f
      Change-Id: Ib4b73fc130f4993c44d96c8d68f61b6d9bb2c7d5
      e628cb5b
  4. May 30, 2017
    • Narayan Kamath's avatar
      SEPolicy: Changes for new stack dumping scheme. · 11bfcc1e
      Narayan Kamath authored
      Applications connect to tombstoned via a unix domain socket and request
      an open FD to which they can write their traces. This socket has a new
      label (tombstoned_java_trace_socket) and appdomain and system_server are
      given permissions to connect and write to it.
      
      Apps no longer need permissions to open files under /data/anr/ and
      these permissions will be withdrawn in a future change.
      
      Bug: 32064548
      Test: Manual
      
      (cherry picked from commit a8832dabc7f3b7b2381760d2b95f81abf78db709)
      
      Change-Id: I70a3e6e230268d12b454e849fa88418082269c4f
      11bfcc1e
  5. May 26, 2017
  6. May 22, 2017
  7. May 19, 2017
  8. May 15, 2017
    • Alex Vakulenko's avatar
      SELinux policies for PDX services · c4055f0d
      Alex Vakulenko authored
      Specify per-service rules for PDX transport. Now being able to
      grant permissions to individual services provided by processes,
      not all services of a process.
      
      Also tighter control over which permissions are required for
      client and server for individual components of IPC (endpoints,
      channels, etc).
      
      Bug: 37646189
      Change-Id: I78eb8ae8b6e08105666445a66bfcbd2f1d69d0ea
      Merged-Id: I78eb8ae8b6e08105666445a66bfcbd2f1d69d0ea
      c4055f0d
  9. May 11, 2017
    • Luke Song's avatar
      Move sensord sepolicy · 2dd9ae33
      Luke Song authored
      Sensord move in ag/2106763 should be accompanied by corresponding
      sepolicy move of sensord-related files/declarations.
      
      Bug: 36996994
      Test: Sailfish build shows no related permission errors
      Change-Id: Ibe41b363f7ca2752b5d3e0961298985cf784663d
      2dd9ae33
    • Tom Cherry's avatar
      Revert "remove /dev/log" · 5dff1962
      Tom Cherry authored
      This reverts commit 8c60f74d.
      
      Bug: 38242876
      Change-Id: Iba5a94d16901dc0c52f1941972c26877baa4805c
      5dff1962
  10. May 10, 2017
    • Alex Vakulenko's avatar
      SELinux policies for PDX services · 41daa7f8
      Alex Vakulenko authored
      Specify per-service rules for PDX transport. Now being able to
      grant permissions to individual services provided by processes,
      not all services of a process.
      
      Also tighter control over which permissions are required for
      client and server for individual components of IPC (endpoints,
      channels, etc).
      
      Bug: 37646189
      Change-Id: I78eb8ae8b6e08105666445a66bfcbd2f1d69d0ea
      41daa7f8
  11. May 09, 2017
  12. Apr 27, 2017
  13. Apr 21, 2017
    • Daniel Nicoara's avatar
      Remove vr_wm service selinux policy · 0e43e4e6
      Daniel Nicoara authored
      vr_wm functionality is moved in VrCore, so remove this service.
      
      Bug: 37542947, 36506799
      Test: Ran on device and verified there are no permission errors while in
      VR
      Change-Id: I37fd34e96babec2a990600907f61da8c358ecc89
      0e43e4e6
  14. Apr 18, 2017
    • Carmen Jackson's avatar
      Add selinux rules for additional file contexts in userdebug · 25788df1
      Carmen Jackson authored
      These rules allow the additional tracepoints we need for running traceur
      in userdebug builds to be writeable.
      
      Bug: 37110010
      Test: I'm testing by running atrace -l and confirming that the
      tracepoints that I'm attempting to enable are available.
      
      Change-Id: Ia352100ed67819ae5acca2aad803fa392d8b80fd
      25788df1
  15. Apr 15, 2017
  16. Apr 14, 2017
  17. Apr 13, 2017
    • Sandeep Patil's avatar
      toolbox: add sepolicy for vendor toybox · 4fe441fb
      Sandeep Patil authored
      
      The vendor toybox MUST always be executed without transition and
      non-vendor processes are not allowed to execute the binary.
      
      Bug: 36463595
      Test: Boot and test if system shell can run /vendor/bin/echo
            Result: requires 'su'
      
      Change-Id: Ifb9aa61f247f91fb870b99d60ac7f849ee9c6adc
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      (cherry picked from commit c112cd18e8999c0242a2560219033231a0e19898)
      4fe441fb
    • Martijn Coenen's avatar
      Add hwservice_contexts and support for querying it. · 3ea47b92
      Martijn Coenen authored
      hwservicemanager can check hwservice_contexts files
      both from the framework and vendor partitions.
      
      Initially, have a wildcard '*' in hwservice_contexts
      that maps to a label that can be added/found from
      domain. This needs to be removed when the proper policy
      is in place.
      
      Also, grant su/shell access to hwservicemanager list
      operations, so tools like 'lshal' continue to work.
      
      Bug: 34454312
      Test: Marlin boots
      Change-Id: I3a02d97a82458692b528d85c1b8e78b6f82ea1bc
      3ea47b92
  18. Apr 12, 2017
    • Dan Cashman's avatar
      Change mapping file name to reflect its platform version. · 4f9a648e
      Dan Cashman authored
      As the platform progresses in the split SELinux world, the platform
      will need to maintain mapping files back to previous platform versions
      to maintain backwards compatibility with vendor images which have SELinux
      policy written based on the older versions.  This requires shipping multiple
      mapping files with the system image so that the right one can be selected.
      Change the name and location of the mapping file to reflect this.  Also add
      a file to the vendor partition indicating which version is being targeted that
      the platform can use to determine which mapping file to choose.
      
      Bug: 36783775
      Test: Force compilation of sepolicy on-device with mapping file changed
      to new location and name, using the value reported on /vendor.
      
      Change-Id: I93ab3e52c2c80c493719dc3825bc731867ea76d4
      4f9a648e
  19. Apr 11, 2017
    • Tom Cherry's avatar
      remove /dev/log · 8c60f74d
      Tom Cherry authored
      This was marked deprecated in 2014 and removed in 2015, let's remove
      the sepolicy now too.
      
      Test: see that logging still works on bullhead
      
      Change-Id: I4caa0dbf77956fcbc61a07897242b951c275b502
      8c60f74d
  20. Apr 10, 2017
    • Jiyong Park's avatar
      Rename vndk-stable to vndk-sp (SP=Same-process) · ba23c8fa
      Jiyong Park authored
      The concept of VNDK-stable set is gone because they no longer need to be
      stable across several Android releases. Instead, they are just small set
      of system libraries (other than Low-Level NDK) that can be used by
      same-process HALs. They need to be stable only during an Android release
      as other VNDK libraries. However, since they are eligible for double
      loading, we still need to distinguish those libs from other VNDK
      libraries. So we give them a name vndk-sp, which means VNDK designed for
      same-process HALs.
      
      Bug: 37139956
      Test: booting successful with vndk-sp libs in /vendor/lib(64)?/vndk-sp
      Change-Id: I892c4514deb3c6c8006e3659bed1ad3363420732
      ba23c8fa
  21. Apr 07, 2017
    • Jiyong Park's avatar
      sepolicy: allow access to vndk-stable libs · a4768fa8
      Jiyong Park authored
      Vndk-stable libs are system libs that are used by same process HALs.
      Since same process HALs can be loaded to any process, so are vndk-stable
      libs.
      
      Bug: 37138502
      Test: none, because the directory is currently empty and thus this is
      no-op. sailfish builds and boots.
      
      Change-Id: I67a2c8c2e4c3517aa30b4a97dc80dc2800e47b5a
      a4768fa8
  22. Apr 06, 2017
    • Josh Gao's avatar
      Add /dev/kmsg_debug. · a015186f
      Josh Gao authored
      Add /dev/kmsg_debug on userdebug devices, to allow crash_dump to log
      crashes to dmesg when logd isn't up yet (or is the one crashing).
      
      Bug: http://b/36574794
      Test: stop tombstoned; crasher; dmesg
      Change-Id: I249e11291c58fee77098dec3fd3271ea23363ac9
      a015186f
    • Dan Cashman's avatar
      Move mapping_sepolicy.cil to /system partition. · 0e9c47c0
      Dan Cashman authored
      This is a necessary first step to finalizing the SELinux policy build
      process.  The mapping_sepolicy.cil file is required to provide backward
      compatibility with the indicated vendor-targeted version.
      
      This still needs to be extended to provide N mapping files and corresponding
      SHA256 outputs, one for each of the N previous platform versions with which
      we're backward-compatible.
      
      Bug: 36783775
      Test: boot device with matching sha256 and non-matching and verify that
      device boots and uses either precompiled or compiled policy as needed. Also
      verify that mapping_sepolicy.cil has moved.
      
      Change-Id: I5692fb87c7ec0f3ae9ca611f76847ccff9182375
      0e9c47c0
    • Mark Salyzyn's avatar
      logcatd: introduce logcatd executable · 36f2eb20
      Mark Salyzyn authored
      logcatd is the same as logcat, except that the -L flag, if supplied,
      runs once, then the command re-runs itself without the -L flag with
      the same argument set.  By introducing a logcatd daemon executable
      we can solve the problem of the longish reads from pstore that
      sometimes occur when the system is excessively busy spinning in a
      foreground task starving this daemon as we absorb the delay in
      an init service, rather than in an init exec.  This would not have
      been efficiently possible without the introduction of liblogcat.
      
      Test: gTest logcat-unit-tests
      Test: Manual check logpersist operations
      Bug: 28788401
      Bug: 30041146
      Bug: 30612424
      Bug: 35326290
      Change-Id: I3454bad666c66663f59ae03bcd72e0fe8426bb0a
      36f2eb20
  23. Apr 05, 2017
    • Sandeep Patil's avatar
      sepolicy: relabel /vendor · 277a20eb
      Sandeep Patil authored
      
      The CL splits /vendor labeling from /system. Which was allowing all
      processes read, execute access to /vendor.
      
      Following directories will remain world readable
       /vendor/etc
       /vendor/lib(64)/hw/
      
      Following are currently world readable but their scope
      will be minimized to platform processes that require access
       /vendor/app
       /vendor/framework/
       /vendor/overlay
      
      Files labelled with 'same_process_hal_file' are allowed to be
      read + executed from by the world. This is for Same process HALs and
      their dependencies.
      
      Bug: 36527360
      Bug: 36832490
      Bug: 36681210
      Bug: 36680116
      Bug: 36690845
      Bug: 36697328
      Bug: 36696623
      Bug: 36806861
      Bug: 36656392
      Bug: 36696623
      Bug: 36792803
      
      All of the tests were done on sailfish, angler, bullhead, dragon
      Test: Boot and connect to wifi
      Test: Run chrome and load websites, play video in youtube, load maps w/
            current location, take pictures and record video in camera,
            playback recorded video.
      Test: Connect to BT headset and ensure BT audio playback works.
      Test: OTA sideload using recovery
      Test: CTS SELinuxHostTest pass
      
      Change-Id: I278435b72f7551a28f3c229f720ca608b77a7029
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      277a20eb
  24. Apr 04, 2017
  25. Apr 03, 2017
    • Martijn Coenen's avatar
      Add target for vndservice_contexts. · 6676c234
      Martijn Coenen authored
      So we can limit vndservicemanager access to
      just vndservice_contexts.
      
      Bug: 36052864
      Test: servicemanager,vndservicemanager work
      Change-Id: I7b132d4f616ba1edd0daf7be750d4b7174c4e188
      6676c234
    • Mark Salyzyn's avatar
      logcatd: introduce logcatd executable · 88cdd71d
      Mark Salyzyn authored
      logcatd is the same as logcat, except that the -L flag, if supplied,
      runs once, then the command re-runs itself without the -L flag with
      the same argument set.  By introducing a logcatd daemon executable
      we can solve the problem of the longish reads from pstore that
      sometimes occur when the system is excessively busy spinning in a
      foreground task starving this daemon as we absorb the delay in
      an init service, rather than in an init exec.  This would not have
      been efficiently possible without the introduction of liblogcat.
      
      Test: gTest logcat-unit-tests
      Test: Manual check logpersist operations
      Bug: 28788401
      Bug: 30041146
      Bug: 30612424
      Bug: 35326290
      Change-Id: I3454bad666c66663f59ae03bcd72e0fe8426bb0a
      88cdd71d
    • Alex Klyubin's avatar
      Move TEE rules to vendor image · 304d6536
      Alex Klyubin authored
      "tee" domain is a vendor domain. Hence its rules should live on the
      vendor image.
      
      What's left as public API is that:
      1. tee domain exists and that it is permitted to sys_rawio capability,
      2. tee_device type exists and apps are not permitted to access
         character devices labeled tee_device.
      
      If you were relying on system/sepolicy automatically labeling
      /dev/tf_driver as tee_device or labeling /system/bin/tf_daemon as
      tee_exec, then you need to add these rules to your device-specific
      file_contexts.
      
      Test: mmm system/sepolicy
      Test: bullhead, angler, and sailfish boot up without new denials
      Bug: 36714625
      Bug: 36714625
      Bug: 36720355
      Change-Id: Ie21619ff3c44ef58675c369061b4afdd7e8501c6
      304d6536
  26. Mar 31, 2017
    • Daniel Nicoara's avatar
      VR: Add sepolicy for VR HWC service · 6907e39a
      Daniel Nicoara authored
      VR HWC is being split out of VR Window Manager. It creates a HW binder
      interface used by SurfaceFlinger which implements the HWComposer HAL and
      a regular binder interface which will be used by a system app to receive
      the SurfaceFlinger output.
      
      Bug: b/36051907
      Test: Ran in permissive mode and ensured no permission errors show in
      logcat.
      
      Change-Id: If1360bc8fa339a80100124c4e89e69c64b29d2ae
      6907e39a
  27. Mar 29, 2017
    • Sandeep Patil's avatar
      mac_permissions: explicitly label all mac_permissions files · bb24f3ab
      Sandeep Patil authored
      
      *mac_permissions.xml files need to be explicitly labeled as they are now split
      cross system and vendor and won't have the generic world readable
      'system_file' or 'rootfs' label.
      
      Bug: 36003167
      Test: no new 'mac_perms_file' denials at boot complete on sailfish
      Test: successfully booted into recovery without denials and sideloaded
            OTA update.
      Test: Launch 'chrome' and succesfully load a website.
      Test: Launch Camera and take a picture.
      Test: Launch Camera and record a video, succesfully playback recorded
            video
      
      Change-Id: I1c882872bb78d1242ba273756ef0dc27487f58fc
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      bb24f3ab
    • Sandeep Patil's avatar
      sepolicy: explicitly label all sepolicy files · 136caa1b
      Sandeep Patil authored
      
      sepolicy files need to be explicitly labeled as they are now split
      cross system and vendor and won't have the generic world readable
      'system_file' or 'rootfs' label.
      
      Bug: 36527360
      Test: no new 'sepolicy_file' denials at boot complete on sailfish
      Test: successfully booted into recovery without denials and sideloaded
            OTA update.
      Test: Launch 'chrome' and succesfully load a website.
      Test: Launch Camera and take a picture.
      Test: Launch Camera and record a video, succesfully playback recorded
            video
      
      Change-Id: I6fe8ba31588c2d75521c6e2b0bf7e6d6eaf80a19
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      136caa1b
    • Sandeep Patil's avatar
      seapp_context: explicitly label all seapp context files · 1e149967
      Sandeep Patil authored
      
      seapp_context files need to be explicitly labeled as they are now split
      cross system and vendor and won't have the generic world readable
      'system_file' label.
      
      Bug: 36002414
      Test: no new 'seapp_context' denials at boot complete on sailfish
      Test: successfully booted into recovery without denials and sideloaded
            OTA update.
      Test: ./cts-tradefed run singleCommand cts --skip-device-info \
            --skip-preconditions --skip-connectivity-check --abi \
            arm64-v8a --module CtsSecurityHostTestCases -t \
            android.security.cts.SELinuxHostTest#testAospSeappContexts
      Test: Launch 'chrome' and succesfully load a website.
      Test: Launch Camera and take a picture.
      Test: Launch Camera and record a video, succesfully playback recorded
            video
      
      Change-Id: I19b3e50c6a7c292713d3e56ef0448acf6e4270f7
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      1e149967
    • Sandeep Patil's avatar
      file_context: explicitly label all file context files · c9cf7361
      Sandeep Patil authored
      
      file_context files need to be explicitly labeled as they are now split
      across system and vendor and won't have the generic world readable
      'system_file' label.
      
      Bug: 36002414
      Test: no new 'file_context' denials at boot complete on sailfish
      Test: successfully booted into recovery without denials and sideloaded
      OTA update.
      Test: ./cts-tradefed run singleCommand cts --skip-device-info \
             --skip-preconditions --skip-connectivity-check --abi \
             arm64-v8a --module CtsSecurityHostTestCases -t \
             android.security.cts.SELinuxHostTest#testAospFileContexts
      
      Change-Id: I603157e9fa7d1de3679d41e343de397631666273
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      c9cf7361
    • Sandeep Patil's avatar
      service_contexts: label service_contexts explicitly · 939d16b5
      Sandeep Patil authored
      
      The label applies to all service_contexts regardless of their location.
      This also lets us track the service_contexts usage and limit access to
      the files for the corresponding object manager alone.
      
      Bug: 36002427
      Test: Boot sailfish and observe no denials for 'serice_contexts'
      Test: cts-tradefed run singleCommand cts --skip-device-info \
                --skip-preconditions --skip-connectivity-check \
                --abi arm64-v8a --module CtsSecurityHostTestCases \
                -t android.security.cts.SELinuxHostTest#testAospServiceContexts
      
      Change-Id: I97fc8b24bc99ca5c00d010fb522cd39a35572858
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      939d16b5
    • Sandeep Patil's avatar
      prop_context: correctly label all property_context files · 54a42001
      Sandeep Patil authored
      
      split property context file in vendor and sytem were left untouched by
      the recent changes. This was working accidentally because they were
      still accessible to all domains as 'system_file'.
      
      Bug: 36002573
      Test: Boot sailfish to observe no new denials.
      Test: 'adb sideload' OTA on sailfish successfully
      
      Change-Id: I5bec058b59db83d2a431e9f7e91c5a09af7d2942
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      54a42001
Loading