Skip to content
Snippets Groups Projects
  1. Oct 03, 2017
  2. Sep 26, 2017
  3. Aug 29, 2017
    • Ed Coyne's avatar
      Allow sepolicies granting bootanim exec on /oem. · 6a1e6a9c
      Ed Coyne authored
      Iot would like to allow bootanim to load libraries from /oem but in order for
      device-specfic sepolicies to grant exec this global restriction needs to
      be relaxed.
      
      Bug: 37992717
      Test: Tested with Iot sepolicies in effect and bootanim can exec.
      Change-Id: I6462bf510562eb3fb06304e50b68fba05d37b285
      6a1e6a9c
  4. Aug 28, 2017
    • Jeff Vander Stoep's avatar
      Allow all domains to stat symlinks in sysfs · 8d021a94
      Jeff Vander Stoep authored
      This is needed to retain app's previous access to
      /sys/devices/system/cpu. When these files were previously
      labeled in file_contexts, symlinks were labeled as
      sysfs_devices_system_cpu. When labeling was moved to genfs_contexts
      symlinks all have the default sysfs label.
      
      avc: denied { getattr } for comm="main"
      path="/sys/devices/system/cpu/cpu0/cpufreq" dev="sysfs" ino=41897
      scontext=u:r:untrusted_app_25:s0:c512,c768
      tcontext=u:object_r:sysfs:s0 tclass=lnk_file permissive=0
      
      Change-Id: Idaa565390bca13d3819e147fcea4214956c0f589
      Bug: 64270911
      Test: build aosp_marlin
      8d021a94
  5. Aug 23, 2017
  6. Jul 10, 2017
    • Stephen Smalley's avatar
      sepolicy: Define and allow map permission · 4397f082
      Stephen Smalley authored
      
      Kernel commit 3ba4bf5f1e2c ("selinux: add a map permission check for mmap")
      added a map permission check on mmap so that we can
      distinguish memory mapped access (since it has different implications
      for revocation).  The purpose of a separate map permission check on
      mmap(2) is to permit policy to prohibit memory mapping of specific files
      for which we need to ensure that every access is revalidated, particularly
      useful for scenarios where we expect the file to be relabeled at runtime
      in order to reflect state changes (e.g. cross-domain solution, assured
      pipeline without data copying).  The kernel commit is anticipated to
      be included in Linux 4.13.
      
      This change defines map permission for the Android policy.  It mirrors
      the definition in the kernel classmap by adding it to the common
      definitions for files and sockets.  This will break compatibility for
      kernels that predate the dynamic class/perm mapping support (< 2.6.33);
      on such kernels, one would instead need to add map permission
      to the end of each file and socket access vector.
      
      This change also adds map permission to the global macro definitions for
      file permissions, thereby allowing it in any allow rule that uses these
      macros, and to specific rules allowing mapping of files from /system
      and executable types. This should cover most cases where it is needed,
      although it may still need to be added to specific allow rules when the
      global macros are not used.
      
      Test: Policy builds
      
      Change-Id: Iab3ccd2b6587618e68ecab58218838749fe5e7f5
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      4397f082
  7. Jun 16, 2017
    • Dan Cashman's avatar
      Add extraneous neverallow rule to enforce attribute inclusion. · 939b50ff
      Dan Cashman authored
      Due to the massively increased number of attributes in SELinux policy
      as part of the treble changes, we have had to remove attributes from
      policy for performance reasons.  Unfortunately, some attributes are
      required to be in policy to ensure that our neverallow rules are being
      properly enforced.  Usually this is not a problem, since neverallow rules
      indicate that an attribute should be kept, but this is not currently the
      case when the attribute is part of a negation in a group.
      
      This is particularly problematic with treble since some attributes may
      exist for HALs that have no implementation, and thus no types.  In
      particular, this has caused an issue with the neverallows added in our
      macros.  Add an extraneous neverallow rule to each of those auto-generated
      neverallow rules to make sure that they are not removed from policy, until
      the policy compiler is fixed to avoid this.  Also add corresponding rules
      for other types which have been removed due to no corresponding rules.
      
      Bug: 62591065
      Bug: 62658302
      Test: Attributes present in policy and CTS passes.  sepolicy-analyze also
      works on platform-only policy.
      Change-Id: Ic3fc034cdbd04a94167f8240cf562297e8d7c762
      939b50ff
  8. May 31, 2017
    • Andrew Scull's avatar
      Allow bootctl HAL to access misc block device. · b0d59450
      Andrew Scull authored
      This is sometimes used for communication with the bootloader.
      
      Bug: 62052545
      Test: Build
      Change-Id: I3ae37793407719e55ab0830129aa569c9018f7da
      b0d59450
    • Narayan Kamath's avatar
      SEPolicy: Changes for new stack dumping scheme. · f194aad2
      Narayan Kamath authored
      Applications connect to tombstoned via a unix domain socket and request
      an open FD to which they can write their traces. This socket has a new
      label (tombstoned_java_trace_socket) and appdomain and system_server are
      given permissions to connect and write to it.
      
      Apps no longer need permissions to open files under /data/anr/ and
      these permissions will be withdrawn in a future change.
      
      Bug: 32064548
      Test: Manual
      
      (cherry picked from commit a8832dabc7f3b7b2381760d2b95f81abf78db709)
      
      (cherry picked from commit 11bfcc1e)
      
      Change-Id: Icc60d227331c8eee70a9389ff1e7e78772f37e6f
      f194aad2
    • Narayan Kamath's avatar
      SEPolicy: Changes for new stack dumping scheme. · e628cb5b
      Narayan Kamath authored
      Applications connect to tombstoned via a unix domain socket and request
      an open FD to which they can write their traces. This socket has a new
      label (tombstoned_java_trace_socket) and appdomain and system_server are
      given permissions to connect and write to it.
      
      Apps no longer need permissions to open files under /data/anr/ and
      these permissions will be withdrawn in a future change.
      
      Bug: 32064548
      Test: Manual
      
      Merged-In: I70a3e6e230268d12b454e849fa88418082269c4f
      Change-Id: Ib4b73fc130f4993c44d96c8d68f61b6d9bb2c7d5
      e628cb5b
  9. May 10, 2017
    • Alex Vakulenko's avatar
      SELinux policies for PDX services · 41daa7f8
      Alex Vakulenko authored
      Specify per-service rules for PDX transport. Now being able to
      grant permissions to individual services provided by processes,
      not all services of a process.
      
      Also tighter control over which permissions are required for
      client and server for individual components of IPC (endpoints,
      channels, etc).
      
      Bug: 37646189
      Change-Id: I78eb8ae8b6e08105666445a66bfcbd2f1d69d0ea
      41daa7f8
  10. Apr 28, 2017
    • Jeff Vander Stoep's avatar
      Add default label and mapping for vendor services · 082eae4e
      Jeff Vander Stoep authored
      Adding the default label/mapping is important because:
      1.  Lookups of services without an selinux label should generate
          a denial.
      2.  In permissive mode, lookups of a service without a label should be
          be allowed, without the default label service manager disallows
          access.
      3.  We can neverallow use of the default label.
      
      Bug: 37762790
      Test: Build and flash policy onto Marlin with unlabeled vendor services.
          Add/find of unlabeled vendor services generate a denial.
      
      Change-Id: I66531deedc3f9b79616f5d0681c87ed66aca5b80
      (cherry picked from commit 639a2b84)
      082eae4e
  11. Apr 26, 2017
    • Nick Kralevich's avatar
      relax fuse_device neverallow rules · 45766d41
      Nick Kralevich authored
      The fuse_device neverallow rules are too aggressive and are inhibiting
      certain vendor customizations. Relax the /dev/fuse neverallow rules so
      that they better reflect the security invariants we want to uphold.
      
      Bug: 37496487
      Test: policy compiles.
      Change-Id: Ie73b0ba7c76446afc2a7a23ebed1275c977d932d
      45766d41
  12. Apr 25, 2017
    • Alex Klyubin's avatar
      Assert ban on framework <-> vendor comms over VndBinder · 00657834
      Alex Klyubin authored
      This adds neverallow rules which enforce the prohibition on
      communication between framework and vendor components over VendorBinder.
      This prohibition is similar in spirit to the one for Binder
      communications.
      
      Most changes consist of adding neverallow rules, which do not affect
      runtime behavior. The only change which does affect runtime behavior
      is the change which takes away the right of servicemanager domain to
      transfer Binder tokens to hwservicemanager and vndservicemanager. This
      grant was there by accident (because it was overly broad) and is not
      expected to be needed: servicemanager, hwservicemanager, and
      vndservicemanager are not supposed to be communicating with each
      other.
      
      P. S. The new neverallow rules in app_neverallows.te are covered by
      the new rules in domain.te. The rules were nevertheless added to
      app_neverallows.te for consistency with other *Binder rules there.
      
      Test: mmm system/sepolicy
      Bug: 37663632
      Change-Id: I7c2ae23924bf0f2fed3f1e3a8d4d603129286329
      00657834
  13. Apr 24, 2017
    • Alex Klyubin's avatar
      Assert apps can access only approved HwBinder services · 2a7f4fb0
      Alex Klyubin authored
      App domains which host arbitrary code must not have access to
      arbitrary HwBinder services. Such access unnecessarily increases the
      attack surface. The reason is twofold:
      1. HwBinder servers do not perform client authentication because HIDL
         currently does not expose caller UID information and, even if it
         did, many HwBinder services either operate at a layer below that of
         apps (e.g., HALs) or must not rely on app identity for
         authorization. Thus, to be safe, the default assumption is that
         a HwBinder service treats all its clients as equally authorized to
         perform operations offered by the service.
      2. HAL servers (a subset of HwBinder services) contain code with
         higher incidence rate of security issues than system/core
         components and have access to lower layes of the stack (all the way
         down to hardware) thus increasing opportunities for bypassing the
         Android security model.
      
      HwBinder services offered by core components (as opposed to vendor
      components) are considered safer because of point #2 above.
      
      Always same-process aka always-passthrough HwBinder services are
      considered safe for access by these apps. This is because these HALs
      by definition do not offer any additional access beyond what its
      client already as, because these services run in the process of the
      client.
      
      This commit thus introduces these two categories of HwBinder services
      in neverallow rules.
      
      Test: mmm system/sepolicy -- this does not change on-device policy
      Bug: 34454312
      Change-Id: I4f5f4dd10b3fc3bb9d262dda532d4a23dcdf061d
      2a7f4fb0
  14. Apr 21, 2017
    • Alex Klyubin's avatar
      Restrict access to hwservicemanager · 53656c17
      Alex Klyubin authored
      This adds fine-grained policy about who can register and find which
      HwBinder services in hwservicemanager.
      
      Test: Play movie in Netflix and Google Play Movies
      Test: Play video in YouTube app and YouTube web page
      Test: In Google Camera app, take photo (HDR+ and conventional),
            record video (slow motion and normal), and check that photos
            look fine and videos play back with sound.
      Test: Cast screen to a Google Cast device
      Test: Get location fix in Google Maps
      Test: Make and receive a phone call, check that sound works both ways
            and that disconnecting the call frome either end works fine.
      Test: Run RsHelloCompute RenderScript demo app
      Test: Run fast subset of media CTS tests:
            make and install CtsMediaTestCases.apk
            adb shell am instrument -e size small \
                -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
      Test: Play music using Google Play music
      Test: Adjust screen brightness via the slider in Quick Settings
      Test: adb bugreport
      Test: Enroll in fingerprint screen unlock, unlock screen using
            fingerprint
      Test: Apply OTA update:
            Make some visible change, e.g., rename Settings app.
            make otatools && \
            make dist
            Ensure device has network connectivity
            ota_call.py -s <serial here> --file out/dist/sailfish-ota-*.zip
            Confirm the change is now live on the device
      Bug: 34454312
      (cherry picked from commit 632bc494)
      Merged-In: Iecf74000e6c68f01299667486f3c767912c076d3
      Change-Id: I7a9a487beaf6f30c52ce08e04d415624da49dd31
      53656c17
    • Jaekyun Seok's avatar
      Allow installd to read vendor_overlay_file · aeada247
      Jaekyun Seok authored
      installd needs to check whether idmap is outdated or not compared to
      vendor overlay file.
      
      Test: building succeeded and tested on sailfish.
      Bug: 37179531
      Change-Id: I934c1ae39e3f806bca1e3d68cf8190addeebb499
      aeada247
  15. Apr 20, 2017
  16. Apr 18, 2017
    • Dan Cashman's avatar
      Remove vndservice_manager object classes. · 2f1c7ba7
      Dan Cashman authored
      vndservicemanager is a copy of servicemanager, and so has the exact
      same properties.  This should be reflected in the sharing of an object
      manager in SELinux policy, rather than creating a second one, which is
      effectively an attempt at namespacing based on object rather than type
      labels.  hwservicemanager, however, provides different and additional
      functionality that may be reflected in changed permissions, though they
      currently map to the existing servicemanager permissions.  Keep the new
      hwservice_manager object manager but remove the vndservice_manager one.
      
      Bug: 34454312
      Bug: 36052864
      Test: policy builds and device boots.
      Change-Id: I9e0c2757be4026101e32ba780f1fa67130cfa14e
      2f1c7ba7
  17. Apr 15, 2017
    • Sandeep Patil's avatar
      Add vendor_executes_system_violators attribute · b99676ee
      Sandeep Patil authored
      
      Temporary attribute (checked against in CTS) to point out vendor
      processes that run /system executables. These are currently only down to
      2-3 of them that are related to telephony on sailfish
      
      Bug: 36463595
      Test: Build succeeds for sailfish
      Test: ./cts-tradefed run cts -m CtsSecurityHostTestCases -t \
                android.security.cts.SELinuxHostTest#testNoExemptionsForVendorExecutingCore \
                --skip-device-info --skip-preconditions --skip-connectivity-check \
                --abi arm64-v8a
      
      Change-Id: I9eb40ad259aefba73869d6a1b40186d33fa475dd
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      b99676ee
    • Sandeep Patil's avatar
      add netutils_wrappers · c6d89024
      Sandeep Patil authored
      
      Bug: 36463595
      Test: Boot sailfish, make wifi call, internet over data and wifi
      
      Change-Id: I81259b6412d7197725afe2fe4976aa0a03b8df6e
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      c6d89024
  18. Apr 14, 2017
  19. Apr 13, 2017
    • Alex Klyubin's avatar
      Unbreak user builds · d9745f3d
      Alex Klyubin authored
      This unbreaks user builds broken by recently landed changes to secilc
      which is now aggressively removing attributes which aren't used in
      allow rules, even when they are used in other places, such as being
      referenced from *_contexts files.
      
      User builds are broken by vndservice_manager_type not being found when
      checkfc is run for *vndservice_contexts targets.
      
      Test: On a clean user build: mmma system/sepolicy
      Bug: 37319524
      Bug: 36508258
      Change-Id: I4a1727a74122ecd9020c3831462d56a65ee6d304
      d9745f3d
    • Martijn Coenen's avatar
      Add temporary allow rule for hwservice_manager_type · 20716c7e
      Martijn Coenen authored
      So it won't get compiled out of sepolicy.
      
      Test: marlin build
      Change-Id: I3a089fe83df69a76bebf64f874556967bc49ee78
      20716c7e
    • Martijn Coenen's avatar
      Add hwservice_contexts and support for querying it. · 3ea47b92
      Martijn Coenen authored
      hwservicemanager can check hwservice_contexts files
      both from the framework and vendor partitions.
      
      Initially, have a wildcard '*' in hwservice_contexts
      that maps to a label that can be added/found from
      domain. This needs to be removed when the proper policy
      is in place.
      
      Also, grant su/shell access to hwservicemanager list
      operations, so tools like 'lshal' continue to work.
      
      Bug: 34454312
      Test: Marlin boots
      Change-Id: I3a02d97a82458692b528d85c1b8e78b6f82ea1bc
      3ea47b92
  20. Apr 12, 2017
  21. Apr 11, 2017
    • Jaesoo Lee's avatar
      allow to load kernel modules from vendor partition · a6ac1147
      Jaesoo Lee authored
      The kernel  modules under /vendor partition has been relabeled to vendor_file.
      This CL allows for the modprobe to load modules labeled vendor_file.
      
      Kernel modules are loaded in init.rc with following commands:
          exec u:r:modprobe:s0 -- /system/bin/modprobe -d /vendor/lib/modules MODULE
      
      Bug: 35653245
      Test: tested on sailfish
      Change-Id: I2132ca4de01c5c60476dad8496e98266de5a1bb7
      a6ac1147
  22. 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
  23. 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
  24. Apr 06, 2017
Loading