Skip to content
Snippets Groups Projects
  1. Nov 29, 2017
    • Jeff Vander Stoep's avatar
      Fix bug map entry · 53950b65
      Jeff Vander Stoep authored
      Tclass was omitted for two entries.
      
      Bug: 69928154
      Bug: 69366875
      Test: build
      Change-Id: Ie12c240b84e365110516bcd786b98dc37295fdb9
      53950b65
  2. Nov 22, 2017
    • Nick Kralevich's avatar
      Continuation of 9b2e0cbe · df642bef
      Nick Kralevich authored
      9b2e0cbe changed all uses of capability
      to global_capability_class_set but accidentally omitted one entry.
      Fix the one entry.
      
      Test: policy compiles.
      Change-Id: I1bb8c494a2660d9f02783c93b07d4238a2575106
      df642bef
    • Jiyong Park's avatar
      Label /vendor/priv-app as vendor_app_file · 76311578
      Jiyong Park authored
      In P, we will be supporting privileged apps in vendor partition, thus
      need to label /vendor/priv-app as vendor_app_file so that apps can exist
      under the dir.
      
      Bug: 35301609
      Test: N/A since there is no /vendor/priv-app yet. Framework change
      which is currently in the internal is required.
      
      Change-Id: I86a765ef9da5267113e64a7cbb38ba0abf5c2835
      76311578
  3. Nov 21, 2017
    • Benjamin Gordon's avatar
      sepolicy: Add rules for non-init namespaces · 9b2e0cbe
      Benjamin Gordon authored
      In kernel 4.7, the capability and capability2 classes were split apart
      from cap_userns and cap2_userns (see kernel commit
      8e4ff6f228e4722cac74db716e308d1da33d744f). Since then, Android cannot be
      run in a container with SELinux in enforcing mode.
      
      This change applies the existing capability rules to user namespaces as
      well as the root namespace so that Android running in a container
      behaves the same on pre- and post-4.7 kernels.
      
      This is essentially:
        1. New global_capability_class_set and global_capability2_class_set
           that match capability+cap_userns and capability2+cap2_userns,
           respectively.
        2. s/self:capability/self:global_capability_class_set/g
        3. s/self:capability2/self:global_capability2_class_set/g
        4. Add cap_userns and cap2_userns to the existing capability_class_set
           so that it covers all capabilities.  This set was used by several
           neverallow and dontaudit rules, and I confirmed that the new
           classes are still appropriate.
      
      Test: diff new policy against old and confirm that all new rules add
            only cap_userns or cap2_userns;
            Boot ARC++ on a device with the 4.12 kernel.
      Bug: crbug.com/754831
      
      Change-Id: I4007eb3a2ecd01b062c4c78d9afee71c530df95f
      9b2e0cbe
    • Jeff Vander Stoep's avatar
      Remove tracking bugs that have been resolved · 378763f2
      Jeff Vander Stoep authored
      Bug: 69175449
      Bug: 69197466
      Test: build
      Change-Id: I11e46b65449cb6f451ecab8d4dff9adc162fe115
      378763f2
  4. Nov 20, 2017
  5. Nov 17, 2017
    • Jeff Vander Stoep's avatar
      Allow AOSP processes to read pm_prop · 0f5ad4e5
      Jeff Vander Stoep authored
      Exclude vendor processes.
      
      Bug: 69309298
      Test: cts-tradefed run cts -m CtsCompilationTestCases
          completed in 33s. 5 passed, 0 failed
      Test: runtest frameworks-services -c \
          com.android.server.pm.dex.DexoptOptionsTests \
          --install=".*FrameworksServicesTests.apk"
          OK (5 tests)
      
      Change-Id: Ic02caf373e2214b4b931a724ca8d4f4effbc0741
      0f5ad4e5
    • Tri Vo's avatar
      shell: neverallow access to 'proc' label. · c4ef3630
      Tri Vo authored
      Added access to proc_uptime and proc_asound to address these denials:
      
      avc: denied { read } for name="uptime" dev="proc" ino=4026532080
      scontext=u:r:shell:s0 tcontext=u:object_r:proc_uptime:s0 tclass=file
      permissive=1
      
      avc: denied { getattr } for path="/proc/asound/version" dev="proc"
      ino=4026532017 scontext=u:r:shell:s0 tcontext=u:object_r:proc_asound:s0
      tclass=file permissive=1
      
      Bug: 65643247
      Test: device boots with no denial from 'shell' domain.
      Test: lsmod, ps, top, netstat
      Test: No denials triggered from CtsSecurityHostTestCases
      Test: external/toybox/run-tests-on-android.sh does not pass, but triggers
      no denials from 'shell' domain to 'proc' type.
      
      Change-Id: Ia4c26fd616e33e5962c6707a855dc24e338ec153
      c4ef3630
    • Vishnu Nair's avatar
      Add window trace files SELinux policy rules · 2d6942d3
      Vishnu Nair authored
      - Allow system_server to create and write to /data/misc/wmtrace/*
      - Allow surfaceflinger to create and write files from /data/misc/wmtrace/*
      - Allow dumpstate to read files from /data/misc/wmtrace/*
      permissions are restricted to userdebug or eng builds
      
      Bug: 64831661
      
      Test: adb shell cmd window tracing start && adb shell cmd window tracing stop
      Test: adb shell su root service call SurfaceFlinger 1025 i32 1 >/dev/null && adb shell su root service call SurfaceFlinger 1025 i32 0 >/dev/null
      Test: adb bugreport ~/tmp.zip && adb shell su root dmesg | grep 'avc: '
      
      Change-Id: I0b15166560739d73d7749201f3ad197dbcf5791c
      2d6942d3
    • Tri Vo's avatar
      mediaserver: remove access to 'sysfs' type. · 2ea12cd3
      Tri Vo authored
      Bug: 65643247
      Test: cts-tradefed run cts-dev -m \
      CtsMediaTestCases --compatibility:module-arg \
      CtsMediaTestCases:include-annotation:\
      android.platform.test.annotations.RequiresDevice
      No denials from mediaserver domain to sysfs type are observed.
      Change-Id: Icb5c12f04af213452d82e226993fe13085c5c33f
      2ea12cd3
  6. Nov 16, 2017
    • Tri Vo's avatar
      system_server: access to /proc/sys/fs/pipe-max-size · e7f4934d
      Tri Vo authored
      Label /proc/sys/fs/pipe-max-size with new type proc_pipe_conf and give
      system_server access to it.
      
      Addresses this denial:
      avc: denied { read } for name="pipe-max-size" dev="proc" ino=93817
      scontext=u:r:system_server:s0 tcontext=u:object_r:proc:s0 tclass=file
      permissive=0
      
      Bug: 69175449
      Bug: 69324398
      Test: sailfish boots
      Test: adb bugreport
      Test: craft an unresponsive app, trigger ANR, make sure traces are dumped
      into /data/anr
      Above denial from system_server not observed, no denials to proc_pipe_conf
      observed.
      Change-Id: I7c71f05820a4945ba982e29f76e9d9f4458b2b59
      e7f4934d
    • Calin Juravle's avatar
      Revert "Revert "Put pm.* property in new pm_prop context"" · 5316548f
      Calin Juravle authored
      This reverts commit 248b6dc6.
      
      Reason for revert: The dashboard complains that devices don't boot after this revert.
      
      Change-Id: I6a4648b64b096cbaa97c67aae6bc38b76d54cb48
      5316548f
  7. Nov 15, 2017
    • Tom Cherry's avatar
      Copy a dontaudit from init to vendor_init · 63492cd6
      Tom Cherry authored
      Copy init's dontaudit for sysfs:dir write; to calm the below denials:
      
      avc:  denied  { write } for  pid=542 comm="init" name="1da4000.ufshc" dev="sysfs" ino=21752 scontext=u:r:vendor_init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
      avc: denied { write } for pid=542 comm="init" name="1da4000.ufshc" dev="sysfs" ino=21752 scontext=u:r:vendor_init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
      
      Bug: 62875318
      Test: use pixel + factory reset + vendor_init
      Change-Id: I686b51c4f340b3565ea24f00516ebde846be7a89
      63492cd6
    • Calin Juravle's avatar
      Revert "Put pm.* property in new pm_prop context" · 248b6dc6
      Calin Juravle authored
      This reverts commit d1cf3a40.
      
      Reason for revert: It breaks CTS b/69309298 and other platform tests which read pm.dexopt properties.
      
      Change-Id: I5c7cde041113e9c19bb23218edd99f699fcf4a06
      248b6dc6
    • Tri Vo's avatar
      update_verifier: neverallow access to 'sysfs' label. · 7dd4d906
      Tri Vo authored
      Bug: 65643247
      Test: aosp_walleye-userdebug builds
      Test: aosp_sailfish-userdebug builds
      Change-Id: Iaebd368b84259783fbdc4778988bdb7ba0df300b
      7dd4d906
  8. Nov 14, 2017
    • Jeff Vander Stoep's avatar
      Add tracking bugs to crash_dump denials · 41401f47
      Jeff Vander Stoep authored
      avc: denied { search } for name="com.sf.activity" dev="sda35"
      ino=1444147 scontext=u:r:crash_dump:s0:c512,c768
      tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir
      avc: denied { search } for comm="crash_dump64"
      name="com.android.bluetooth" dev="sda13" ino=1442292
      scontext=u:r:crash_dump:s0 tcontext=u:object_r:bluetooth_data_file:s0
      tclass=dir
      avc: denied { search } for comm="crash_dump64" name="overlay" dev="dm-1"
      ino=938 scontext=u:r:crash_dump:s0
      tcontext=u:object_r:vendor_overlay_file:s0 tclass=dir permissive=0
      
      Bug: 68705274
      Bug: 68319037
      Test: build
      Change-Id: I44075ac6bf6447d863373c97ba10eadf59d2d22f
      41401f47
  9. Nov 13, 2017
    • Chad Brubaker's avatar
      Allow Instant/V2 apps to load code from /data/data · 7650669f
      Chad Brubaker authored
      This restriction causes issues with dynamite.
      
      Since untrusted_v2_app was about enforcing this constraint put installed
      v2 applications back into the normal untrusted_app domain.
      
      Bug: 64806320
      Test: Manual test with app using dynamite module
      
      (cherrypicked from commit fe836817)
      
      Change-Id: I3abf3ade64aaf689039a515de642759dd39ae6f7
      7650669f
    • Tri Vo's avatar
      Revert "update_verifier: neverallow access to 'sysfs' label." · 23e58d19
      Tri Vo authored
      This reverts commit a61b99bb.
      
      Reason for revert: breaks aosp_walleye-userdebug
      
      Change-Id: I3246b8cac862b53fc76609df60b90149fbc8098d
      23e58d19
    • Tri Vo's avatar
      update_verifier: neverallow access to 'sysfs' label. · a61b99bb
      Tri Vo authored
      Bug: 65643247
      Test: walleye-userdebug builds
      Change-Id: I12d8239ca85bb68eab76a2d0001a722fea3045c5
      a61b99bb
    • Jeff Vander Stoep's avatar
      Add tracking bugs to denials · 29666d12
      Jeff Vander Stoep authored
      These denials should not be allowed. Adding a bug number to the
      denial properly attributes them to a bug.
      
      Bug: 69197466
      avc: denied { fsetid } for comm="update_engine" capability=4
      scontext=u:r:update_engine:s0 tcontext=u:r:update_engine:s0
      tclass=capability
      
      Bug: 62140539
      avc: denied { open }
      path="/data/system_de/0/spblob/17a358cf8dff62ea.weaver"
      scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
      tclass=file
      avc: denied { unlink } for name="17a358cf8dff62ea.weaver"
      scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
      tclass=file
      
      Bug: 69175449
      avc: denied { read } for name="pipe-max-size" dev="proc"
      scontext=u:r:system_server:s0 tcontext=u:object_r:proc:s0 tclass=file
      
      Test: build
      Change-Id: I62dc26a9076ab90ea4d4ce1f22e9b195f33ade16
      29666d12
  10. Nov 09, 2017
    • Hakan Kvist's avatar
      Allow update_engine to access /data/misc/update_engine_log · 6fe014f8
      Hakan Kvist authored
      Add label update_engine_log_data_file for log files created by
      update engine in directory /data/misc/update_engine_log.
      
      Bug: 65568605
      Test: manual
      Change-Id: I379db82a0ea540e41cb3b8e03f93d9ce64fac7c9
      6fe014f8
    • Jeff Vander Stoep's avatar
      Suppress mediaprover access to certain cache dirs · 182dbeb6
      Jeff Vander Stoep authored
      avc: denied { getattr } for comm="sAsyncHandlerTh"
      path="/data/cache/recovery" dev="sda13" ino=7086082
      scontext=u:r:mediaprovider:s0:c512,c768
      tcontext=u:object_r:cache_recovery_file:s0 tclass=dir
      avc: denied { getattr } for path="/data/cache/backup"
      scontext=u:r:mediaprovider:s0:c512,c768
      tcontext=u:object_r:cache_private_backup_file:s0 tclass=dir
      
      Bug: 63038506
      Bug: 35197529
      Test: build police
      Change-Id: I51624c255e622bf712d41ca1bbf190ec3e4fefae
      (cherry picked from commit fcf1b2083935bd298a2ece8d6d0c18712865a04b)
      182dbeb6
    • Jeff Vander Stoep's avatar
      Allow vendor apps to use surfaceflinger_service · 63f46773
      Jeff Vander Stoep authored
      Vendor apps may only use servicemanager provided services
      marked as app_api_service. surfaceflinger_service should be
      available to vendor apps, so add this attribute and clean up
      duplicate grants.
      
      Addresses:
      avc:  denied  { find } scontext=u:r:qtelephony:s0
      tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager
      avc:  denied  { find } scontext=u:r:ssr_detector:s0
      tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager
      avc:  denied  { find } scontext=u:r:qcneservice:s0
      tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager
      
      Bug: 69064190
      Test: build
      Change-Id: I00fcf43b0a8bde232709aac1040a5d7f4792fa0f
      63f46773
  11. Nov 08, 2017
    • Tri Vo's avatar
      init: label /proc dependencies and remove access to proc · 84e181bc
      Tri Vo authored
      New types and files labeled with them:
      1. proc_abi:
        /proc/sys/abi/swp
      
      2. proc_dirty:
        /proc/sys/vm/dirty_background_ratio
        /proc/sys/vm/dirty_expire_centisecs
      
      3. proc_diskstats:
        /proc/diskstats
      
      4. proc_extra_free_kbytes:
        /proc/sys/vm/extra_free_kbytes
      
      5. proc_hostname:
        /proc/sys/kernel/domainname
        /proc/sys/kernel/hostname
      
      6. proc_hung_task:
        /proc/sys/kernel/hung_task_timeout_secs
      
      7. proc_max_map_count:
        /proc/sys/vm/max_map_count
      
      8. proc_panic:
        /proc/sys/kernel/panic_on_oops
      
      9. proc_sched:
        /proc/sys/kernel/sched_child_runs_first
        /proc/sys/kernel/sched_latency_ns
        /proc/sys/kernel/sched_rt_period_us
        /proc/sys/kernel/sched_rt_runtime_us
        /proc/sys/kernel/sched_tunable_scaling
        /proc/sys/kernel/sched_wakeup_granularity_ns
      
      10. proc_uptime:
        /proc/uptime
      
      Files labeled with already existing types:
      1. proc_perf:
        /proc/sys/kernel/perf_event_paranoid
      
      2. proc_sysrq:
        /proc/sys/kernel/sysrq
      
      3. usermodehelper:
        /proc/sys/kernel/core_pipe_limit
      
      Changes to init domain:
      1. Removed access to files with 'proc' label.
      2. Added access to newly introduced types + proc_kmsg.
      
      Bug: 68949041
      Test: walleye boots without denials from u:r:init:s0.
      Test: system/core/init/grab-bootchart.sh does not trigger denials from
      u:r:init:s0
      Change-Id: If1715c3821e277679c320956df33dd273e750ea2
      84e181bc
    • Victor Hsieh's avatar
      Put pm.* property in new pm_prop context · d1cf3a40
      Victor Hsieh authored
      Test: system server does not crash with this change
      Bug: 67415855
      Bug: 63920015
      Change-Id: I3d0982220743137098dbc683d5c4aded105648c2
      d1cf3a40
    • Luis Hector Chavez's avatar
      Allow callers of uevent_kernel_*() access to /proc/sys/kernel/overflowuid · 640e595a
      Luis Hector Chavez authored
      Bug: 62378620
      Test: Android in Chrome OS can call uevent_kernel_recv() and not fail
            with EIO.
      Test: bullhead networking still works
      
      Change-Id: I4dd5d2148ee1704c4fa23d7fd82d1ade19b58cbd
      640e595a
  12. Nov 07, 2017
  13. Nov 06, 2017
  14. Nov 03, 2017
    • Tri Vo's avatar
      radio: neverallow access to proc and sysfs types. · 5aac163b
      Tri Vo authored
      Bug: 65643247
      Test: build aosp_sailfish-userdebug
      Test: build walleye-userdebug from internal
      This CL does not change runtime behavior.
      Change-Id: I82c520579b986ea2a4a6f030ec60d5345c00b54f
      5aac163b
  15. Nov 02, 2017
    • Shubham Ajmera's avatar
      Don't allow dexoptanalyzer to open app_data_files · b8a42499
      Shubham Ajmera authored
      Test: manual(installd flow without sepolicy denials)
      Bug: 67111829
      Change-Id: I7ac1a86e731ec5900eec83608b4765a6818f2fd0
      b8a42499
    • Tri Vo's avatar
      Neverallow coredomain to kernel interface files. · 233c7a6b
      Tri Vo authored
      Core domains should not be allowed access to kernel interfaces,
      which are not explicitly labeled. These interfaces include
      (but are not limited to):
      
      1. /proc
      2. /sys
      3. /dev
      4. debugfs
      5. tracefs
      6. inotifyfs
      7. pstorefs
      8. configfs
      9. functionfs
      10. usbfs
      11. binfmt_miscfs
      
      We keep a lists of exceptions to the rule, which we will be gradually shrinking.
      This will help us prevent accidental regressions in our efforts to label
      kernel interfaces.
      
      Bug: 68159582
      Bug: 68792382
      Test: build aosp_sailfish-user
      Test: build aosp_sailfish-userdebug
      Test: CP to internal and build walleye-user
      Change-Id: I1b2890ce1efb02a08709a6132cf2f12f9d88fde7
      233c7a6b
    • Tobias Thierer's avatar
      Revert "Neverallow coredomain to kernel interface files." · 83a06805
      Tobias Thierer authored
      This reverts commit 502e43f7.
      
      Reason for revert: Suspected to have broken a build, see b/68792382
      
      Bug: 68792382
      Change-Id: Ib5d465b7a50a73e3d8d8edd4e6b3426a7bde4249
      83a06805
  16. Nov 01, 2017
  17. Oct 31, 2017
    • Tri Vo's avatar
      Neverallow coredomain to kernel interface files. · 502e43f7
      Tri Vo authored
      Core domains should not be allowed access to kernel interfaces,
      which are not explicitly labeled. These interfaces include
      (but are not limited to):
      
      1. /proc
      2. /sys
      3. /dev
      4. debugfs
      5. tracefs
      6. inotifyfs
      7. pstorefs
      8. configfs
      9. functionfs
      10. usbfs
      11. binfmt_miscfs
      
      We keep a lists of exceptions to the rule, which we will be gradually shrinking.
      This will help us prevent accidental regressions in our efforts to label
      kernel interfaces.
      
      Bug: 68159582
      Test: bullhead, sailfish can build
      Change-Id: I8e466843e1856720f30964546c5c2c32989fa3a5
      502e43f7
  18. Oct 25, 2017
    • Paul Crowley's avatar
      Move most of public/vold_prepare_subdirs.te to private · 5850a2ae
      Paul Crowley authored
      AIUI permissions should be in private unless they need to be public.
      
      Bug: 25861755
      Test: Boot device, create and remove a user, observe logs
      Change-Id: I6c3521d50dab2d508fce4b614d51e163e7c8f3da
      5850a2ae
    • Tom Cherry's avatar
      add vendor_init.te · 621c24cb
      Tom Cherry authored
      First pass at adding vendor_init.te
      
      Bug: 62875318
      Test: boot sailfish with vendor_init
      Change-Id: I35cc9be324075d8baae866d6de4166c37fddac68
      621c24cb
  19. Oct 24, 2017
    • Tom Cherry's avatar
      Add label for /proc/sys/vm/page-cluster · 8bdb1dab
      Tom Cherry authored
      Test: boot sailfish with no audit when writing to page-cluster
      Change-Id: I2bfebdf9342594d66d95daaec92d71195c93ffc8
      8bdb1dab
    • Tri Vo's avatar
      /proc, /sys access from uncrypt, update_engine, postinstall_dexopt · 04fb82f2
      Tri Vo authored
      New types:
      1. proc_random
      2. sysfs_dt_firmware_android
      
      Labeled:
      1. /proc/sys/kernel/random as proc_random.
      2. /sys/firmware/devicetree/base/firmware/android/{compatible, fstab,
      vbmeta} as sysfs_dt_firmware_android.
      
      Changed access:
      1. uncrypt, update_engine, postinstall_dexopt have access to generic proc
      and sysfs labels removed.
      2. appropriate permissions were added to uncrypt, update_engine,
      update_engine_common, postinstall_dexopt.
      
      Bug: 67416435
      Bug: 67416336
      Test: fake ota go/manual-ab-ota runs without denials
      Test: adb sideload runs without denials to new types
      Change-Id: Id31310ceb151a18652fcbb58037a0b90c1f6505a
      04fb82f2
  20. Oct 23, 2017
    • Max Bires's avatar
      Adding statscompanion_service and a dontaudit for find/add · 0187b231
      Max Bires authored
      Instead of removing the denial generating code, a dontaudit and a
      service label will be provided so that the team working on this new
      feature doesn't have to get slowed up with local revision patches.
      
      The dontaudit should be removed upon resolution of the linked bug.
      
      Bug: 67468181
      Test: statscompanion denials aren't audited
      Change-Id: Ib4554a7b6c714e7409ea504f5d0b82d5e1283cf7
      0187b231
    • Nick Kralevich's avatar
      Revert "Ensure only com.android.shell can run in the shell domain." · bf0c2a59
      Nick Kralevich authored
      The following error is occurring on master:
      
      10-23 16:24:24.785 shell  4884  4884 E SELinux : seapp_context_lookup:  No match for app with uid 2000, seinfo platform, name com.google.android.traceur
      10-23 16:24:24.785 shell  4884  4884 E SELinux : selinux_android_setcontext:  Error setting context for app with uid 2000, seinfo platform:targetSdkVersion=23:complete: Success
      10-23 16:24:24.785 shell  4884  4884 E Zygote  : selinux_android_setcontext(2000, 0, "platform:targetSdkVersion=23:complete", "com.google.android.traceur") failed
      10-23 16:24:24.785 shell  4884  4884 F zygote64: jni_internal.cc:593] JNI FatalError called: frameworks/base/core/jni/com_android_internal_os_Zygote.cpp:648: selinux_android_setcontext failed
      10-23 16:24:24.818 shell  4884  4884 F zygote64: runtime.cc:535] Runtime aborting...
      
      Bug: 68126425
      Bug: 68032516
      
      This reverts commit 714ee5f2.
      
      Change-Id: I7356c4e4facb1e532bfdeb575acf2d83761a0852
      bf0c2a59
Loading