Skip to content
Snippets Groups Projects
  1. 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
  2. Sep 18, 2018
    • Tri Vo's avatar
      system_writes_mnt_vendor_violators for device launched before P. · ca4217e2
      Tri Vo authored
      In cases when a device upgrades to system-as-root from O to P, it needs a mount
      point for an already existing partition that is accessed by both system and
      vendor.
      
      Devices launching with P must not have /mnt/vendor accessible to system.
      
      Bug: 78598545
      Test: m selinx_policy
      Change-Id: Ia7bcde44e2b8657a7ad9e0d9bae7a7259f40936f
      ca4217e2
  3. 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
  4. Sep 13, 2018
    • Nick Kralevich's avatar
      crash_dump: remove /system/bin/logcat execute permissions · 702fd0af
      Nick Kralevich authored
      Currently, crash_dump has the following line:
      
        read_logd(crash_dump)
      
      which is a macro defined as:
      
        #####################################
        # read_logd(domain)
        # Ability to run logcat and read from android
        # log daemon via sockets
        define(`read_logd', `
        allow $1 logcat_exec:file rx_file_perms;
        unix_socket_connect($1, logdr, logd)
        ')
      
      which grants both the ability to talk directly to a logd socket, as well
      as the ability to execute the /system/bin/logcat command line tool.
      
      This is unneeded (and problematic) for crash_dump. Crash_dump uses
      standard, vndk approved libraries to talk directly to logd. It never
      exec()s the (non-vndk approved) logcat command.
      
      As crash_dump is a vndk approved component and executed by vendor code,
      allowing this transitively makes /system/bin/logcat a vndk component
      too, which we want to avoid.
      
      Instead of using the read_logd() macro, just directly add the
      unix_socket_connect() call. This allows talking directly to logd, but
      blocks the use of the (unneeded) /system/bin/logcat executable.
      
      Test: crasher binary still works when executed from adb shell
      Change-Id: I1fe9d0f5f0234c96454a0d91338fa2656f083345
      702fd0af
    • Hridya Valsaraju's avatar
      Allow fastbootd to wipe metadata. · 073efc34
      Hridya Valsaraju authored
      Metadata needs to be erased as part of fastboot flashall -w.
      
      Test: fastboot erase metadata
      Bug: 113648914
      Change-Id: I38a0debd9face16cad9d9a13a48549f3f58652fa
      073efc34
    • Yangster's avatar
      Allow stats_companion to register thermal throttling event listener. · f8c2c14a
      Yangster authored
      Test: manual test
      
      BUG: b/112432890
      Change-Id: If703cd25a2c0864ffd49bfdc83821fae291974b5
      f8c2c14a
  5. Sep 12, 2018
  6. Sep 11, 2018
    • Tao Bao's avatar
      Whitelist minui properties to be overridden by /vendor/default.prop. · 703acc6a
      Tao Bao authored
      These values will be read by platform module (/sbin/charger), and need
      to be configurable by vendor init.
      
      Bug: 113567255
      Test: Build along with other CLs in the topic (for Makefile and
            libminui changes). Boot into charger mode.
      Test: Boot into recovery. Run graphics test.
      Change-Id: I5b272f345e2a5a255c2f660c59c1da3245aa1e03
      703acc6a
    • Torne (Richard Coles)'s avatar
      Allow shared_relro to access PackageManager. · 0f326f3c
      Torne (Richard Coles) authored
      Allow the shared_relro creation process to make calls to PackageManager,
      so that it can create a classloader corresponding to the current WebView
      implementation. This avoids needing to pass an absolute path to the
      native library to the process, which required that the calling code
      duplicate existing logic in the framework to find the library and
      resulted in bugs and inconsistencies.
      
      Bug: 110790153
      Test: WebView-related CTS and GTS tests
      Change-Id: I9902bb0400e2a800021dac06278151c8541d458f
      0f326f3c
    • Martijn Coenen's avatar
      Allow init to use binder. · a720d3d0
      Martijn Coenen authored
      But in a very restricted form:
      1) Nobody can initiate calls into init
      2) Nobody can transfer binder objects into init, except servicemanager
      
      Bug: 112684055
      Test: device boots
      Change-Id: Icfb218f2871e234284c74e096eccd7a2e786cf94
      a720d3d0
  7. Sep 10, 2018
    • Joel Galenson's avatar
      Ensure taking a bugreport generates no denials. · e9ee9d86
      Joel Galenson authored
      Allow dumpstate to get information about sockets and dontaudit
      accessing vendor files when running df.
      
      Bug: 112440280
      Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t android.security.cts.SELinuxHostTest#testNoBugreportDenials
      Change-Id: Ide3cb2f3ce3f079bf30b3bd46810f9b55e105b2b
      e9ee9d86
  8. Sep 08, 2018
  9. Sep 07, 2018
  10. Sep 06, 2018
    • Marcin Oczeretko's avatar
      Add looper_stats_service to SE policy. · 56ab6be0
      Marcin Oczeretko authored
      Test: Built and flashed an image.
      Bug: 113651685
      Change-Id: Ide239432ea8a5701d91c00edd06ad3e52560a3f7
      56ab6be0
    • Jeff Vander Stoep's avatar
      tombstoned: clean up TODO on anr writes · 93727ae6
      Jeff Vander Stoep authored
      audit logs indicate that "append" is still used, but not write.
      
      From ToT master:
      avc: granted { append } for comm="tombstoned" scontext=u:r:tombstoned:s0
      tcontext=u:object_r:anr_data_file:s0 tclass=file
      
      Bug: 32064548
      Test: build
      Change-Id: Id05853a8ae38b84deed4d8bcca5a72c64ce7fd7e
      93727ae6
    • Nick Kralevich's avatar
      dumpstate: remove JIT and /data execute · eef72d34
      Nick Kralevich authored
      Not needed for modern Android versions. These rules are really, really
      old.
      
      Test: "adb bugreport" continues to work
      Test: Generating a bugreport via key combo continues to work.
      Change-Id: Ibc1157fb36abd7fc701db3819474f25210a3cb5f
      eef72d34
  11. Sep 05, 2018
  12. Sep 04, 2018
    • Benjamin Gordon's avatar
      sepolicy: Add mmap for profman · 7cab455f
      Benjamin Gordon authored
      SELinux has a separate file mmap permission in 4.14+ kernels.  Add this
      to profman in cases where it could already access files.
      
      Bug: 112990132
      Test: atest com.android.cts.dexmetadata.InstallDexMetadataHostTest
      Change-Id: I4f3cd55fbd4d0052500f07aac7d286c397758abc
      7cab455f
    • Jeff Vander Stoep's avatar
      app: Allow all apps to read dropbox FDs · 6026a4ad
      Jeff Vander Stoep authored
      DropboxManager may pass FDs to any app with the READ_LOGS
      permission which is available to all apps as a development
      permission.
      
      Test: atest CtsIncidentHostTestCases
      Fixes: 111856304
      Change-Id: I329e3125dab83de948b860061df9d232e31cb23e
      6026a4ad
    • Mark Salyzyn's avatar
      llkd: Add stack symbol checking · 275ea12d
      Mark Salyzyn authored
      llkd needs the ptrace capabilities and dac override to monitor for
      live lock conditions on the stack dumps.
      
      Test: compile
      Bug: 33808187
      Change-Id: Ibc1e4cc10395fa9685c4ef0ca214daf212a5e126
      275ea12d
  13. Aug 30, 2018
  14. Aug 28, 2018
    • Mark Salyzyn's avatar
      init: drop /dev/keychord access · 0722b5aa
      Mark Salyzyn authored
      Test: compile
      Bug: 64114943
      Change-Id: I1d20cc027dbd1a94e2a79b6aebdd265cefe8a6a5
      0722b5aa
    • Nick Kralevich's avatar
      shell: remove /dev/input write access · 51156264
      Nick Kralevich authored
      Shell access to existing input devices is an abuse vector.
      The shell user can inject events that look like they originate
      from the touchscreen etc.
      
      Everyone should have already moved to UiAutomation#injectInputEvent
      if they are running instrumentation tests (i.e. CTS), Monkey for
      their stress tests, and the input command (adb shell input ...) for
      injecting swipes and things.
      
      Remove the write ability for shell users, and add a neverallow assertion
      (which is also a CTS test) to prevent regressions.
      
      Bug: 30861057
      Test: auditallow statement added in
        f617a404 hasn't triggered.
      Test: ran getevent, saw correct output, played with device
      
      Change-Id: Ia78eeec05f6015478dd32bd59505b51fef200a99
      51156264
    • Jeff Vander Stoep's avatar
      crash_dump: disallow ptrace of TCB components · 08aa7159
      Jeff Vander Stoep authored
      Remove permissions and add neverallow assertion.
      
      (cherry picked from commit f1554f15)
      
      Bug: 110107376
      Test: kill -6 <components excluded from ptrace>
      Change-Id: I2dc872f5c02749fbaf8ca6bc7e3e38404151442c
      08aa7159
  15. Aug 24, 2018
    • Nick Kralevich's avatar
      auditallow shell input_device:chr_file · f617a404
      Nick Kralevich authored
      Test to see if anyone is writing to /dev/input from the shell.
      
      Bug: 30861057
      Test: device boots and no avc granted messages.
      Change-Id: Ia3499ef9436f83cf13c633525348b63edd95990f
      f617a404
  16. Aug 23, 2018
  17. Aug 22, 2018
  18. Aug 21, 2018
    • Tri Vo's avatar
      Rename untrusted_app_visible_*' to include 'violators'. · 7f8b6cc6
      Tri Vo authored
      Bug: 110887137
      Test: Flash new system policy onto a device with vendor policy that uses
      untrusted_app_visible_* attributes, and check that old and new attributes
      are applied to exactly same types.
      Change-Id: Ibee0ec645878fcc8c93cd0fbd169a8d45129d79e
      Merged-In: Ibee0ec645878fcc8c93cd0fbd169a8d45129d79e
      (cherry picked from commit 7abca51d)
      7f8b6cc6
    • Benjamin Gordon's avatar
      sepolicy: Fix references to self:capability · 7ed266c6
      Benjamin Gordon authored
      commit 9b2e0cbe added a new
      self:global_capability_class_set macro that covers both self:capability
      and self:cap_userns.  Apply the new macro to various self:capability
      references that have cropped up since then.
      
      Bug: 112307595
      Test: policy diff shows new rules are all cap_userns
      Change-Id: I3eb38ef07532a8e693fd549dfdbc4a6df5329609
      7ed266c6
  19. Aug 20, 2018
    • Hridya Valsaraju's avatar
      Define 'super_block_device' type · 4ae8fe9b
      Hridya Valsaraju authored
      Bug: 78793464
      Test: fastboot getvar partition-size:super
      
      'super_block_device' corresponds to the super partition
      required for flashing dynamic partitions.
      
      Change-Id: I323634b6797ead7c5face117a7028bf9ab947aea
      4ae8fe9b
  20. Aug 17, 2018
  21. Aug 15, 2018
    • Jerry Zhang's avatar
      Add sepolicy for fastbootd · 1d85efa9
      Jerry Zhang authored
      Also allow adb and fastboot to talk to recovery
      through recovery_socket. This enables changing
      between modes with usb commands.
      
      Test: No selinux denials
      Bug: 78793464
      Change-Id: I80c54d4eaf3b94a1fe26d2280af4e57cb1593790
      1d85efa9
    • Florian Mayer's avatar
      Revert "Add sepolicy for fastbootd" · c2ab15b7
      Florian Mayer authored
      This reverts commit 0fd3ed3b.
      
      Reason for revert: Broke user builds.
      
      Change-Id: If95f1a25d22425a5a2b68a02d1561352fb5a52f0
      c2ab15b7
  22. Aug 14, 2018
    • Steven Moreland's avatar
      Remove old incidentd socket allow. · fa3c138a
      Steven Moreland authored
      Forgotten cleanup item.
      
      Bug: 35870313
      Test: making sepolicy (neverallows resolved at compile time)
      Change-Id: If9a583c4508db63356869502ec374727afa84b0b
      fa3c138a
    • Nick Kralevich's avatar
      Fix m4 warnings · 85508496
      Nick Kralevich authored
      Quotes and backticks are sensitive characters and should never show up
      in a comment. Fix comment to avoid the use of a single quote. Also fixes
      a bug where certain rules were not getting included in the compiled
      policy.
      
      Fixes the following build warnings:
      
      [  3% 3564/114975] build out/target/product/taimen/obj/ETC/sepolicy_neverallows_intermediates/plat_pub_policy.conf
      m4:system/sepolicy/public/te_macros:404: Warning: excess arguments to builtin `define' ignored
      [  3% 3578/114975] build out/target/product/taimen/obj/ETC/plat_sepolicy.cil_intermediates/plat_policy.conf
      m4:system/sepolicy/public/te_macros:404: Warning: excess arguments to builtin `define' ignored
      [  3% 3579/114975] build out/target/product/taimen/obj/ETC/vendor_sepolicy.cil_intermediates/vendor_policy.conf
      m4:system/sepolicy/public/te_macros:404: Warning: excess arguments to builtin `define' ignored
      [  3% 3607/114975] build out/target/product/taimen/obj/ETC/sepolicy_neverallows_intermediates/policy.conf
      m4:system/sepolicy/public/te_macros:404: Warning: excess arguments to builtin `define' ignored
      [  3% 3677/114975] build out/target/product/taimen/obj/ETC/built_plat_sepolicy_intermediates/base_plat_policy.conf
      m4:system/sepolicy/public/te_macros:404: Warning: excess arguments to builtin `define' ignored
      
      Test: policy compiles and no warnings.
      Change-Id: Ie32d8b536955b40888b79e3a93851d2ae297f8ee
      85508496
    • Jerry Zhang's avatar
      Add sepolicy for fastbootd · 0fd3ed3b
      Jerry Zhang authored
      Also allow adb and fastboot to talk to recovery
      through recovery_socket. This enables changing
      between modes with usb commands.
      
      Test: No selinux denials
      Bug: 78793464
      Change-Id: I1f97659736429fe961319c642f458c80f199ffb4
      0fd3ed3b
Loading