Skip to content
Snippets Groups Projects
  1. Apr 10, 2018
    • Jeff Vander Stoep's avatar
      Start the process of locking down proc/net · 08731895
      Jeff Vander Stoep authored
      Files in /proc/net leak information. This change is the first step in
      determining which files apps may use, whitelisting benign access, and
      otherwise removing access while providing safe alternative APIs.
      
      To that end, this change:
      * Introduces the proc_net_type attribute which will assigned to any
      new SELinux types in /proc/net to avoid removing access to privileged
      processes. These processes may be evaluated later, but are lower
      priority than apps.
      * Labels /proc/net/{tcp,tcp6,udp,udp6} as proc_net_vpn due to existing
      use by VPN apps. This may be replaced by an alternative API.
      * Audits all other proc/net access for apps.
      * Audits proc/net access for other processes which are currently
      granted broad read access to /proc/net but should not be including
      storaged, zygote, clatd, logd, preopt2cachename and vold.
      
      Bug: 9496886
      Bug: 68016944
      Test: Boot Taimen-userdebug. On both wifi and cellular: stream youtube
          navigate maps, send text message, make voice call, make video call.
          Verify no avc "granted" messages in the logs.
      Test: A few VPN apps including "VPN Monster", "Turbo VPN", and
      "Freighter". Verify no logspam with the current setup.
      Test: atest CtsNativeNetTestCases
      Test: atest netd_integration_test
      Test: atest QtaguidPermissionTest
      Test: atest FileSystemPermissionTest
      
      Change-Id: I7e49f796a25cf68bc698c6c9206e24af3ae11457
      08731895
  2. Apr 03, 2018
  3. Mar 12, 2018
  4. Mar 11, 2018
  5. Mar 10, 2018
    • Amit Mahajan's avatar
      Move rild from public to vendor. · aed57d4e
      Amit Mahajan authored
      Also change the neverallow exceptions to be for hal_telephony_server
      instead of rild.
      
      Test: Basic telephony sanity, treehugger
      Bug: 36427227
      Merged-in: If892b28416d98ca1f9c241c5fcec70fbae35c82e
      Change-Id: If892b28416d98ca1f9c241c5fcec70fbae35c82e
      aed57d4e
  6. Mar 08, 2018
    • Amit Mahajan's avatar
      Move rild from public to vendor. · eeda6c61
      Amit Mahajan authored
      Also change the neverallow exceptions to be for hal_telephony_server
      instead of rild.
      
      Test: Basic telephony sanity, treehugger
      Bug: 36427227
      Change-Id: If892b28416d98ca1f9c241c5fcec70fbae35c82e
      eeda6c61
  7. Feb 23, 2018
    • Robert Sesek's avatar
      Remove rules for starting the webview_zygote as a child of init. · 869562e9
      Robert Sesek authored
      The webview_zygote is now launched as a child-zygote process from the
      main zygote process.
      
      Bug: 63749735
      Test: m
      Test: Launch "Third-party licenses" activity from Settings, and it
            renders correctly via the WebView.
      Merged-In: I9c948b58a969d35d5a5add4b6ab62b8f990645d1
      Change-Id: I153476642cf14883b0dfea0d9f5b3b5e30ac1c08
      869562e9
  8. Feb 16, 2018
    • Robert Sesek's avatar
      Remove rules for starting the webview_zygote as a child of init. · ca4c4e57
      Robert Sesek authored
      The webview_zygote is now launched as a child-zygote process from the
      main zygote process.
      
      Bug: 63749735
      Test: m
      Test: Launch "Third-party licenses" activity from Settings, and it
            renders correctly via the WebView.
      Change-Id: I9c948b58a969d35d5a5add4b6ab62b8f990645d1
      ca4c4e57
  9. Feb 08, 2018
    • Jeff Vander Stoep's avatar
      label /data/vendor{_ce,_de} · d25ccabd
      Jeff Vander Stoep authored
      Restrictions introduced in vendor init mean that new devices
      may not no longer exempt vendor init from writing to system_data_file.
      This means we must introduce a new label for /data/vendor which
      vendor_init may write to.
      
      Bug: 73087047
      Test: build and boot Taimen and Marlin. Complete SUW, enroll fingerprint
          No new denials.
      
      Change-Id: I65f904bb28952d4776aab947515947e14befbe34
      d25ccabd
  10. Jan 24, 2018
    • Marissa Wall's avatar
      sepolicy: restrict access to uid_cpupower files · dfe063c3
      Marissa Wall authored
      Do not let apps read /proc/uid_cpupower/time_in_state,
      /proc/uid_cpupower/concurrent_active_time,
      /proc/uid_cpupower/concurrent_policy_time.
      
      b/71718257
      
      Test: Check that they can't be read from the shell
          without root permissions and system_server was able
          to read them
      
      Change-Id: I812694adfbb4630f7b56aa7096dc2e6dfb148b15
      dfe063c3
    • Joel Galenson's avatar
      Fix init error trying to access file. · cf391269
      Joel Galenson authored
      Init tries to write /proc/sys/vm/min_free_order_shift but fails due to
      a SELinux denial.  This gives the file a new label and gives init the
      ability to write it.
      
      Test: Build and booted Sailfish (a couple of days ago).
      Change-Id: Ic93862b85c468afccff2019d84b927af9ed2a84d
      cf391269
  11. Jan 23, 2018
  12. Jan 20, 2018
  13. Jan 18, 2018
    • Jeff Vander Stoep's avatar
      Enforce per-app data protections for targetSdk 28+ · 6231b4d9
      Jeff Vander Stoep authored
      Adds per-app categories to untrusted app domains and their
      app data types. Per-app categories are in addition to the
      existing per-user categories.
      
      Apps targeting sdk version 28+ will now have the following
      characteristics:
      Domain: u:r:untrusted_app:s0:c[0-9]+,c[0-9]+,c[0-9],c[0-9]
      Data context: u:object_r:app_data_file:s0:c[0-9]+,c[0-9]+,c[0-9],c[0-9]
      
      Whereas apps targeting 27- will look like:
      Domain: u:r:untrusted_app_27:s0:c[0-9]+,c[0-9]+
      Data context: u:object_r:app_data_file:s0:c[0-9]+,c[0-9]+
      
      To ensure backwards compatibility with previous SDK versions,
      the levelFrom=all now enforces categories by dominance instead of
      equality. Apps with per-app and per-user categories will continue
      to have selinux permissions (but not necessarily unix permissions)
      to access app data with only per-user categories, but apps with only
      per-user categories will not be able to access the data of apps with
      both per-app and per-user categories.
      
      Bug: 63897054
      Test: Boot sailfish, run apps, verify no new selinux denials.
      Test: cts-tradefed run cts -m CtsSelinuxTargetSdkCurrentTestCases
      Test: cts-tradefed run cts -m CtsSelinuxTargetSdk27TestCases
      Test: cts-tradefed run cts -m CtsSelinuxTargetSdk25TestCases
      Test: adb sideload an OTA and verify that files are correctly labeled.
      Change-Id: I64b013874fe87b55f47e817a1279e76ecf86b7c0
      6231b4d9
  14. Jan 11, 2018
    • Jeff Vander Stoep's avatar
      relabel files in /proc/net/xt_qtaguid/ · 43303c8b
      Jeff Vander Stoep authored
      /proc/net/xt_qtaguid is used by apps to track their network data
      use. Limit access to just zygote spawned processes - apps and
      system_server, omitting access to isolated_app which is not allowed
      to create network sockets.
      As Android moves to eBPF for app's network data stats, access to
      /proc/net/xt_qtaguid will be removed entirely. Segmenting access off
      is the first step.
      Bug: 68774956
      
      This change also helps further segment and whitelist access to
      files in /proc/net and is a step in the lockdown of /proc/net.
      Bug: 9496886
      
      Test: boot Taimen. Walk through setup-wizard. Make phone call and
          video call. Browse web. Watch youtube. Navigate in maps.
      Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t \
          android.appsecurity.cts.AppSecurityTests
      Test: cts-tradefed run cts -m CtsNativeNetTestCases
      Test: cts-tradefed run cts -m CtsIncidentHostTestCases -t \
          com.android.server.cts.NetstatsIncidentTest
      Test: cts-tradefed run cts -m CtsOsTestCases -t \
          android.os.cts.StrictModeTest
      Test: cts-tradefed run cts -m CtsNetTestCases -t \
          android.net.cts.TrafficStatsTest
      Test: cts-tradefed run cts -m CtsUsageStatsTestCases -t \
          android.app.usage.cts.NetworkUsageStatsTest
      Test: vts-tradefed run vts -m VtsQtaguidTest
      Change-Id: Idddd318c56b84564142d37b11dcc225a2f2800ea
      43303c8b
  15. Jan 08, 2018
  16. Dec 22, 2017
  17. Dec 16, 2017
    • Jeff Vander Stoep's avatar
      Audit app access to /proc/net/* · 84f96859
      Jeff Vander Stoep authored
      Many processes including third party apps are expected to
      access /proc/net/xt_qtaguid/stats. Give this file a new label
      to avoid spamming the logs and temporarily grant read access to
      all processes.
      
      Read-only permission is adequate for all processes based on unix
      permissions.
      sailfish:/ # ls -laZ /proc/net/xt_qtaguid/stats
      -r--r--r--  1 root net_bw_stats u:object_r:proc_net_xt_qtaguid_stats:s0 stats
      
      Bug: 9496886
      Bug: 68016944
      Bug: 70722355
      Test: Build/flash Sailfish. Browse in Chrome and watch videos in youtube.
          No "denied" or "granted" selinux messages observed in the logs.
      
      Change-Id: I29f1ee806c8149988b9b93a950790d14754927ef
      84f96859
  18. Dec 12, 2017
    • Marissa Wall's avatar
      Restrict access to uid_concurrent_*_time · 80ee23f7
      Marissa Wall authored
      Do not let apps read uid_concurrent_active_time and
      uid_concurrent_policy_time.
      
      b/68399339
      
      Test: Check that they can't be read from the shell
          without root permissions and system_server was able
          to read them
      
      Change-Id: I6f09ef608607cb9f4084ba403a1e7254b8c49a06
      80ee23f7
  19. Dec 06, 2017
  20. Nov 28, 2017
    • Tri Vo's avatar
      Label /proc/sys/kernel/pid_max as proc_pid_max. · 4081fd39
      Tri Vo authored
      And give shell domain read access to /proc/sys/kernel/pic_max.
      
      Bug: 69569397
      Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
      --gtest_filter=pthread.pthread_mutex_owner_tid_limit
      Change-Id: Ib56c18ed553ad2c2113e6913788a4c00965483cc
      4081fd39
  21. 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
  22. Nov 15, 2017
  23. 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
  24. 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
  25. Oct 20, 2017
    • Tri Vo's avatar
      Restrict netd fwk policy. · 8dabc2ce
      Tri Vo authored
      Remove netd access to sysfs_type attribute.
      
      These were moved from vendor to fwk policy:
      1. sysfs_net type declaration
      2. labeling of /sys/devices/virtual/net with sysfs_net
      3. netd access to sysfs_net
      
      Bug: 65643247
      Test: can browse internet without netd denials
      Test: netd_unit_test, netd_integration_test without netd denials
      Merged-In: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
      Change-Id: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
      (cherry picked from commit e62a56b7)
      8dabc2ce
    • Tri Vo's avatar
      Restrict netd fwk policy. · c1031b55
      Tri Vo authored
      Remove netd access to sysfs_type attribute.
      
      These were moved from vendor to fwk policy:
      1. sysfs_net type declaration
      2. labeling of /sys/devices/virtual/net with sysfs_net
      3. netd access to sysfs_net
      
      Bug: 65643247
      Test: can browse internet without netd denials
      Test: netd_unit_test, netd_integration_test without netd denials
      Merged-In: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
      Change-Id: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
      (cherry picked from commit e62a56b7)
      c1031b55
    • Tri Vo's avatar
      Restrict netd fwk policy. · 22080603
      Tri Vo authored
      Remove netd access to sysfs_type attribute.
      
      These were moved from vendor to fwk policy:
      1. sysfs_net type declaration
      2. labeling of /sys/devices/virtual/net with sysfs_net
      3. netd access to sysfs_net
      
      Bug: 65643247
      Test: can browse internet without netd denials
      Test: netd_unit_test, netd_integration_test without netd denials
      Merged-In: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
      Change-Id: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
      (cherry picked from commit e62a56b7)
      22080603
  26. Oct 17, 2017
    • Tri Vo's avatar
      Restrict netd fwk policy. · e62a56b7
      Tri Vo authored
      Remove netd access to sysfs_type attribute.
      
      These were moved from vendor to fwk policy:
      1. sysfs_net type declaration
      2. labeling of /sys/devices/virtual/net with sysfs_net
      3. netd access to sysfs_net
      
      Bug: 65643247
      Test: can browse internet without netd denials
      Test: netd_unit_test, netd_integration_test without netd denials
      Change-Id: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
      e62a56b7
  27. Oct 12, 2017
    • Tri Vo's avatar
      Label system_server's dependencies in sysfs. · 1960215c
      Tri Vo authored
      New types:
      sysfs_android_usb
      sysfs_ipv4
      sysfs_power
      sysfs_rtc
      sysfs_switch
      sysfs_wakeup_reasons
      
      Labeled:
      /sys/class/android_usb, /sys/devices/virtual/android_usb ->sysfs_android_usb
      /sys/class/rtc -> sysfs_rtc
      /sys/class/switch, /sys/devices/virtual/switch -> sysfs_switch
      /sys/power/state, /sys/power/wakeup_count -> sysfs_power
      /sys/kernel/ipv4 -> sysfs_ipv4
      /sys/kernel/wakeup_reasons -> sysfs_wakeup_reasons
      
      Removed access to sysfs and sysfs_type from system_server and added
      appropriate access to new types.
      
      Bug: 65643247
      Test: sailfish boots without violation from system_server or to new labels.
      Change-Id: I27250fd537d76c8226defa138d84fe2a4ce2d5d5
      1960215c
  28. Oct 10, 2017
    • Tao Bao's avatar
      Create sysfs_dm label. · 5b4bea43
      Tao Bao authored
      Prior to this CL, /sys/devices/virtual/block/dm-X was using the generic
      sysfs label. This CL creates sysfs_dm label and grants the following
      accesses:
       - update_verifier to read sysfs_dm dir and file at
         /sys/devices/virtual/block/dm-X.
       - vold to write sysfs_dm.
      
      Bug: 63440407
      Test: update_verifier successfully triggers blocks verification and
            marks a sucessful boot;
      Test: No sysfs_dm related denials on sailfish.
      Change-Id: I6349412707800f1bd3a2fb94d4fe505558400c95
      5b4bea43
Loading