Skip to content
Snippets Groups Projects
  1. 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
  2. Apr 06, 2017
  3. 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
    • Andreas Gampe's avatar
      Sepolicy: Add ASAN-Extract · 82071b68
      Andreas Gampe authored
      Add selinux policies for init script and shell script to unzip a tar
      containing ASAN libraries on boot.
      
      Bug: 36458146
      Test: m && m SANITIZE_TARGET=address
      Test: manual (build steps for tar missing)
      Change-Id: I5c3cb233aae93ee9985431090af902b0e3c1b0a7
      (cherry picked from commit 0b743050)
      Merged-In: I5c3cb233aae93ee9985431090af902b0e3c1b0a7
      82071b68
  4. Apr 01, 2017
    • Jeff Vander Stoep's avatar
      Ban core components from accessing vendor data types · 50563c03
      Jeff Vander Stoep authored
      Vendor and system components are only allowed to share files by
      passing open FDs over HIDL. Ban all directory access and all file
      accesses other than what can be applied to an open FD such as
      ioctl/stat/read/write/append.
      
      This commit asserts that core components marked with attribute
      coredomain may only access core data types marked with attribute
      core_data_file_type.
      
      A temporary exemption is granted to domains that currently rely on
      access.
      
      (cherry picked from commit cd97e710)
      
      Bug: 34980020
      Test: build Marlin policy
      Change-Id: I2f0442f2628fbac1f2f7aa5ddf2a13e16b2546cc
      50563c03
  5. Mar 31, 2017
    • Jeff Vander Stoep's avatar
      domain: grant all domains access to zoneinfo · 5aebe512
      Jeff Vander Stoep authored
      /data/misc/zoneinfo is provided by libc and is considered to be
      VNDK stable. Grant read access to all domains and exempt from
      neverallow rules asserting no vendor access to core data types.
      
      Bug: 36730929
      Test: Marlin Policy builds
      Change-Id: I13766a661d6314f5393639fc20f1ab55d802f35f
      5aebe512
    • Alex Klyubin's avatar
      Tighten restrictions on core <-> vendor socket comms · 2f6151ea
      Alex Klyubin authored
      This futher restricts neverallows for sockets which may be exposed as
      filesystem nodes. This is achieved by labelling all such sockets
      created by core/non-vendor domains using the new coredomain_socket
      attribute, and then adding neverallow rules targeting that attribute.
      
      This has now effect on what domains are permitted to do. This only
      changes neverallow rules.
      
      Test: mmm system/sepolicy
      Bug: 36577153
      
      (cherry picked from commit cf2ffdf0)
      
      Change-Id: Iffeee571a2ff61fb9515fa6849d060649636524e
      2f6151ea
  6. Mar 30, 2017
    • Alex Klyubin's avatar
      Further restrict access to Binder services from vendor · 0052bc69
      Alex Klyubin authored
      This tightens neverallows for looking up Binder servicemanager
      services from vendor components. In particular, vendor components,
      other than apps, are not permitted to look up any Binder services.
      Vendor apps are permitted to look up only stable public API services
      which is exactly what non-vendor apps are permitted to use as well.
      If we permitted vendor apps to use non-stable/hidden Binder services,
      they might break when core components get updated without updating
      vendor components.
      
      Test: mmm system/sepolicy
      Bug: 35870313
      
      Change-Id: I47d40d5d42cf4205d9e4e5e5f9d0794104efc28f
      0052bc69
    • Ian Pedowitz's avatar
      Revert "Further restrict access to Binder services from vendor" · 43b48045
      Ian Pedowitz authored
      This reverts commit 5c09d123.
      
      Broke the build
      
      Bug: 35870313
      Test: source build/envsetup.sh && lunch marlin-userdebug && m -j40
      Change-Id: I71c968be6e89462fd286be5663933552d478f8bf
      43b48045
  7. Mar 29, 2017
    • Alex Klyubin's avatar
      Further restrict access to Binder services from vendor · 5c09d123
      Alex Klyubin authored
      This tightens neverallows for looking up Binder servicemanager
      services from vendor components. In particular, vendor components,
      other than apps, are not permitted to look up any Binder services.
      Vendor apps are permitted to look up only stable public API services
      which is exactly what non-vendor apps are permitted to use as well.
      If we permitted vendor apps to use non-stable/hidden Binder services,
      they might break when core components get updated without updating
      vendor components.
      
      Test: mmm system/sepolicy
      Bug: 35870313
      Change-Id: I949d62b3528cadb4bfe6f5985c25d1f497df0d5a
      5c09d123
    • Alex Klyubin's avatar
      Loosen system app data neverallows · f2e07765
      Alex Klyubin authored
      We don't want to prevent access from vendor platform apps to system app
      data. The issue with the referencing system_app explicitly in
      neverallows is that vendor platform apps which need sandboxes similar to
      system_app cannot be placed under system_app without modifying the
      policy for all platform apps.
      
      Test: mmm system/sepolicy
      Change-Id: Ic0052602c31be4d74b02eeea129e2d8bfbd9c8d3
      f2e07765
    • 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
    • Alex Klyubin's avatar
      Fix warnings · edc53291
      Alex Klyubin authored
      Unescaped apostrophe is not permitted inside macros.
      
      Test: mmm system/sepolicy -- no warnings
      Bug: 34980020
      Change-Id: I893a41508d8b62975771967fd6e40e50d188c7c1
      edc53291
  8. Mar 28, 2017
    • Jeff Vander Stoep's avatar
      Ban vendor components access to core data types · 4a478c47
      Jeff Vander Stoep authored
      Vendor and system components are only allowed to share files by
      passing open FDs over HIDL. Ban all directory access and all file
      accesses other than what can be applied to an open file:
      stat/read/write/append.
      
      This commit marks core data types as core_data_file_type and bans
      access to non-core domains with an exemption for apps. A temporary
      exemption is also granted to domains that currently rely on
      access with TODOs and bug number for each exemption.
      
      Bug: 34980020
      Test: Build and boot Marlin. Make phone call, watch youtube video.
            No new denials observed.
      Change-Id: I320dd30f9f0a5bf2f9bb218776b4bccdb529b197
      4a478c47
  9. Mar 27, 2017
    • Alex Klyubin's avatar
      Allow violators of "no Binder in vendor" access to /dev/binder · 2ab99a13
      Alex Klyubin authored
      In f5446eb1 I forgot to let violators
      of "no Binder in vendor" rule keep their access to /dev/binder. This
      commit fixes the issue.
      
      Test: mmm system/sepolicy
      Bug: 35870313
      Bug: 36657020
      Change-Id: I3fc68df1d78e2a2da94ac9bf036a51923e3a9aae
      2ab99a13
    • Alex Klyubin's avatar
      Ban socket connections between core and vendor · 2746ae68
      Alex Klyubin authored
      On PRODUCT_FULL_TREBLE devices, non-vendor domains (coredomain) and
      vendor domain are not permitted to connect to each other's sockets.
      There are two main exceptions: (1) apps are permitted to talk to other
      apps over Unix domain sockets (this is public API in Android
      framework), and (2) domains with network access (netdomain) are
      permitted to connect to netd.
      
      This commit thus:
      * adds neverallow rules restricting socket connection establishment,
      * temporarily exempts the domains which are currently violating this
        rule from this restriction. These domains are grouped using the new
        "socket_between_core_and_vendor_violators" attribute. The attribute
        is needed because the types corresponding to violators are not
        exposed to the public policy where the neverallow rules are.
      
      Test: mmm system/sepolicy
      Bug: 36613996
      Change-Id: I458f5a09a964b06ad2bddb52538ec3a15758b003
      2746ae68
  10. Mar 24, 2017
    • Alex Klyubin's avatar
      Vendor domains must not use Binder · f5446eb1
      Alex Klyubin authored
      On PRODUCT_FULL_TREBLE devices, non-vendor domains (except vendor
      apps) are not permitted to use Binder. This commit thus:
      * groups non-vendor domains using the new "coredomain" attribute,
      * adds neverallow rules restricting Binder use to coredomain and
        appdomain only, and
      * temporarily exempts the domains which are currently violating this
        rule from this restriction. These domains are grouped using the new
        "binder_in_vendor_violators" attribute. The attribute is needed
        because the types corresponding to violators are not exposed to the
        public policy where the neverallow rules are.
      
      Test: mmm system/sepolicy
      Test: Device boots, no new denials
      Test: In Chrome, navigate to ip6.me, play a YouTube video
      Test: YouTube: play a video
      Test: Netflix: play a movie
      Test: Google Camera: take a photo, take an HDR+ photo, record video with
            sound, record slow motion video with sound. Confirm videos play
            back fine and with sound.
      Bug: 35870313
      Change-Id: I0cd1a80b60bcbde358ce0f7a47b90f4435a45c95
      f5446eb1
  11. Mar 23, 2017
    • Martijn Coenen's avatar
      Initial sepolicy for vndservicemanager. · e7d8f4c3
      Martijn Coenen authored
      vndservicemanager is the context manager for binder services
      that are solely registered and accessed from vendor processes.
      
      Bug: 36052864
      Test: vendorservicemanager runs
      Merged-In: Ifbf536932678d0ff13d019635fe6347e185ef387
      Change-Id: I430f1762eb83825f6cd4be939a69d46a8ddc80ff
      e7d8f4c3
  12. Mar 22, 2017
    • Martijn Coenen's avatar
      Initial sepolicy for vndservicemanager. · cba70be7
      Martijn Coenen authored
      vndservicemanager is the context manager for binder services
      that are solely registered and accessed from vendor processes.
      
      Bug: 36052864
      Test: vendorservicemanager runs
      Change-Id: Ifbf536932678d0ff13d019635fe6347e185ef387
      cba70be7
  13. Mar 07, 2017
  14. Mar 06, 2017
    • Nick Kralevich's avatar
      Revert "Remove execmod support for newer API versions" · 9be90fb6
      Nick Kralevich authored
      We need more time to investigate the effect that this change will
      have on DRM solutions. Until the investigation is done, revert.
      
      This reverts commit 38d3eca0.
      
      Bug: 30146890
      Bug: 20013628
      Bug: 35323421
      Change-Id: I5ad69ef5ee12081ce7fc0a8440712f7f8f77cf16
      Test: policy compiles.
      9be90fb6
  15. Mar 05, 2017
    • Nick Kralevich's avatar
      Remove execmod support for newer API versions · 38d3eca0
      Nick Kralevich authored
      Drop support for execmod (aka text relocations) for newer API versions.
      Retain it for older app APIs versions.
      
      Bug: 30146890
      Bug: 20013628
      Bug: 35323421
      Test: policy compiles.
      Change-Id: Ie54fdb385e9c4bb997ad6fcb6cff74f7e32927bb
      38d3eca0
  16. Mar 03, 2017
    • Jeff Vander Stoep's avatar
      domain: Allow stat on symlinks in vendor · 05d83dd4
      Jeff Vander Stoep authored
      Addresses:
      denied { getattr } for pid=155 comm="keystore" path="/vendor"
      dev="mmcblk0p6" ino=1527 scontext=u:r:keystore:s0
      tcontext=u:object_r:system_file:s0 tclass=lnk_file
      
      On devices without an actual vendor image, /vendor is a symlink to
      /system/vendor. When loading a library from this symlinked vendor,
      the linker uses resolve_paths() resulting in an lstat(). This
      generates an selinux denial. Allow this lstat() so that paths can
      be resolved on devices without a real vendor image.
      
      Bug: 35946056
      Test: sailfish builds
      Change-Id: Ifae11bc7039047e2ac2b7eb4fbcce8ac4580799f
      05d83dd4
  17. Feb 23, 2017
    • Luis Hector Chavez's avatar
      Restrict /proc/sys/vm/mmap_rnd_bits · 64a05038
      Luis Hector Chavez authored
      Label /proc/sys/vm/mmap_rnd_bits so it is only readable and writable by
      init. This also tightens the neverallow restrictions for proc_security.
      
      Bug: 33563834
      Test: run cts -m CtsPermissionTestCases -t \
            android.permission.cts.FileSystemPermissionTest#testProcfsMmapRndBitsExistsAndSane
      
      Change-Id: Ie7af39ddbf23806d4ffa35e7b19d30fec7b6d410
      64a05038
  18. Feb 17, 2017
    • Nick Kralevich's avatar
      fsck: allow stat access on /dev/block files · 585d9767
      Nick Kralevich authored
      To determine if it is safe to run fsck on a filesystem, e2fsck
      must first determine if the filesystem is mounted. To do that,
      e2fsck scans through /proc/mounts and collects all the mounted
      block devices. With that information, it runs stat() on each block
      device, comparing the major and minor numbers to the filesystem
      passed in on the command line. If there is a match, then the filesystem
      is currently mounted and running fsck is dangerous.
      Allow stat access to all block devices so that fsck can compare
      major/minor values.
      
      Addresses the following denials:
      
      avc: denied { getattr } for comm="e2fsck" path="/dev/block/sde5"
      dev="tmpfs" ino=15649 scontext=u:r:fsck:s0
      tcontext=u:object_r:metadata_block_device:s0 tclass=blk_file
      permissive=0
      
      avc: denied { getattr } for comm="e2fsck" path="/dev/block/sda25"
      dev="tmpfs" ino=15528 scontext=u:r:fsck:s0
      tcontext=u:object_r:modem_block_device:s0 tclass=blk_file permissive=0
      
      avc: denied { getattr } for comm="e2fsck" path="/dev/block/sda31"
      dev="tmpfs" ino=15552 scontext=u:r:fsck:s0
      tcontext=u:object_r:system_block_device:s0 tclass=blk_file permissive=0
      
      avc: denied { getattr } for comm="e2fsck" path="/dev/block/sdd3"
      dev="tmpfs" ino=15600 scontext=u:r:fsck:s0
      tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0
      
      Bug: 35324014
      Bug: 33781554
      Test: device boots and no SELinux denials.
      Change-Id: I5af4a334ec41952887914eec4eee5c60cc441a66
      585d9767
  19. Feb 14, 2017
    • Jeff Vander Stoep's avatar
      untrusted_app: policy versioning based on targetSdkVersion · bacb6d79
      Jeff Vander Stoep authored
      Motivation:
      Provide the ability to phase in new security policies by
      applying them to apps with a minimum targetSdkVersion.
      
      Place untrusted apps with targetSdkVersion<=25 into the
      untrustd_app_25 domain. Apps with targetSdkVersion>=26 are placed
      into the untrusted_app domain. Common rules are included in the
      untrusted_app_all attribute. Apps with a more recent targetSdkVersion
      are granted fewer permissions.
      
      Test: Marlin builds and boots. Apps targeting targetSdkVersion<=25
      run in untrusted_app_25 domain. Apps targeting the current development
      build >=26 run in the untrusted_app domain with fewer permissions. No
      new denials observed during testing.
      Bug: 34115651
      Bug: 35323421
      Change-Id: Ie6a015566fac07c44ea06c963c40793fcdc9a083
      bacb6d79
  20. Feb 07, 2017
  21. Feb 06, 2017
  22. Feb 01, 2017
    • Max Bires's avatar
      Removing init and ueventd access to generic char files · 3171829a
      Max Bires authored
      There are many character files that are unreachable to all processes
      under selinux policies. Ueventd and init were the only two domains that
      had access to these generic character files, but auditing proved there
      was no use for that access. In light of this, access is being completely
      revoked so that the device nodes can be removed, and a neverallow is
      being audited to prevent future regressions.
      
      Test: The device boots
      Bug: 33347297
      Change-Id: If050693e5e5a65533f3d909382e40f9c6b85f61c
      3171829a
  23. 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
  24. Jan 25, 2017
  25. Jan 23, 2017
  26. Jan 20, 2017
  27. Jan 18, 2017
    • 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
  28. Jan 06, 2017
    • Nick Kralevich's avatar
      Refine rules for accessing /dev/__properties__ · 32c4a27c
      Nick Kralevich authored
      Don't allow processes to list out the contents of the directory
      /dev/__properties__. This is an implementation specific detail that
      shouldn't be visible to processes.
      
      Test: Device boots and no problems reading individual properties.
      Test: ls -la /dev/__properties__ fails
      Change-Id: I4df6a829b0d22e30fb2c38030c690fc4a356f6a3
      32c4a27c
Loading