Skip to content
Snippets Groups Projects
  1. Oct 10, 2018
    • Tri Vo's avatar
      Label /data/asan/* libs as system_lib_file. · 45d521a5
      Tri Vo authored
      This patch gives global access to asan libraries. This is not ideal since the
      labeling is not symmetric with standard locations, but this approach is easy to
      maintain.
      
      Fixes: 117555408
      Test: processes on asan builds load /data/asan/* libs correctly
      Change-Id: If54558c1808d8b16e06073c150c9f3eb358dda67
      45d521a5
    • Nick Kralevich's avatar
      Move to ioctl whitelisting for plain files / directories · ebc3a1a3
      Nick Kralevich authored
      Remove kernel attack surface associated with ioctls on plain files. In
      particular, we want to ensure that the ioctls FS_IOC_ENABLE_VERITY and
      FS_IOC_MEASURE_VERITY are not exposed outside a whitelisted set of
      entities. However, it's straight forward enough to turn on ioctl
      whitelisting for everything, so we choose to do so.
      
      Test: policy compiles and device boots
      Test: device boots with data wipe
      Test: device boots without data wipe
      Change-Id: I545ae76dddaa2193890eeb1d404db79d1ffa13c2
      ebc3a1a3
    • Nick Kralevich's avatar
      Revert "Constrain cgroups access." · cacea25e
      Nick Kralevich authored
      This reverts commit 9899568f.
      
      Reason for revert: Reports of high numbers of SELinux denials
      showing up on the SELinux dashboard.
      
      Bug: 110043362
      Change-Id: Id8fc260c47ffd269ac2f15ff7dab668c959e3ab0
      cacea25e
  2. Oct 09, 2018
    • Tri Vo's avatar
      Constrain cgroups access. · 9899568f
      Tri Vo authored
      What changed:
      - Removed cgroup access from untrusted and priv apps.
      - Settings app writes to /dev/stune/foreground/tasks, so system_app domain
      retains access to cgroup.
      - libcutils exports API to /dev/{cpuset, stune}/*. This API seems to be used
      abundantly in native code. So added a blanket allow rule for (coredomain - apps)
      to access cgroups.
      - For now, only audit cgroup access from vendor domains. Ultimately, we want to
      either constrain vendor access to individual domains or, even better, remove
      vendor access and have platform manage cgroups exclusively.
      
      Bug: 110043362
      Test: adb shell setprop ro.config.per_app_memcg true, device correctly populates
      /dev/memcg on a per app basis on a device that supports that.
      Test: aosp_sailfish, wahoo boot without cgroup denials
      Change-Id: I9e441b26792f1edb1663c660bcff422ec7a6332b
      9899568f
  3. Oct 08, 2018
    • Sudheer Shanka's avatar
      Allow zygote to search sdcardfs dirs. · 684cdb66
      Sudheer Shanka authored
      Bug: 117440207
      Bug: 111890351
      Test: manual
      Change-Id: Ie218dec3e4f0f5dbade6d1c4d28b259909664056
      684cdb66
    • Igor Murashkin's avatar
      iorapd: Add new binder service iorapd. · 72a88b19
      Igor Murashkin authored
      This daemon is very locked down. Only system_server can access it.
      
      Bug: 72170747
      Change-Id: I7b72b9191cb192be96001d84d067c28292c9688f
      72a88b19
    • Howard Ro's avatar
      Allow zygote to write to statsd and refactor · 98de322a
      Howard Ro authored
      We plan on migrating MetricsLogger to write to statsd socket. So we need to
      allow zygote, which writes to logd using MetricsLogger, to also be able
      to statsd. We also re-locate some sepolicies to write to statsd socket
      in their respective policy definitions.
      
      Bug: 110537511
      Test: no failure/violations observed
      Change-Id: I21fd352a25ed946516f9a45ac3b5e9bf97b059bc
      98de322a
    • Tri Vo's avatar
      asan: global read access to /system/asan.options · 93318192
      Tri Vo authored
      Bug: 117178352
      Test: no denials to /system/asan.options on asan walleye
      Change-Id: I6042693afb926a22a3e2be79bd2a7ba062806143
      93318192
    • Mark Salyzyn's avatar
      fs_mgr: add /mnt/scratch to possible overlayfs support directories · 1369dfca
      Mark Salyzyn authored
      A default set of options are available, but can override in a fstab
      overlay entry with upperdir=, lowerdir= to the same mount point,
      workdir=.  The default is a valid /mnt/scratch/overlay/
      or /cache/overlay/ directory, with .../<mount_point>/upper and
      .../<mount_point>/work, associated with each system partition
      <mount_point>.
      
      Test: manual
      Bug: 109821005
      Change-Id: I5662c01fad17d105665be065f6dcd7c3fdc40d95
      1369dfca
  4. Oct 04, 2018
    • Christine Franks's avatar
      Add system_api_service to color_display_service · ce3e87c0
      Christine Franks authored
      Bug: 111215474
      Test: boots
      Change-Id: Ib8cabeb64a8b4ec9f592d870bd0af611a2720cc7
      ce3e87c0
    • Martijn Coenen's avatar
      Add policy for apexd. · ac097ac4
      Martijn Coenen authored
      apexd is a new daemon for managing APEX packages installed
      on the device. It hosts a single binder service, "apexservice".
      
      Bug: 112455435
      Test: builds, binder service can be registered,
            apexes can be accessed, verified and mounted
      Change-Id: I634ad100f10b2edcd9a9c0df0d33896fa5d4ed97
      ac097ac4
  5. Oct 03, 2018
    • Nick Kralevich's avatar
      isolated_apps: no socket create · 8f08456a
      Nick Kralevich authored
      Isolated apps provide a very strict security guarantee, including the
      inability to create networking sockets like TCP / UDP sockets. Add an
      SELinux neverallow assertion to test for this and prevent regressions.
      
      Test: policy compiles.
      Change-Id: I2618abb17375707eb1048e89faa46f57d33e1df4
      8f08456a
  6. Oct 02, 2018
    • Tri Vo's avatar
      Only maintain maps between current and previous selinux versions. · 438684b3
      Tri Vo authored
      New maintenance scheme for mapping files:
      Say, V is the current SELinux platform version, then at any point in time we
      only maintain (V->V-1) mapping. (V->V-n) map is constructed from top (V->V-n+1)
      and bottom (V-n+1->V-n) without changes to previously maintained mapping files.
      
      Caveats:
      - 26.0.cil doesn't technically represent 27.0->26.0 map, but rather
      current->26.0. We'll fully migrate to the scheme with future releases.
      
      Bug: 67510052
      Test: adding new public type only requires changing the latest compat map
      Change-Id: Iab5564e887ef2c8004cb493505dd56c6220c61f8
      438684b3
  7. Oct 01, 2018
    • Tri Vo's avatar
      Address TODOs in 28.0.cil mapping. · 44383394
      Tri Vo authored
      Test: m selinux_policy
      Change-Id: I6a8ff2200c82b6ecdc1404bc7cf186f439950a30
      44383394
    • Tri Vo's avatar
      Fix incorrect 27.0 mappings. · f509e02d
      Tri Vo authored
      Map proc_qtaguid_ctrl to qtaguid_proc, not qtaguid_device.
      Map proc_slabinfo to proc in the correct place.
      
      Test: m selinux_policy
      Change-Id: I37c9dfe40bd20924215856b5d4ff7d9b3cbd0417
      f509e02d
    • Jeff Vander Stoep's avatar
      Remove access to /proc/net/{tcp,udp} · 42451772
      Jeff Vander Stoep authored
      Remove these files from proc_net_type. Domains that need access must
      have permission explicitly granted. Neverallow app access except the
      shell domain.
      
      Bug: 114475727
      Test: atest CtsLibcoreOjTestCases
      Test: netstat, lsof
      Test: adb bugreport
      Change-Id: I2304e3e98c0d637af78a361569466aa2fbe79fa0
      42451772
  8. Sep 28, 2018
    • Howard Ro's avatar
      Update sepolicies for stats hal · 578a1891
      Howard Ro authored
      Bug: 116732452
      Test: No sepolicy violations observed with this change
      (cherry picked from commit I1958182dd8ecc496625da2a2a834f71f5d43e7bb)
      
      Change-Id: Ib386767d8acfacf9fedafd9a79dd555ce233f41c
      578a1891
    • Sudheer Shanka's avatar
      Allow zygote to mount on sdcardfs dirs. · 4fc64db5
      Sudheer Shanka authored
      Bug: 111890351
      Test: manual
      Change-Id: I37d632c9877c6d6f929937d8e25098763807630c
      4fc64db5
    • Jeff Vander Stoep's avatar
      Remove untrusted app access to /proc/net · d78e07cb
      Jeff Vander Stoep authored
      This change is for testing potential app-compat issues when removing
      access to file in /proc/net. See: b/114475727#comment11.
      
      Bug: 114475727
      Test: build/boot taimen.
      Test: atest CtsLibcoreOjTestCases
      Test: FileSystemPermissionTest
      Test: ListeningPortsTest b/114772424
      Change-Id: I1db1c2b41308e47c9ec9db57ea8597a650c8906d
      (cherry picked from commit 6784f80b)
      d78e07cb
    • Chenbo Feng's avatar
      Block access to xt_qtaguid proc files · 16dbe82e
      Chenbo Feng authored
      In the next Android release, there will be devices that have no
      xt_qtaguid module at all and framework and netd will decide which code
      path it takes for trafficStats depending on the device setup. So all
      apps and services should not depend on this device specific
      implementation anymore and use public API for the data they need.
      
      Bug: 114475331
      Bug: 79938294
      Test: QtaguidPermissionTest
      
      Change-Id: I0d37b2df23782eefa2e8977c6cdbf9210db3e0d2
      16dbe82e
  9. Sep 27, 2018
    • Wei Wang's avatar
      Add atrace HAL 1.0 sepolicy · bc71a610
      Wei Wang authored
      Bug: 111098596
      Test: atrace/systrace
      
      (cherry picked from commit 9ed5cf6e)
      
      Change-Id: I97772ff21754d03a0aea0d53b39e8da5312a17c0
      bc71a610
    • 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
  10. 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
    • Tej Singh's avatar
      Sepolicy for migrating storaged to statsd · 44d47c03
      Tej Singh authored
      This adds /proc/uid_io/stats to the files that system server is able to
      read.
      
      Test: Manual test on master produces no selinux violations.
      Change-Id: I2c7afec149f893b000094739d91531dec559de6f
      44d47c03
    • 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
  11. 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
  12. Sep 21, 2018
  13. 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
  14. 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
  15. Sep 17, 2018
  16. 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
  17. Sep 13, 2018
  18. 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
  19. 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
Loading