Skip to content
Snippets Groups Projects
  1. Sep 27, 2018
    • Nick Kralevich's avatar
      Introduce system_file_type · 5e37271d
      Nick Kralevich authored
      system_file_type is a new attribute used to identify files which exist
      on the /system partition. It's useful for allow rules in init, which are
      based off of a blacklist of writable files. Additionally, it's useful
      for constructing neverallow rules to prevent regressions.
      
      Additionally, add commented out tests which enforce that all files on
      the /system partition have the system_file_type attribute. These tests
      will be uncommented in a future change after all the device-specific
      policies are cleaned up.
      
      Test: Device boots and no obvious problems.
      Change-Id: Id9bae6625f042594c8eba74ca712abb09702c1e5
      5e37271d
    • Nick Kralevich's avatar
      Label /system/usr/share/zoneinfo differently · ff1c765f
      Nick Kralevich authored
      /system/usr/share/zoneinfo is currently labeled zoneinfo_data_file,
      a label shared with /data/misc/zoneinfo. However, each of these
      directory locations has different security characteristics. In
      particular, the files in /system/usr/share/zoneinfo must never be
      writable, whereas /data/misc/zoneinfo may be written to by system_server.
      Reusing the same label hides these different security characteristics.
      
      Create a separate label for /system/usr/share/zoneinfo.
      
      Test: Device boots and no obvious problems.
      Change-Id: I8cf16ff038b06b38f77388e546d9b7a6865f7879
      ff1c765f
  2. Sep 24, 2018
    • Tri Vo's avatar
      Label /system/bin/linker* symlinks as system_file. · 6cd9bd07
      Tri Vo authored
      Fixes:
      avc: denied { read } for comm="init" name="linker_asan64" dev="sda22" ino=1833
      scontext=u:r:init:s0 tcontext=u:object_r:system_linker_exec:s0 tclass=lnk_file
      permissive=0
      
      Bug: 116486312
      Test: adb unroot && adb shell ls -l /system/bin/linker_asan
      Change-Id: I754daaf3576e83d516cc9189b8be04dcc41bbc5c
      6cd9bd07
    • Fan Xu's avatar
      Update SELinux Policy for bufferhubd · 26fa914c
      Fan Xu authored
      Create a new service type buffer_hub_binder_service for
      BufferHubBinderService and allow bufferhubd to publish the service.
      
      Add the service to 26.0, 27.0 and 28.0 compat ignore files since the
      service is not available in past versions.
      
      Fixes: 116022258
      Test: build passed
      
      Change-Id: I5a21f00329ed474433d96c8d1ce32377f20cada3
      26fa914c
    • Oleksiy Avramchenko's avatar
      Add label for /system/bin/fsck.exfat · 65a0b507
      Oleksiy Avramchenko authored
      Allow vold to run exFAT filesystem check.
      
      Test: build, mount exFAT volume
      Bug: 80202067
      Change-Id: I68f3438de89246e806cebe483f37e31c68aaa3d7
      65a0b507
  3. Sep 23, 2018
    • Jeff Vander Stoep's avatar
      Further lock down app data · 0b67bb88
      Jeff Vander Stoep authored
      Assert that only apps and installd may open private app files.
      
      Remove "open" permission for mediaserver/vold and remove their
      neverallow exemption.
      
      Test: verify no related audit messages in the logs.
      Test: build
      Fixes: 80300620
      Fixes: 80418809
      Bug: 80190017
      Change-Id: If0c1862a273af1fedd8898f334c9b0aa6b9be728
      0b67bb88
  4. Sep 21, 2018
  5. Sep 20, 2018
    • Yifan Hong's avatar
      health.filesystem HAL renamed to health.storage · 1cef6a94
      Yifan Hong authored
      ...to reflect that the HAL operates on storage devices,
      not filesystem.
      
      Bug: 111655771
      Test: compiles
      Change-Id: Ibb0572cb1878359e5944aa6711331f0c7993ba6e
      Merged-In: Ibb0572cb1878359e5944aa6711331f0c7993ba6e
      1cef6a94
    • Tri Vo's avatar
      More granular vendor access to /system files. · 5c1fe61e
      Tri Vo authored
      This change limits global access to /system files down to:
      /system/bin/linker*
      /system/lib[64]/*
      /system/etc/ld.config*
      /system/etc/seccomp_policy/*
      /system/etc/security/cacerts/*
      /system/usr/share/zoneinfo/*
      
      Bug: 111243627
      Test: boot device, browse internet without denials to system_* types.
      Test: VtsHalDrmV1_{1, 0}TargetTest without denials
      Change-Id: I69894b29733979c2bc944ac80229e84de5d519f4
      5c1fe61e
  6. Sep 19, 2018
    • Benjamin Gordon's avatar
      sepolicy: grant dac_read_search to domains with dac_override · 342362ae
      Benjamin Gordon authored
      kernel commit 2a4c22426955d4fc04069811997b7390c0fb858e (fs: switch order
      of CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH checks) swapped the order of
      dac_override and dac_read_search checks.  Domains that have dac_override
      will now generate spurious denials for dac_read_search unless they also
      have that permission.  Since dac_override is a strict superset of
      dac_read_search, grant dac_read_search to all domains that already have
      dac_override to get rid of the denials.
      
      Bug: 114280985
      Bug: crbug.com/877588
      Test: Booted on a device running 4.14.
      Change-Id: I5c1c136b775cceeb7f170e139e8d4279e73267a4
      342362ae
    • Primiano Tucci's avatar
      Allow perfetto traced_probes to poll /proc/{meminfo,stat,vmstat,...} · 51dc7cb1
      Primiano Tucci authored
      This allows the trace producer daemon to snapshot counters at
      high frequency in the trace. As usual for Perfetto, this data is
      NOT made available to arbitrary apps but only to an extremely
      limited subset of processes governed by selinux rules (currently
      shell and statsd).
      
      Bug: 115956288
      Change-Id: I7e1bfda4b568b9bac9012b198ecbb998da4f773d
      51dc7cb1
  7. Sep 17, 2018
  8. Sep 14, 2018
    • Nick Kralevich's avatar
      Strengthen ptrace neverallow rules · 095fbea5
      Nick Kralevich authored
      Add additional compile time constraints on the ability to ptrace various
      sensitive domains.
      
      llkd: remove some domains which llkd should never ptrace, even on
      debuggable builds, such as kernel threads and init.
      
      crash_dump neverallows: Remove the ptrace neverallow checks because
      it duplicates other neverallow assertions spread throughout the policy.
      
      Test: policy compiles and device boots
      Change-Id: Ia4240d1ce7143b983bb048e046bb4729d0af5a6e
      095fbea5
    • Jeff Vander Stoep's avatar
      system_server: add policy for getConnectionOwnerUid API · d1b14ab7
      Jeff Vander Stoep authored
      Bug: 9496886
      Bug: 109758967
      Test: atest HostsideVpnTests
      Change-Id: I1716d9c740b374b861e691b31ab271c681cf6bff
      d1b14ab7
  9. Sep 13, 2018
  10. Sep 12, 2018
    • Nick Kralevich's avatar
      add links to docs explaining motivations behind neverallow assertions. · 6cf9160e
      Nick Kralevich authored
      Test: comments only. Policy compiles.
      Change-Id: Ic51533d37fff6c553950a122f33a48e3c119c67c
      6cf9160e
    • Nick Kralevich's avatar
      Change priv-apps /data/data labels to privapp_data_file · 5d175519
      Nick Kralevich authored
      Currently, both untrusted apps and priv-apps use the SELinux file label
      "app_data_file" for files in their /data/data directory. This is
      problematic, as we really want different rules for such files. For
      example, we may want to allow untrusted apps to load executable code
      from priv-app directories, but disallow untrusted apps from loading
      executable code from their own home directories.
      
      Commit 23c9d91b introduced a new type
      called privapp_data_file and added rules necessary to preserve
      compatibility. However, that change did not relabel any existing files,
      so effectively the change was a no-op.
      
      This change performs the switch, relabeling priv-app's /data/data files
      from app_data_file to privapp_data_file. Due to the compatibility rules
      added in 23c9d91b, there should be no
      noticeable effect from this change.
      
      This change was originally submitted as
      4df57822. However, it was reverted in
      cdc6649a due to a different labeling
      bug. That bug has been fixed, and we can reapply this change.
      
      Test: Factory reset and boot - no problems on fresh install.
      Test: Upgrade to new version and test. No compatibility problems on
            filesystem upgrade.
      Bug: 112357170
      5d175519
  11. Sep 10, 2018
    • Benjamin Gordon's avatar
      sepolicy: Allow apps to read ashmem fds from system_server · 360559e7
      Benjamin Gordon authored
      Kernel commit 8a2af06415ef0fc922162503dd18da0d9be7771f (ashmem: switch
      to ->read_iter) switched ashmem from using __vfs_read to vfs_iter_read
      to read the backing shmem file.  Prior to this, reading from an ashmem
      fd that was passed between processes didn't hit any permission checks;
      now SELinux checks that the receiver can read from the creator's file
      context.
      
      Some apps receive buffers through ashmem from system_server, e.g., the
      settings app reads battery stats from system_server through ashmem when
      an app details page is opened.  Restore this ability by giving apps read
      access to system_server_tmpfs.  system_server is still responsible for
      creating and passing across the ashmem buffers, so this doesn't give
      apps the ability to read anything system_server isn't willing to give
      them.
      
      Bug: 112987536
      Bug: 111381531
      Test: atest android.appsecurity.cts.PermissionsHostTest on kernel 4.14
      Change-Id: Ice5e25f55bc409e91ad7e8c7ea8b28ae213191a3
      360559e7
    • Hector Dearman's avatar
      Make system_server atrace category work with traced_probes · 244bc7cf
      Hector Dearman authored
      Historically most uses of atrace happen via the shell domain.
      
      There are two exceptions:
      - boot tracing
      - traced_probes
      
      We need to get feature parity, so atrace has the same behavior
      when is invoked either via shell or from its own domain (e.g.
      via traced_probes that has an auto_trans rule into atrace on exec).
      Atrace works by setting system properties to enable tracing from userspace
      then poking all the binder services to read the system properties (see [1]) so
      enabling the system_server category requires the ability to call binder
      methods on the system_server.
      
      For more use cases see b/113127224
      
      [1]: https://android.googlesource.com/platform/frameworks/native/+/9ead54bed65d486fe435793cbe98ed8b4786f7be/cmds/atrace/atrace.cpp#545
      
      Bug: 113127224
      Test: Add an atrace category to the Perfetto config and confirm the data
      shows up.
      
      Change-Id: Id077eff960ffb1cdd7b0ce84b21ac9ef70444a4a
      244bc7cf
  12. Sep 07, 2018
  13. Sep 06, 2018
    • Marcin Oczeretko's avatar
      Add looper_stats_service to SE policy. · 56ab6be0
      Marcin Oczeretko authored
      Test: Built and flashed an image.
      Bug: 113651685
      Change-Id: Ide239432ea8a5701d91c00edd06ad3e52560a3f7
      56ab6be0
    • Nick Kralevich's avatar
      dumpstate: remove JIT and /data execute · eef72d34
      Nick Kralevich authored
      Not needed for modern Android versions. These rules are really, really
      old.
      
      Test: "adb bugreport" continues to work
      Test: Generating a bugreport via key combo continues to work.
      Change-Id: Ibc1157fb36abd7fc701db3819474f25210a3cb5f
      eef72d34
    • Nick Kralevich's avatar
      exclude su from transitioning to crash_dump domain · e6f33f53
      Nick Kralevich authored
      When /system/bin/crash_dump is executed from the su domain, do not
      perform a domain transition. This allows processes run from that domain
      to crash normally without SELinux interfering.
      
      Bug: 114136122
      Test: cferris: "This change works for me. I ran the crasher executable on
        /data, /data/nativetest, /data/nativetest64 (and even /data/local/tmp).
        All of them show that crash_dump can read the executables."
      Change-Id: Ic135d61b11774acff37ebfb35831497cddbefdef
      e6f33f53
  14. Sep 05, 2018
    • Makoto Onuki's avatar
      Add app_binding system service · 6af11813
      Makoto Onuki authored
      Bug: 109809543
      Test: Build and boot with the new service in the internal branch.
      
      Change-Id: Iaee365771c3e8e5b8f5f3b6112bbf902c6bb02bd
      6af11813
  15. Sep 04, 2018
    • Jeff Vander Stoep's avatar
      app: Allow all apps to read dropbox FDs · 6026a4ad
      Jeff Vander Stoep authored
      DropboxManager may pass FDs to any app with the READ_LOGS
      permission which is available to all apps as a development
      permission.
      
      Test: atest CtsIncidentHostTestCases
      Fixes: 111856304
      Change-Id: I329e3125dab83de948b860061df9d232e31cb23e
      6026a4ad
    • Mark Salyzyn's avatar
      llkd: Add stack symbol checking · 275ea12d
      Mark Salyzyn authored
      llkd needs the ptrace capabilities and dac override to monitor for
      live lock conditions on the stack dumps.
      
      Test: compile
      Bug: 33808187
      Change-Id: Ibc1e4cc10395fa9685c4ef0ca214daf212a5e126
      275ea12d
  16. Sep 03, 2018
  17. Aug 30, 2018
  18. Aug 28, 2018
  19. Aug 23, 2018
  20. Aug 22, 2018
  21. Aug 21, 2018
    • Tri Vo's avatar
      Rename untrusted_app_visible_*' to include 'violators'. · 7f8b6cc6
      Tri Vo authored
      Bug: 110887137
      Test: Flash new system policy onto a device with vendor policy that uses
      untrusted_app_visible_* attributes, and check that old and new attributes
      are applied to exactly same types.
      Change-Id: Ibee0ec645878fcc8c93cd0fbd169a8d45129d79e
      Merged-In: Ibee0ec645878fcc8c93cd0fbd169a8d45129d79e
      (cherry picked from commit 7abca51d)
      7f8b6cc6
    • Benjamin Gordon's avatar
      sepolicy: Fix references to self:capability · 7ed266c6
      Benjamin Gordon authored
      commit 9b2e0cbe added a new
      self:global_capability_class_set macro that covers both self:capability
      and self:cap_userns.  Apply the new macro to various self:capability
      references that have cropped up since then.
      
      Bug: 112307595
      Test: policy diff shows new rules are all cap_userns
      Change-Id: I3eb38ef07532a8e693fd549dfdbc4a6df5329609
      7ed266c6
  22. Aug 20, 2018
    • Hridya Valsaraju's avatar
      Define 'super_block_device' type · 4ae8fe9b
      Hridya Valsaraju authored
      Bug: 78793464
      Test: fastboot getvar partition-size:super
      
      'super_block_device' corresponds to the super partition
      required for flashing dynamic partitions.
      
      Change-Id: I323634b6797ead7c5face117a7028bf9ab947aea
      4ae8fe9b
    • Dario Freni's avatar
      s/product-services/product_services/g · e217ab1b
      Dario Freni authored
      Attempting to reduce the number of different spellings we have for
      "product services" partition in the codebase.
      
      Bug: 112431447
      Test: m
      Change-Id: I1499c60e3d6c6c9fbe2e3f30f097f83b1e837c1c
      Merged-In: I1499c60e3d6c6c9fbe2e3f30f097f83b1e837c1c
      e217ab1b
  23. Aug 15, 2018
    • Joel Galenson's avatar
      bug_map: track new pm/storage denials · a68b1044
      Joel Galenson authored
      avc: denied { getattr } for comm="Binder:1231_1" path="/storage/emulated" dev="tmpfs" ino=72787 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_stub_file:s0 tclass=dir
      
      Bug: 112609936
      Test: Built policy.
      Change-Id: Ib772aca11bad4ba267de259be4ad065f228ef1df
      a68b1044
    • Jerry Zhang's avatar
      Add sepolicy for fastbootd · 1d85efa9
      Jerry Zhang authored
      Also allow adb and fastboot to talk to recovery
      through recovery_socket. This enables changing
      between modes with usb commands.
      
      Test: No selinux denials
      Bug: 78793464
      Change-Id: I80c54d4eaf3b94a1fe26d2280af4e57cb1593790
      1d85efa9
    • Florian Mayer's avatar
      Revert "Add sepolicy for fastbootd" · c2ab15b7
      Florian Mayer authored
      This reverts commit 0fd3ed3b.
      
      Reason for revert: Broke user builds.
      
      Change-Id: If95f1a25d22425a5a2b68a02d1561352fb5a52f0
      c2ab15b7
  24. Aug 14, 2018
    • Jerry Zhang's avatar
      Add sepolicy for fastbootd · 0fd3ed3b
      Jerry Zhang authored
      Also allow adb and fastboot to talk to recovery
      through recovery_socket. This enables changing
      between modes with usb commands.
      
      Test: No selinux denials
      Bug: 78793464
      Change-Id: I1f97659736429fe961319c642f458c80f199ffb4
      0fd3ed3b
Loading