Skip to content
Snippets Groups Projects
  1. Jul 12, 2017
    • Peng Xu's avatar
      Allow system to dump sensor hal process · e4968f90
      Peng Xu authored
      Test: tested taking bugreport, sensor HAL traces show up in
            "VM TRACES JUST NOW"
      Test: tested trigger ANR by `adb shell am hang --allow-restart`,
            sensor HAL traces shows up in /data/anr/traces.txt
      Bug: 63096400
      Change-Id: I1d012b9d9810f987be7aaf9d68abfd9c3184ac5c
      e4968f90
  2. Jul 05, 2017
    • Jeff Vander Stoep's avatar
      Preserve attributes needed for CTS · 5f5aa962
      Jeff Vander Stoep authored
      Change fb889f23 "Force expand all hal_* attributes" annotated all
      hal_* attributes to be expanded to their associated types. However
      some of these attributes are used in CTS for neverallow checking.
      Mark these attributes to be preserved.
      
      In addition, remove the hacky workaround introduced in oc-dev
      for b/62658302 where extraneous neverallow rules were introduced
      to prevent unused or negated attributes from being auto-expanded
      from policy.
      
      Bug: 62658302
      Bug: 63135903
      Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t \
          android.cts.security.SELinuxNeverallowRulesTest
      
          armeabi-v7a CtsSecurityHostTestCases completed in 4s.
          501 passed, 0 failed, 0 not executed
      Merged-In: I989def70a16f66e7a18bef1191510793fbe9cb8c
      Change-Id: I989def70a16f66e7a18bef1191510793fbe9cb8c
      5f5aa962
  3. Jun 29, 2017
    • Jeff Vander Stoep's avatar
      hal_tetheroffload: Grant permissions · e58a8de5
      Jeff Vander Stoep authored
      avc: denied { read write } scontext=u:r:ipacm:s0
      tcontext=u:r:system_server:s0 tclass=netlink_netfilter_socket
      avc: denied { setopt } scontext=u:r:ipacm:s0
      tcontext=u:r:system_server:s0 tclass=netlink_netfilter_socket
      avc: denied { getattr } scontext=u:r:ipacm:s0
      tcontext=u:r:system_server:s0 tclass=netlink_netfilter_socket
      avc: denied { create } for scontext=u:r:system_server:s0
      tcontext=u:r:system_server:s0 tclass=netlink_netfilter_socket
      
      Bug: 29337859
      Bug: 32163131
      Test: adb shell getenforce
      Enforcing
      adb shell dumpsys connectivity tethering
      Tethering:
        ...
        Log:
          ...
          06-28 11:46:58.841 - SET master tether settings: ON
          06-28 11:46:58.857 - [OffloadController] tethering offload started
      And logs show some signs of happiness:
          06-28 11:46:58.853   816   947 I IPAHALService: IPACM was provided two FDs (18, 19)
          06-28 11:46:58.853  1200  1571 I zygote64: Looking for service android.hardware.tetheroffload.control@1.0::IOffloadControl/default
      Change-Id: I0c63bd2de334b4ca40e54efb9df4ed4904667e21
      e58a8de5
  4. Jun 26, 2017
    • Jeff Vander Stoep's avatar
      Suppress su access to pdx sockets · 4b7cf4fb
      Jeff Vander Stoep authored
      Su runs in permissive mode and denials should be suppressed.
      
      avc: denied { getattr } for scontext=u:r:su:s0
      tcontext=u:object_r:pdx_display_client_endpoint_socket:s0
      tclass=unix_stream_socket permissive=1
      avc: denied { getattr } for scontext=u:r:su:s0
      tcontext=u:object_r:pdx_display_manager_endpoint_socket:s0
      tclass=unix_stream_socket permissive=1
      avc: denied { getattr } for scontext=u:r:su:s0
      tcontext=u:object_r:pdx_display_vsync_endpoint_socket:s0
      tclass=unix_stream_socket permissive=1
      avc: denied { getattr } for scontext=u:r:su:s0
      tcontext=u:object_r:pdx_bufferhub_client_endpoint_socket:s0
      tclass=unix_stream_socket permissive=1
      avc: denied { getattr } for scontext=u:r:su:s0
      tcontext=u:object_r:pdx_performance_client_endpoint_socket:s0
      tclass=unix_stream_socket permissive=1
      
      Bug: 35197529
      Test: policy builds
      Change-Id: Ia643c6e776e5e5bd473d857d523c3be91d32c40a
      4b7cf4fb
    • Jeff Vander Stoep's avatar
      Add another extraneous neverallow rule to force attribute inclusion · c75aa50d
      Jeff Vander Stoep 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: 62658302
      Bug: 62999603
      Test: Build Marlin policy.
      Test: verify attribute exists in policy using sepolicy-analyze.
          sepolicy-analyze $OUT/vendor/etc/selinux/precompiled_sepolicy \
          attribute hal_tetheroffload_server
      Test: CTS neverallow tests pass.
          cts-tradefed run cts -m CtsSecurityHostTestCases -t \
          android.cts.security.SELinuxNeverallowRulesTest
      Change-Id: I62596ba8198ffdcbb4315df639a834e4becaf249
      c75aa50d
  5. Jun 23, 2017
    • Jeff Vander Stoep's avatar
      system_server is a client of configstore · 23e0a7f2
      Jeff Vander Stoep authored
      avc:  denied  { find } for
      interface=android.hardware.configstore::ISurfaceFlingerConfigs
      scontext=u:r:system_server:s0
      tcontext=u:object_r:hal_configstore_ISurfaceFlingerConfigs:s0
      tclass=hwservice_manager permissive=0
      
      Bug: 35197529
      Test: Device boots without this denial
      Change-Id: Ia43bc5879e03a1f2056e373b17cc6533636f98b1
      23e0a7f2
    • Narayan Kamath's avatar
      DO NOT MERGE ANYWHERE Revert "SEPolicy: Changes for new stack dumping scheme." · 034f5840
      Narayan Kamath authored
      NOTE: This change is marked dnma because we don't want it on
      oc-dr1-dev-plus-aosp or any other downstream branch. Moreover,
      oc-dr1-dev-plus-aosp is the only outgoing merger from oc-dr1-dev for
      this project.
      
      This reverts commit 11bfcc1e.
      
      Bug: 62908344
      Test: make
      Change-Id: Ide61829cf99f15777c46f657a0e140d594f88243
      034f5840
  6. Jun 21, 2017
    • Jeff Vander Stoep's avatar
      Exempt tetheroffload hal from network socket restrictions · d75a2c0c
      Jeff Vander Stoep authored
      The tetheroffload hal must be able to use network sockets as part of
      its job.
      
      Bug: 62870833
      Test: neverallow-only change builds.
      Change-Id: I630b36340796a5ecb5db08e732b0978dd82835c7
      d75a2c0c
    • Dan Cashman's avatar
      Remove neverallow preventing hwservice access for apps. · 3e307a4d
      Dan Cashman authored
      Same-process HALs are forbidden except for very specific HALs that have
      been provided and whitelisted by AOSP.  As a result, a vendor extension
      HAL may have a need to be accessed by untrusted_app.  This is still
      discouraged, and the existing AOSP hwservices are still forbidden, but
      remove the blanket prohibition.  Also indicate that this is temporary,
      and that partners should expect to get exceptions to the rule into AOSP
      in the future.
      
      Bug: 62806062
      Test: neverallow-only change builds.  Verify new attribute is in policy.
      Change-Id: I6d3e659147d509a3503c2c9e0b6bb9016cc75832
      3e307a4d
  7. Jun 20, 2017
  8. Jun 19, 2017
    • Tom Cherry's avatar
      Add getpgid to system_service and init · d5f0aba0
      Tom Cherry authored
      In libprocessgroup, we want to only send signals once to processes,
      particularly for SIGTERM.  We must send the signal both to all
      processes within a POSIX process group and a cgroup.  To ensure that
      we do not duplicate the signals being sent, we check the processes in
      the cgroup to see if they're in the POSIX process groups that we're
      killing.  If they are, we skip sending a second signal.  This requires
      getpgid permissions, hence this SELinux change.
      
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:system_app:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=797 comm="ActivityManager" scontext=u:r:system_server:s0 tcontext=u:r:system_app:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:zygote:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:zygote:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:system_server:s0 tclass=process permissive=1
      avc: denied { getpgid } for pid=1 comm="init" scontext=u:r:init:s0 tcontext=u:r:system_server:s0 tclass=process permissive=1
      
      Bug: 37853905
      Bug: 62418791
      Test: Boot, kill zygote, reboot
      Change-Id: Ib6c265dbaac8833c47145ae28fb6594ca8545570
      (cherry picked from commit c59eb4d8)
      d5f0aba0
  9. 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
  10. Jun 14, 2017
  11. Jun 08, 2017
  12. Jun 06, 2017
  13. Jun 05, 2017
    • Josh Gao's avatar
      crash_dump_fallback: allow dumpstate:pipe_file write. · 7aa08523
      Josh Gao authored
      It appears that selinux requires the write permission to receive
      a writable pipe from dumpstate, for unclear reasons. Add the permission
      for now.
      
      Bug: http://b/62297059
      Test: dumpstate
      Change-Id: I0f25682177115aacd5c2203ddc0008228b0380ad
      7aa08523
    • Sandeep Patil's avatar
      Fix coredomain violation for modprobe · e41af203
      Sandeep Patil authored
      
      modprobe domain was allowed to launch vendor toolbox even if its a
      coredomain. That violates the treble separation. Fix that by creating a
      separate 'vendor_modprobe' domain that init is allowed to transition to
      through vendor_toolbox.
      
      Bug: 37008075
      Test: Build and boot sailfish
      
      Change-Id: Ic3331797691bb5d1fdc05a674aa4aa313e1f86b2
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      (cherry picked from commit 9e366a0e)
      e41af203
  14. Jun 02, 2017
  15. Jun 01, 2017
    • Steve Muckle's avatar
      allow modprobe to load signed kernel modules · 53add31a
      Steve Muckle authored
      Modprobe requires this permission or the following denial will
      prevent loading of signed kernel modules:
      
      audit: type=1400 audit(27331649.656:4): avc:  denied  { search } for
      pid=448 comm="modprobe" scontext=u:r:modprobe:s0 tcontext=u:r:kernel:s0
      tclass=key permissive=0
      
      Bug: 62256697
      Test: Verified signed module loading on sailfish.
      Change-Id: Idde41d1ab58e760398190d6686665a252f1823bb
      53add31a
    • Neil Fuller's avatar
      Enable the TimeZoneManagerService · ca595e11
      Neil Fuller authored
      Add policy changes to enable a new service. The service
      is currently switched off in config, but this change is
      needed before it could be enabled.
      
      Bug: 31008728
      Test: make droid
      Merged-In: I29c4509304978afb2187fe2e7f401144c6c3b4c6
      Change-Id: I29c4509304978afb2187fe2e7f401144c6c3b4c6
      ca595e11
  16. May 31, 2017
    • Neil Fuller's avatar
      Enable the TimeZoneManagerService · 50889ce0
      Neil Fuller authored
      Add policy changes to enable a new service. The service
      is currently switched off in config, but this change is
      needed before it could be enabled.
      
      Bug: 31008728
      Test: make droid
      Change-Id: I29c4509304978afb2187fe2e7f401144c6c3b4c6
      50889ce0
    • 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
    • Andrew Scull's avatar
      Add missing sepolicies for OemLock HAL. · 475954da
      Andrew Scull authored
      Bug: 38232801
      Test: Build
      
      Change-Id: Iccc16430e7502bb317f95bb2a5e2f021d8239a00
      475954da
    • Andrew Scull's avatar
      Add missing sepolicies for the Weaver HAL. · a939c432
      Andrew Scull authored
      Bug: 38233550
      Test: Build
      Change-Id: I7c2105d5f215a60a611110640afff25fc3403559
      a939c432
    • 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
  17. May 30, 2017
    • Narayan Kamath's avatar
      SEPolicy: Changes for new stack dumping scheme. · 11bfcc1e
      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)
      
      Change-Id: I70a3e6e230268d12b454e849fa88418082269c4f
      11bfcc1e
  18. May 26, 2017
  19. May 25, 2017
    • Yifan Hong's avatar
      Update selinux policy for policyvers retrieval. · 5b3494eb
      Yifan Hong authored
      Test: pass
      Bug: 62073522
      Change-Id: I3d53d0d5ec701c87fb3d45080799f424f7ba3792
      5b3494eb
    • Jeff Vander Stoep's avatar
      Force expand all hal_* attributes · fb889f23
      Jeff Vander Stoep authored
      Cutting down on the number of attributes associated with each type
      speeds up policy lookup times when there is an access vector cache
      miss.
      
      This change cuts down on the number of attributes associate with
      system_server from 19 to 8. The total number of attributes is
      reduced from 159 to 64.
      
      Bug: 36508258
      Test: build and boot Marlin
      Change-Id: I8cdb6fb783ded869e88c5a9868fd7c8f838190f9
      fb889f23
  20. May 24, 2017
    • Sandeep Patil's avatar
      Allow init to run vendor toybox for modprobe · d46b5d35
      Sandeep Patil authored
      
      vendor implementations need to be able to run modprobe as part of
      init.rc scripts.  They cannot do so because of the strict neverallow
      currently in place that disallows all coredomains (including init)
      to execute vendor toybox.
      
      Fix this by adding init to the exception list for the neverallow so
      vendors can then run modprobe from .rc scripts and also add the rule to
      allow init to transition to modprobe domain using vendor_toolbox.
      
      Bug: b/38212864
      Test: Boot sailfish
      
      Change-Id: Ib839246954e9002859f3ba986094f206bfead137
      Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
      d46b5d35
    • Josh Gao's avatar
      Let fallback crash dumping write to dumpstate pipes. · 8ba3138a
      Josh Gao authored
      Fix the following denial:
          avc: denied { append } for pid=1093 comm="mediaextractor" path="pipe:[68438]" dev="pipefs" ino=68438 scontext=u:r:mediaextractor:s0 tcontext=u:r:dumpstate:s0 tclass=fifo_file permissive=1 ppid=1 pcomm="init" pgid=1 pgcomm="init"
      
      Bug: http://b/38444258
      Test: none
      Change-Id: I58162e3a28b744a58396e77d6b0e2becb5633d6a
      (cherry picked from commit 5efadd91)
      8ba3138a
    • Andy Hung's avatar
      MediaExtractor: Allow reading of app data files. · ec5f80cb
      Andy Hung authored
      Needed to allow lower power Play Music of downloaded files.
      
          05-24 10:12:49.331 24025 24025 W generic : type=1400
                audit(0.0:1259): avc: denied { read } for
                path="/data/data/com.google.android.music/files/music/925.mp3"
                dev="sda35" ino=2179256 scontext=u:r:mediaextractor:s0
                tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file
                permissive=0
      
      Test: Play Music
      Bug: 62059834
      
      Change-Id: I97bdb1d175dba8f7a8ec6cd9084323cfcd3660bd
      ec5f80cb
    • Josh Gao's avatar
      Let fallback crash dumping write to dumpstate pipes. · 5efadd91
      Josh Gao authored
      Fix the following denial:
          avc: denied { append } for pid=1093 comm="mediaextractor" path="pipe:[68438]" dev="pipefs" ino=68438 scontext=u:r:mediaextractor:s0 tcontext=u:r:dumpstate:s0 tclass=fifo_file permissive=1 ppid=1 pcomm="init" pgid=1 pgcomm="init"
      
      Bug: http://b/38444258
      Test: none
      Change-Id: I58162e3a28b744a58396e77d6b0e2becb5633d6a
      5efadd91
  21. May 23, 2017
    • pkanwar's avatar
      SE Policy for Tether Offload HAL · c67fa9bf
      pkanwar authored
      Update SE Policy to allow calls to and callbacks for the Tether Offload HAL
      HIDL binderized service.
      
      Bug: 38417260
      Test: New functionality. So we don't have any tests.
      Change-Id: I2c95b290523c55c081afa1bca091f368559c9125
      (cherry picked from commit 722249b3)
      c67fa9bf
    • pkanwar's avatar
      SE Policy for Tether Offload HAL · 722249b3
      pkanwar authored
      Update SE Policy to allow calls to and callbacks for the Tether Offload HAL
      HIDL binderized service.
      
      Bug: 38417260
      Test: New functionality. So we don't have any tests.
      Change-Id: I2c95b290523c55c081afa1bca091f368559c9125
      722249b3
Loading