Skip to content
Snippets Groups Projects
  1. Apr 10, 2017
    • Alex Klyubin's avatar
      Apostrophe not permitted in macro parameters · d84f20b2
      Alex Klyubin authored
      Test: mmm system/sepolicy -- no warnings
      Bug: 3716915
      Change-Id: I76886c2d09a70cbe6dc707dd0599217407bb63f7
      d84f20b2
    • Sandeep Patil's avatar
      sepolicy: Fix renderscript driver lookup · 3af3a13b
      Sandeep Patil authored
      
      Renderscript drivers are loaded from /vendor/lib64 by following the
      /system/vendor symlink. This change fixes a couple of things.
      - Allows all domains access to follow the symlink
      - Restores app domain permissions for /vendor for non-treble devices
      - Allow app domains to peek into /vendor/lib64, but NOT grant 'execute'
        permissions for everything. Since RS drivers can be loaded into any
        process, their vendor implementation and dependencies have been
        marked as 'same process HALs' already.
      
      Bug: 37169158
      Test: Tested on sailfish (Treble) & Angler (non-treble)
            ./cts-tradefed run cts -m CtsRenderscriptTestCases \
            --skip-device-info --skip-preconditions --skip-connectivity-check \
            --abi arm64-v8a
            Result: Tests Passed: 743 Tests Failed: 0
      
      Change-Id: I36f5523381428629126fc196f615063fc7a50b8e
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      3af3a13b
    • 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
  2. Apr 08, 2017
  3. Apr 07, 2017
    • Alex Klyubin's avatar
      Preserve treble-only flag for CTS neverallows · 446279a6
      Alex Klyubin authored
      CTS includes general_sepolicy.conf built from this project. CTS then
      tests this file's neverallow rules against the policy of the device
      under test. Prior to this commit, neverallow rules which must be
      enforced only for Treble devices we not included into
      general_sepolicy.conf. As a result, these rules were not enforced for
      Treble devices.
      
      This commit fixes the issue as follows. Because CTS includes only one
      policy, the policy now contains also the rules which are only for
      Treble devices. To enable CTS to distinguish rules needed for all
      devices from rules needed only on Treble devices, the latter rules are
      contained in sections delimited with BEGIN_TREBLE_ONLY and
      END_TREBLE_ONLY comments.
      
      This commit also removes the unnecessary sepolicy.general target. This
      target is not used anywhere and is causing trouble because it is
      verifying neverallows of the policy meant to be used by CTS. This
      policy can no longer be verified with checkpolicy without
      conditionally including or excluding Treble-only neverallows.
      
      Test: mmm system/sepolicy
      Test: Device boots -- no new denials
      Bug: 37082262
      Change-Id: I15172a7efd9374543ba521e17aead1bdda7451bf
      446279a6
    • Tianjie Xu's avatar
      Allow recovery to read thermal info · 15bf1b52
      Tianjie Xu authored
      We want to track temperature metrics during an OTA update.
      
      denial message:
      denied  { search } for  pid=349 comm="recovery" name="thermal"
      dev="sysfs" ino=18029 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=0
      
      denied  { read } for  pid=326 comm="recovery" name="temp"
      dev="sysfs" ino=18479 scontext=u:r:recovery:s0
      tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=0
      
      Bug: 36920500
      Bug: 32518487
      Test: temperature logs on angler
      Change-Id: Ib70c1c7b4e05f91a6360ff134a11c80537d6015e
      (cherry picked from commit 3da2f21f)
      15bf1b52
    • 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
    • Martijn Coenen's avatar
      Allow 'su' domain access to vndbinder. · cf741dd7
      Martijn Coenen authored
      For example, for listing vndbinder services
      using 'adb shell service -v list'
      
      Test: adb shell service -v list
      Bug: 36987120
      Change-Id: Ibf3050710720ae4c920bc4807c9a90ba43717f3b
      cf741dd7
  4. Apr 06, 2017
  5. 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
    • Nick Kralevich's avatar
      Fix lock logspam and remove domain_deprecated rule · 4a580cca
      Nick Kralevich authored
      Remove system_file:file { lock ioctl } from domain_deprecated. The only
      domains triggering this were dex2oat and netd, which are fixed in this
      change.
      
      Addresses the following logspam similar to:
      
        avc: granted { lock } for comm="iptables"
        path="/system/etc/xtables.lock" dev="sda22" ino=3745
        scontext=u:r:netd:s0 tcontext=u:object_r:system_file:s0 tclass=file
      
        avc: granted { lock } for comm="dex2oat"
        path="/system/framework/arm/boot-okhttp.art" dev="dm-0" ino=1295
        scontext=u:r:dex2oat:s0 tcontext=u:object_r:system_file:s0 tclass=file
      
      Test: device boots and no obvious problems.
      Bug: 28760354
      Bug: 36879751
      Change-Id: Iac851c0e49a52ce4000fdfe16e68c17ff819693f
      4a580cca
  6. Apr 04, 2017
    • Ningyuan Wang's avatar
      Allow wificond to find permission · 9282ef6b
      Ningyuan Wang authored
      This is used for wificond to check if it is allowed to dump logs.
      
      Bug: 31336376
      Test: compile, manual test
      Change-Id: I8a1b681255398f9a1f2cf79fd0891e58283aa747
      9282ef6b
    • Alex Klyubin's avatar
      Wifi Keystore HAL is not a HAL · 9a14704f
      Alex Klyubin authored
      Wifi Keystore HAL is a HwBinder service (currently offered by keystore
      daemon) which is used by Wifi Supplicant HAL. This commit thus
      switches the SELinux policy of Wifi Keystore HAL to the approach used
      for non-HAL HwBinder services.
      
      The basic idea is simimilar to how we express Binder services in the
      policy, with two tweaks: (1) we don't have 'hwservicemanager find' and
      thus there's no add_hwservice macro, and (2) we need loosen the
      coupling between core and vendor components. For example, it should be
      possible to move a HwBinder service offered by a core component into
      another core component, without having to update the SELinux policy of
      the vendor image. We thus annotate all components offering HwBinder
      service x across the core-vendor boundary with x_server, which enables
      the policy of clients to contain rules of the form:
      binder_call(mydomain, x_server), and, if the service uses IPC
      callbacks, also binder_call(x_server, mydomain).
      
      Test: mmm system/sepolicy
      Test: sesearch indicates to changes to binder { call transfer} between
            keystore and hal_wifi_supplicant_default domains
      Bug: 36896667
      
      Change-Id: I45c4ce8159b63869d7bb6df5c812c5291776d892
      9a14704f
    • Tianjie Xu's avatar
      Allow update_verifier to reboot the device · 6ca32e35
      Tianjie Xu authored
      Currently update_verifier only verifies the blocks when dm-verity is in
      'enforcing' mode; and dm-verity will reboot the device upon detection of
      errors. However, sometimes the verity mode is not guaranteed to be
      correct. When mode is 'eio' for example, dm-verity will not trigger
      a reboot but rather fail the read. So update_verifier need to take the
      responsibility to reboot the device. Otherwise the device will continue
      to boot without setting the flag "isSlotMarkedSuccessful".
      
      Denial message:
      update_verifier: type=1400 audit(0.0:18): avc: denied { write } for
      name="property_service" dev="tmpfs" ino=14678 scontext=u:r:update_verifier:s0
      tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
      
      Bug: 36260064
      Test: powerctl property sets successfully
      
      Change-Id: I1260e60f2ef4db50573e515ba95c332512c8ae62
      (cherry picked from commit 0d8c1e0a)
      6ca32e35
    • Amit Mahajan's avatar
      rild does not communicate with BT/system_server/mediaserver over sockets · 8b080ee2
      Amit Mahajan authored
      Test: manual (verified no denials in basic telephony operations)
      Bug: 36613472
      Change-Id: I31274adee2cb6293102446cd2d6d547c50616836
      8b080ee2
    • Yifan Hong's avatar
      Allow hal_sensors to use ashmem from android.hidl.allocator · d131f945
      Yifan Hong authored
      android.framework.sensorservice@1.0 pass a file
      descriptor from hidl_memory into
      android.hardware.sensors@1.0, hence requiring the latter
      to use the file descriptor.
      
      Test: VtsHalSensorManagerV1_0TargetTest under selinux
      enforcing mode
      Bug: 35219747
      Change-Id: I0185c8af0714776842c90ebb687b684324b55cd8
      d131f945
    • Alex Klyubin's avatar
      hwservicemanager is not a HAL · 7acdb58c
      Alex Klyubin authored
      This removes hwservicemanager from halserverdomain, because
      halserverdomain is only for domains which offer a HAL service.
      hwservicemanager offers HwBinder services, but those are not HAL
      services.
      
      Test: mmm system/sepolicy
      Test: Device boots, no new denials.
      Bug: 36494354
      Bug: 36896667
      Change-Id: I002e047ee1dd98f44429ab3dfe31f66dc63a8a1c
      7acdb58c
    • Ray Essick's avatar
      allow media.metrics to write to file descriptor in /data · 7218698d
      Ray Essick authored
      when GMSCore collects information for uploading via 'dumpsys
      media.metrics', it provides the metrics service with a file descriptor
      to hold the data, which is post-processed by the log collecting code
      in GMScore.  This temp file lives in /data/, a place where our
      restrictive policies for media.metrics doesn't allow any writing.
      
      This relaxes the restrictions -- allowing media.metrics to
      write to already open file descriptors it might be given on that
      partition.
      
      Bug: 36660639
      Test: build/boot
      Change-Id: Icbaa76b04ecf731014b6b1bb1283bc2951a6ae4b
      7218698d
    • Steven Moreland's avatar
      Remove hal_binderization_prop · f20c6ee7
      Steven Moreland authored
      Test: works on internal marlin
      Bug: 34274385
      Change-Id: Idd35e5cdccb595b4e5994eb1d78fdeece0aec0a6
      f20c6ee7
  7. Apr 03, 2017
    • Jeff Vander Stoep's avatar
      adbd/shell: grant access to sepolicy for cts · 892d1e40
      Jeff Vander Stoep authored
      Test: Test: make cts && \
            cts-tradefed run singleCommand cts --skip-device-info \
            --skip-preconditions --skip-connectivity-check --abi arm64-v8a \
            --module CtsSecurityHostTestCases \
            -t android.security.cts.SELinuxHostTest#testNoExemptionsForBinderInVendorBan
            Fails as expected.
      Bug: 36002573
      
      Change-Id: I298c526789b25734d5f18666c64497e5d1e181d0
      892d1e40
    • 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
    • Alex Klyubin's avatar
      No access to tee domain over Unix domain sockets · f86d54f0
      Alex Klyubin authored
      The tee domain is a vendor domain. Thus it cannot be accessed by
      non-vendor components over Unix domain sockets.
      
      It appears that the rules granting this access are not needed.
      
      Test: Flash a clean build with this change. Confirm that bullhead,
            angler, sailfish, ryu, boot without new denials.
            Confirm that YouTube, Netflix, Google Play Movies play back
            videos without new denials.
      Bug: 36714625
      Bug: 36715266
      
      Change-Id: I639cecd07c9a3cfb257e62622b51b7823613472a
      f86d54f0
    • 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
    • Ningyuan Wang's avatar
      Remove unused wificond sepolicy for dropping privileges · 9576785d
      Ningyuan Wang authored
      Bug: 36855921
      Test: compile, wifi works with toggling
      Change-Id: Ib0819a2d552472e482e192a69530441cfc2c0fd7
      9576785d
  8. 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
    • Ningyuan Wang's avatar
      Remove unused wificond sepolicy privilges · f3443ee7
      Ningyuan Wang authored
      Bug: 33239267
      Test: compile, run wifi, no selinux complaint for wificond
      Change-Id: I9b3e874381ac6cd7c6ff1058cc4f313bd85481b8
      f3443ee7
  9. Mar 31, 2017
    • Tom Cherry's avatar
      Grant vdc access to kmsg · e9614833
      Tom Cherry authored
      Init is no longer calling vdc with logwrapper, so it must take care of
      logging to kmsg directly.
      
      avc: denied { write } for pid=367 comm="vdc" name="kmsg" dev="tmpfs" ino=11056 scontext=u:r:vdc:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0
      
      Bug: 36278706
      Test: observe vdc logging in kmsg on boot and stderr on normal usage
      
      (cherry picked from commit bc4d3630)
      
      Change-Id: Id7bc2fa87518aa0678c09495267c9e198ca8c968
      e9614833
    • Shubang's avatar
      Add sepolicy for tv.input · c76e158c
      Shubang authored
      Test: build, flash; adb shell lshal
      Bug: 36562029
      Change-Id: If8f6d8dbd99d31e6627fa4b7c1fd4faea3b75cf2
      c76e158c
    • 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
    • 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
  10. Mar 30, 2017
    • Chad Brubaker's avatar
      Further lock down access to services from ephemeral apps · 7d01a99a
      Chad Brubaker authored
      This removes access to
      * contexthub_service
      * device_policy_service
      * ethernet_service
      * fingerprint_service
      * shortcut_service
      * trust_service
      * usb_service
      
      Test: cts-tradefed run commandAndExit cts-dev -m
      CtsAppSecurityHostTestCases -t
      android.appsecurity.cts.EphemeralTest
      Bug: 33349998
      
      Change-Id: Iad9302041d7674ae6ebeb1c559c64d13df62c304
      7d01a99a
    • Mathias Agopian's avatar
      update sepolicy for gralloc HAL · 9901ff7c
      Mathias Agopian authored
      the list to update was determined by looking
      at who currently has access to surfaceflinger
      for ipc and FD use.
      
      Test: try some media stuff
      Bug: 36333314
      Change-Id: I474d0c44f8cb3868aad7a64e5a3640cf212d264d
      9901ff7c
    • Jeff Vander Stoep's avatar
      runas: Grant access to seapp_contexts_file · 7d6185fe
      Jeff Vander Stoep authored
      Runas/libselinux needs access to seapp_contexts_file to determine
      transitions into app domains.
      
      Addresses:
      avc: denied { read } for pid=7154 comm="run-as" name="plat_seapp_contexts"
      dev="rootfs" ino=9827 scontext=u:r:runas:s0
      tcontext=u:object_r:seapp_contexts_file:s0 tclass=file
      
      Bug: 36782586
      Test: Marlin policy builds
      Change-Id: I0f0e937e56721d458e250d48ce62f80e3694900f
      7d6185fe
Loading