Skip to content
Snippets Groups Projects
  1. Feb 28, 2017
    • Todd Poynor's avatar
      Add /data/misc/reboot and reboot_data_file context · 7290f633
      Todd Poynor authored
      Add a file context for keeping track of last reboot reason and label
      directory /data/misc/reboot/ for this purpose.
      
      (Cherry picked from commit ca051f6d)
      
      Bug: 30994946
      Test: manual: reboot ocmmand, setprop sys.powerctl, SoC thermal mgr
      Change-Id: I9569420626b4029a62448b3f729ecbbeafbc3e66
      7290f633
    • Steven Moreland's avatar
      Bluetooth hal: move to vendor partition. · ba1c5831
      Steven Moreland authored
      Bug: 35328775
      Test: works in both binderized and passthrough modes
      Merged-In: I1f827b4983e5e67c516e4488ad3497dd62db7e20
      Change-Id: I1f827b4983e5e67c516e4488ad3497dd62db7e20
      ba1c5831
  2. Feb 24, 2017
  3. Feb 17, 2017
  4. Feb 13, 2017
  5. Feb 12, 2017
    • Nick Kralevich's avatar
      tracefs: avoid overly generic regexes · 4cae28d4
      Nick Kralevich authored
      On boot, Android runs restorecon on a number of virtual directories,
      such as /sys and /sys/kernel/debug, to ensure that the SELinux labels
      are correct. To avoid causing excessive boot time delays, the restorecon
      code aggressively prunes directories, to avoid recursing down directory
      trees which will never have a matching SELinux label.
      
      See:
      * https://android-review.googlesource.com/93401
      * https://android-review.googlesource.com/109103
      
      The key to this optimization is avoiding unnecessarily broad regular
      expressions in file_contexts. If an overly broad regex exists, the tree
      pruning code is ineffective, and the restorecon ends up visiting lots of
      unnecessary directories.
      
      The directory /sys/kernel/debug/tracing contains approximately 4500
      files normally, and on debuggable builds, this number can jump to over
      9000 files when the processing from wifi-events.rc occurs. For
      comparison, the entire /sys/kernel/debug tree (excluding
      /sys/kernel/debug/tracing) only contains approximately 8000 files. The
      regular expression "/sys/kernel(/debug)?/tracing/(.*)?" ends up matching
      a significant number of files, which impacts boot performance.
      
      Instead of using an overly broad regex, refine the regex so only the
      files needed have an entry in file_contexts. This list of files is
      essentially a duplicate of the entries in
      frameworks/native/cmds/atrace/atrace.rc .
      
      This change reduces the restorecon_recursive call for /sys/kernel/debug
      from approximately 260ms to 40ms, a boot time reduction of approximately
      220ms.
      
      Bug: 35248779
      Test: device boots, no SELinux denials, faster boot.
      Change-Id: I70f8af102762ec0180546b05fcf014c097135f3e
      4cae28d4
  6. Feb 11, 2017
    • Nick Kralevich's avatar
      Don't try to relabel tracing directory · 6ebcfe47
      Nick Kralevich authored
      Use the default filesystem label from genfs_contexts for the directory
      /sys/kernel/debug/tracing and /sys/kernel/tracing, instead of explicitly
      attempting to relabel it.
      
      There are three cases we need to consider:
      
      1) Old-style tracing functionality is on debugfs
      2) tracing functionality is on tracefs, but mounted under debugfs
      3) tracefs is mounted at /sys/kernel/tracing
      
      For #1, the label on /sys/kernel/debug/tracing will be debugfs, and all
      processes are allowed debugfs:dir search, so having the label be debugfs
      instead of debugfs_tracing will not result in any permission change.
      
      For #2, the label on /sys/kernel/debug/tracing will be debugfs_tracing,
      which is the same as it is today. The empty directory
      /sys/kernel/tracing wlll retain the sysfs label, avoiding the denial
      below.
      
      For #3, /sys/kernel/debug/tracing won't exist, and /sys/kernel/tracing
      will have the debugfs_tracing label, where processes are allowed search
      access.
      
      Addresses the following denial:
      
      avc:  denied  { associate } for  pid=1 comm="init" name="tracing"
      dev="sysfs" ino=95 scontext=u:object_r:debugfs_tracing:s0
      tcontext=u:object_r:sysfs:s0 tclass=filesystem permissive=0
      
      Bug: 31856701
      Bug: 35197529
      Test: no denials on boot
      Change-Id: I7233ea92c6987b8edfce9c2f1d77eb25c7df820f
      6ebcfe47
  7. Feb 09, 2017
  8. Feb 07, 2017
  9. Feb 06, 2017
  10. Feb 02, 2017
    • Jiyong Park's avatar
      configstore: add selinux policy for configstore@1.0 hal · ebec1aa2
      Jiyong Park authored
      This change adds selinux policy for configstore@1.0 hal. Currently, only
      surfaceflinger has access to the HAL, but need to be widen.
      
      Bug: 34314793
      Test: build & run
      
      Merged-In: I40e65032e9898ab5f412bfdb7745b43136d8e964
      Change-Id: I40e65032e9898ab5f412bfdb7745b43136d8e964
      (cherry picked from commit 5ff0f178)
      ebec1aa2
  11. Jan 31, 2017
    • Calin Juravle's avatar
      Remove SElinux audit to libart_file · 01ee59a7
      Calin Juravle authored
      Since it was introduced it caused quite a few issues and it spams the
      SElinux logs unnecessary.
      
      The end goal of the audit was to whitelist the access to the
      interpreter. However that's unfeasible for now given the complexity.
      
      Test: devices boots and everything works as expected
            no more auditallow logs
      
      Bug: 29795519
      Bug: 32871170
      Change-Id: I9a7a65835e1e1d3f81be635bed2a3acf75a264f6
      01ee59a7
    • Mark Salyzyn's avatar
      logd: restrict access to /dev/event-log-tags · d33a9a19
      Mark Salyzyn authored
      Create an event_log_tags_file label and use it for
      /dev/event-log-tags.  Only trusted system log readers are allowed
      direct read access to this file, no write access.  Untrusted domain
      requests lack direct access, and are thus checked for credentials via
      the "plan b" long path socket to the event log tag service.
      
      Test: gTest logd-unit-tests, liblog-unit-tests and logcat-unit-tests
      Bug: 31456426
      Bug: 30566487
      Change-Id: Ib9b71ca225d4436d764c9bc340ff7b1c9c252a9e
      d33a9a19
  12. Jan 29, 2017
  13. Jan 27, 2017
    • Janis Danisevskis's avatar
      Preliminary policy for hal_keymaster (TREBLE) · e8acd769
      Janis Danisevskis authored
      This adds the premissions required for
      android.hardware.keymaster@2.0-service to access the keymaster TA
      as well as for keystore and vold to lookup and use
      android.hardware.keymaster@2.0-service.
      
      IT DOES NOT remove the privileges from keystore and vold to access
      the keymaster TA directly.
      
      Test: Run keystore CTS tests
      Bug: 32020919
      
      (cherry picked from commit 5090d6f3)
      
      Change-Id: Ib02682da26e2dbcabd81bc23169f9bd0e832eb19
      e8acd769
    • Badhri Jagan Sridharan's avatar
      sepolicy for usb hal · ae206f16
      Badhri Jagan Sridharan authored
      Bug: 31015010
      
      cherry-pick from b6e4d4bd
      
      Test: checked for selinux denial msgs in the dmesg logs.
      Change-Id: I8285ea05162ea0d75459e873e5c2bad2dbc7e5ba
      ae206f16
  14. Jan 25, 2017
    • Jeff Tinker's avatar
      Add sepolicy for drm HALs · c86f42b9
      Jeff Tinker authored
      bug:32815560
      Change-Id: I494141b47fcd2e7e0cc02aa58d8df9a222060b3f
      c86f42b9
    • Ray Essick's avatar
      rename mediaanalytics->mediametrics, wider access · 39185400
      Ray Essick authored
      reflect the change from "mediaanalytics" to "mediametrics"
      
      Also incorporates a broader access to the service -- e.g. anyone.
      This reflects that a number of metrics submissions come from application
      space and not only from our controlled, trusted media related processes.
      The metrics service (in another commit) checks on the source of any
      incoming metrics data and limits what is allowed from unprivileged
      clients.
      
      Bug: 34615027
      Test: clean build, service running and accessible
      Change-Id: I657c343ea1faed536c3ee1940f1e7a178e813a42
      39185400
  15. Jan 24, 2017
    • Calin Juravle's avatar
      SElinux policies for compiling secondary dex files · e5a1f64a
      Calin Juravle authored
      This CLs adds SElinux policies necessary to compile secondary dex files.
      
      When an app loads secondary dex files via the base class loader the
      files will get reported to PM. During maintance mode PM will compile the
      secondary dex files which were used via the standard installd model
      (fork, exec, change uid and lower capabilities).
      
      What is needed:
      dexoptanalyzer - needs to read the dex file and the boot image in order
      to decide if we need to actually comppile.
      dex2oat - needs to be able to create *.oat files next to the secondary
      dex files.
      
      Test: devices boots
            compilation of secondary dex files works without selinux denials
            cmd package compile --secondary-dex -f -m speed
      com.google.android.gms
      
      Bug: 32871170
      Change-Id: I038955b5bc9a72d49f6c24c1cb76276e0f53dc45
      e5a1f64a
  16. Jan 20, 2017
    • Paul Lawrence's avatar
      tracefs not debugfs · ef2a1709
      Paul Lawrence authored
      Test:   Device boots
              Can take photos
              Run "adb shell atrace -c -b 16000 -t 5 gfx" without root and check produces
              output
              Run "python systrace.py view gfx freq sched am wm dalvik
              binder_driver" from external/chromium-trace after adb root and
              check populated
      Bug: 31856701
      Change-Id: Ic319f8a0a3e395efa7ee8ba33a868ac55cb44fe4
      ef2a1709
    • Alex Klyubin's avatar
      Sort hal_* declarations alphabetically · e1ff7e88
      Alex Klyubin authored
      Test: No change to SELinux policy
      Change-Id: I45d6d6ab0538b9d4768b922cfdc2c972272d0b18
      e1ff7e88
    • Steven Moreland's avatar
      hal_light: add permission to sys/class/leds. · 62aee3b4
      Steven Moreland authored
      /sys/class/leds is the standard location for linux files dealing with
      leds, however the exact contents of this directory is non-standard
      (hence the need for a hal).
      
      Bug: 32022100
      Test: compiles and works for the subset of common files
      Change-Id: I7571d7267d5ed531c4cf95599d5f2acc22287ef4
      62aee3b4
  17. Jan 18, 2017
    • mukesh agrawal's avatar
      allow init and system_server access to tracing · 3a6bc68e
      mukesh agrawal authored
      Revise policy, to allow init and system_server to configure,
      clear, and read kernel trace events. This will enable us to
      debug certain WiFi failures.
      
      Note that system_server is restricted to only accessing
      a wifi-specific trace instance. (Hence, system_server is
      not allowed to interfere with atrace.) Moreover, even for
      the wifi trace instance, system_server is granted limited
      permissions. (system_server can not, e.g., change which
      events are traced.)
      
      Note also that init and system_server are only granted these
      powers on userdebug or eng builds.
      
      The init.te and system_server.te changes resolve the
      following denials:
      
      // Denials when wifi-events.rc configures tracing
      { write } for pid=1 comm="init" name="instances" dev="debugfs" ino=755 scontext=u:r:init:s0 tcontext=u:object_r:debugfs_tracing_instances:s0 tclass=dir permissive=1
      { add_name } for pid=1 comm="init" name="wifi" scontext=u:r:init:s0 tcontext=u:object_r:debugfs_tracing_instances:s0 tclass=dir permissive=1
      { create } for pid=1 comm="init" name="wifi" scontext=u:r:init:s0 tcontext=u:object_r:debugfs_tracing_instances:s0 tclass=dir permissive=1
      { write } for pid=1 comm="init" name="tracing_on" dev="debugfs" ino=18067 scontext=u:r:init:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { write } for pid=1 comm="init" name="buffer_size_kb" dev="debugfs" ino=18061 scontext=u:r:init:s0 tcontext=u:object_r:debugfs_tracing_instances:s0 tclass=file permissive=1
      
      // Denials when system_server sets up fail-safe
      // (auto-terminate tracing if system_server dies)
      { search } for pid=882 comm="system_server" name="instances" dev="debugfs" ino=755 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_tracing_instances:s0 tclass=dir permissive=1
      { read } for pid=882 comm="system_server" name="free_buffer" dev="debugfs" ino=18063 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { open } for pid=882 comm="system_server" path="/sys/kernel/debug/tracing/instances/wifi/free_buffer" dev="debugfs" ino=18063 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { getattr } for pid=882 comm="system_server" path="/sys/kernel/debug/tracing/instances/wifi/free_buffer" dev="debugfs" ino=18063 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      
      // Denials when system_server toggles tracing on or off
      // (WifiStateMachine is a thread in system_server)
      { search } for pid=989 comm="WifiStateMachin" name="instances" dev="debugfs" ino=755 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_tracing_instances:s0 tclass=dir permissive=1
      { write } for pid=989 comm="WifiStateMachin" name="tracing_on" dev="debugfs" ino=18067 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { open } for pid=989 comm="WifiStateMachin" path="/sys/kernel/debug/tracing/instances/wifi/tracing_on" dev="debugfs" ino=18067 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { getattr } for pid=989 comm="WifiStateMachin" path="/sys/kernel/debug/tracing/instances/wifi/tracing_on" dev="debugfs" ino=18067 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { write } for pid=989 comm="WifiStateMachin" name="tracing_on" dev="debugfs" ino=18067 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { open } for pid=989 comm="WifiStateMachin" path="/sys/kernel/debug/tracing/instances/wifi/tracing_on" dev="debugfs" ino=18067 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { getattr } for pid=989 comm="WifiStateMachin" path="/sys/kernel/debug/tracing/instances/wifi/tracing_on" dev="debugfs" ino=18067 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      
      // Denials when system_server reads the event trace
      // (This happens in response to a dumpsys request)
      { search } for pid=3537 comm="Binder:882_B" name="instances" dev="debugfs" ino=755 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_tracing_instances:s0 tclass=dir permissive=1
      { read } for pid=3537 comm="Binder:882_B" name="trace" dev="debugfs" ino=18059 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { open } for pid=3537 comm="Binder:882_B" path="/sys/kernel/debug/tracing/instances/wifi/trace" dev="debugfs" ino=18059 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { getattr } for pid=3537 comm="Binder:882_B" path="/sys/kernel/debug/tracing/instances/wifi/trace" dev="debugfs" ino=18059 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      { write } for pid=3537 comm="Binder:882_B" name="trace" dev="debugfs" ino=18059 scontext=u:r:system_server:s0 tcontext=u:object_r:debugfs_wifi_tracing:s0 tclass=file permissive=1
      
      Bug: 27254565
      Test: manual
      Manual test:
      - Build this CL along with CL:322337
      - Verify that system boots, and that we can connect to GoogleGuest.
        (Testing of actual trace functionality with require some more
        patches in frameworks/opt/net/wifi.)
      $ adb root && adb shell dmesg | egrep 'avc: denied.+debugfs'
      
      Change-Id: Ib6eb4116549277f85bd510d25fb30200f1752f4d
      3a6bc68e
    • Josh Gao's avatar
      Introduce crash_dump debugging helper. · cb3eb4ee
      Josh Gao authored
      Replace the global debuggerd with a per-process debugging helper that
      gets exec'ed by the process that crashed.
      
      Bug: http://b/30705528
      Test: crasher/crasher64, `debuggerd <pid>`, `kill -ABRT <pid>`
      Change-Id: Iad1b7478f7a4e2690720db4b066417d8b66834ed
      cb3eb4ee
    • Eino-Ville Talvala's avatar
      DO NOT MERGE: Camera: Add initial Treble camera HAL sepolicy · 9c43a3ff
      Eino-Ville Talvala authored
      - Allow cameraservice to talk to hwbinder, hwservicemanager
      - Allow hal_camera to talk to the same interfaces as cameraservice
      
      Test: Compiles, confirmed that cameraservice can call hwservicemanager
      Bug: 32991422
      Change-Id: Ied0a3f5f7149e29c468a13887510c78d555dcb2a
      9c43a3ff
    • Jorim Jaggi's avatar
      Revert "property_context: split into platform and non-platform components." · aa03ef26
      Jorim Jaggi authored
      This reverts commit 262edc38.
      
      Fixes: 34370523
      Change-Id: I077d064d4031d40bc48cb39eba310e6c16b9627d
      aa03ef26
    • Sandeep Patil's avatar
      property_context: split into platform and non-platform components. · 262edc38
      Sandeep Patil authored
      
      Bug: 33746484
      Test: Successfully boot with original service and property contexts.
            Successfully boot with split serivce and property contexts.
      
      Change-Id: I7881af8922834dc69b37dae3b06d921e05206564
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      262edc38
    • Sandeep Patil's avatar
      service_context: split into platform and non-platform components. · a058b569
      Sandeep Patil authored
      
      Bug: 33746484
      Test: Successfully boot with original service and property contexts.
            Successfully boot with split serivce and property contexts.
      
      Change-Id: Ide67d37d85273c60b9e387e72fbeb87be6da306a
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      a058b569
  18. Jan 13, 2017
    • Jim Miller's avatar
      New SeLinux policy for fingerprint HIDL · 54e0e5af
      Jim Miller authored
      Move from fingerprintd to new fingerprint_hal and update SeLinux policy.
      
      Test: Boot with no errors related to fingerprint sepolicy
      Bug: 33199080
      Change-Id: Idfde0cb0530e75e705033042f64f3040f6df22d6
      54e0e5af
    • Hridya Valsaraju's avatar
      add selinux policy for GNSS hal · 953c4396
      Hridya Valsaraju authored
      The following are the avc denials that are addressed:
      
      avc: denied { call } for pid=889 comm="system_server"
      scontext=u:r:system_server:s0 tcontext=u:r:hal_gnss_default:s0
      tclass=binder permissive=0
      
      avc: denied { call } for scontext=u:r:hal_gnss_default:s0
      tcontext=u:r:system_server:s0 tclass=binder permissive=0
      
      avc: denied { read } for name="hw" dev="mmcblk0p43" ino=1837
      scontext=u:r:hal_gnss_default:s0 tcontext=u:object_r:system_file:s0
      tclass=dir permissive=0
      
      avc: denied { open } for path="/system/lib64/hw" dev="mmcblk0p43"
      ino=1837 scontext=u:r:hal_gnss_default:s0
      tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
      
      Bug:31974439
      
      Test: Checked that there no more related avc denial messages related to
      the GNSS HAL in dmesg.
      
      Change-Id: I5b43dc088017a5568dd8e442726d2bf52e95b1d5
      953c4396
    • Max Bires's avatar
      Auditing init and ueventd access to chr device files. · 9e7a5b0a
      Max Bires authored
      It seems likely that there is no reason to keep around a number of
      devices that are configured to be included into the pixel kernels. Init
      and ueventd should be the only processes with r/w access to these
      devices, so auditallow rules have been added to ensure that they aren't
      actually used.
      
      /dev/keychord was given its own type since it's one of the few character
      devices that's actually legitimately used and would cause log spam in
      the auditallow otherwise.
      
      Bug: 33347297
      Test: The phone boots without any apparent log spam.
      
      Change-Id: I3dd9557df8a9218b8c802e33ff549d15849216fb
      9e7a5b0a
  19. Jan 12, 2017
  20. Jan 11, 2017
  21. Jan 10, 2017
  22. Jan 09, 2017
  23. Jan 07, 2017
    • ynwang's avatar
      Storaged permission setting · 9fa8823c
      ynwang authored
      Allowing storaged for reading from pseudo filesystems and debugfs.
      
      Bug: 32221677
      
      Change-Id: I837cead9a68f0b399703b64d724cb9c4b205c335
      9fa8823c
  24. Jan 05, 2017
    • dcashman's avatar
      Split file_contexts for on-device compilation. · d225b697
      dcashman authored
      
      Simulate platform and non-platform split by compiling two different
      file_contexts files and loading them together on-device.  Leave the existing
      file_contexts.bin in place until we're ready to build images based on the new
      files.
      
      Bug: 31363362
      Test: Builds and boots without additional denials.
      Change-Id: I7248f876e2230cee3b3cbf386422063da1e3dde0
      
      Bring back file_contexts.bin.
      
      Change-Id: Ifec2c363579151080fdec48e8bc46bbbc8c97674
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      d225b697
  25. Jan 03, 2017
  26. Dec 29, 2016
  27. Dec 28, 2016
Loading