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 05, 2018
  3. Apr 04, 2018
  4. Apr 03, 2018
    • Jeff Vander Stoep's avatar
      Remove deprecated tagSocket() permissions · 0d1e52a5
      Jeff Vander Stoep authored
      tagSocket() now results in netd performing these actions on behalf
      of the calling process.
      
      Remove direct access to:
      /dev/xt_qtaguid
      /proc/net/xt_qtaguid/ctrl
      
      Bug: 68774956
      Test: -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests
          -m CtsNativeNetTestCases
      Test: stream youtube, browse chrome
      Test: go/manual-ab-ota
      Change-Id: I6a044f304c3ec4e7c6043aebeb1ae63c9c5a0beb
      0d1e52a5
  5. Mar 31, 2018
  6. Mar 30, 2018
  7. Mar 29, 2018
  8. Mar 26, 2018
    • Primiano Tucci's avatar
      Revert "Allow system server to set persist.traced.enable" · 4f673cf4
      Primiano Tucci authored
      This reverts commit 6f2040f8.
      
      Reason for revert: not needed anymore after ag/3773705
      This was meant to allow system_server toggling the property on/off.
      Later we realized that we needed a separate property for that 
      (see discussion in b/76077784) and system server happens to
      have already permissions to write to sys.* properties even without
      this CL.
      Reverting because at this point this creates just unnecessary clutter.
      
      Change-Id: Ia73d000aad3c4288a5652047dfe10896e231b0b1
      Test: perfetto_integrationtests
      Bug: 76077784
      4f673cf4
  9. Mar 24, 2018
    • Chenbo Feng's avatar
      Allow system server to access bpf fs · 88ef20aa
      Chenbo Feng authored
      The permission to allow system_server to access sys/fs/bpf/ directory
      is missing. Add it back so it can get the bpf maps from the bpf_fs.
      
      Test: device boot and no more denial information of system_server try to
      searcg in fs_bpf
            atest android.net.cts.TrafficStatsTest
      Bug: 75285088
      
      Change-Id: I1040cde6c038eccc4e91c69a10b20aa7a18b19f6
      (cherry picked from aosp commit f83bbd17)
      88ef20aa
  10. Mar 23, 2018
    • Chenbo Feng's avatar
      Allow system server to access bpf fs · f83bbd17
      Chenbo Feng authored
      The permission to allow system_server to access sys/fs/bpf/ directory
      is missing. Add it back so it can get the bpf maps from the bpf_fs.
      
      Test: device boot and no more denial information of system_server try to
      searcg in fs_bpf
            atest android.net.cts.TrafficStatsTest
      Bug: 75285088
      
      Change-Id: I1040cde6c038eccc4e91c69a10b20aa7a18b19f6
      f83bbd17
    • Andreas Gampe's avatar
      Sepolicy: Give system server fd rights to perfprofd · 0193620b
      Andreas Gampe authored
      So that perfprofd can send larger packets to dropbox.
      
      Follow-up of commit 3fa95acb.
      
      (cherry picked from commit c9df8437)
      
      Bug: 73175642
      Test: m
      Test: manual
      Merged-In: I88d1f83962243589909ff1ce3d02195e7c494256
      Change-Id: I88d1f83962243589909ff1ce3d02195e7c494256
      0193620b
  11. Mar 22, 2018
    • Mikhail Naganov's avatar
      Allow system_server to update timerslack_ns for hal_audio_default · b506a352
      Mikhail Naganov authored
      Based on the following audit message:
      
      type=1400 audit(1521738979.005:385): avc: denied { write } for pid=1269
      comm="Binder:1269_B" name="timerslack_ns" dev="proc" ino=254190
      scontext=u:r:system_server:s0 tcontext=u:r:hal_audio_default:s0
      tclass=file permissive=1
      
      Bug: 74110604
      Test: adb shell dmesg | grep hal_audio_default
      Change-Id: I4c2e787588eb9d223d5e50e1bc8f67876de97c2e
      b506a352
    • Mikhail Naganov's avatar
      Allow system_server to update timerslack_ns for hal_audio_default · e6293b1c
      Mikhail Naganov authored
      Based on the following audit message:
      
      type=1400 audit(1521738979.005:385): avc: denied { write } for pid=1269
      comm="Binder:1269_B" name="timerslack_ns" dev="proc" ino=254190
      scontext=u:r:system_server:s0 tcontext=u:r:hal_audio_default:s0
      tclass=file permissive=1
      
      Bug: 74110604
      Test: adb shell dmesg | grep hal_audio_default
      Change-Id: I4c2e787588eb9d223d5e50e1bc8f67876de97c2e
      e6293b1c
  12. Mar 20, 2018
  13. Mar 19, 2018
    • Hector Dearman's avatar
      Allow system server to set persist.traced.enable · 6f2040f8
      Hector Dearman authored
      To enable/disable the traced and traced_probes deamons remotely we would
      like system server to be able to set persist.traced.enable.
      See also ag/3736001.
      
      Denial:
      selinux: avc: denied { set } for
      property=persist.traced.enable
      pid=1606 uid=1000 gid=1000
      scontext=u:r:system_server:s0
      tcontext=u:object_r:default_prop:s0 tclass=property_service
      permissive=0\x0a
      
      Run:
      $ adb shell 'ps -A | grep traced'
      Should see traced.
      $ adb shell 'settings put global sys_traced 0'
      $ adb shell 'ps -A | grep traced'
      Should no longer see traced.
      
      Test: See above.
      Change-Id: I245b7df3853cabeb0e75db41fb4facaa178ab8f1
      6f2040f8
  14. Mar 07, 2018
    • Chenbo Feng's avatar
      Fix sepolicy for bpf object · 6cd70c2f
      Chenbo Feng authored
      With the new patches backported to 4.9 kernels, the bpf file system now
      take the same file open flag as bpf_obj_get. So system server now need
      read permission only for both bpf map and fs_bpf since we do not need
      system server to edit the map. Also, the netd will always pass stdin
      stdout fd to the process forked by it and do allow it will cause the
      fork and execev fail. We just allow it pass the fd to bpfloader for now
      until we have a better option.
      
      Test: bpfloader start successful on devices with 4.9 kernel.
            run cts -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
      Bug: 74096311
      Bug: 30950746
      
      Change-Id: I747a51cb05ae495c155e7625a3021fc77f921e0d
      6cd70c2f
  15. Mar 06, 2018
    • Chenbo Feng's avatar
      Fix sepolicy for bpf object · bfa95fcd
      Chenbo Feng authored
      With the new patches backported to 4.9 kernels, the bpf file system now
      take the same file open flag as bpf_obj_get. So system server now need
      read permission only for both bpf map and fs_bpf since we do not need
      system server to edit the map. Also, the netd will always pass stdin
      stdout fd to the process forked by it and do allow it will cause the
      fork and execev fail. We just allow it pass the fd to bpfloader for now
      until we have a better option.
      
      Test: bpfloader start successful on devices with 4.9 kernel.
            run cts -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
      Bug: 74096311
      Bug: 30950746
      
      Change-Id: I747a51cb05ae495c155e7625a3021fc77f921e0d
      bfa95fcd
  16. Mar 01, 2018
    • Jerry Zhang's avatar
      Add functionfs access to system_server. · 1d401545
      Jerry Zhang authored
      UsbDeviceManager in system_server now
      helps set up the endpoint files.
      
      Bug: 72877174
      Test: No selinux denials
      Change-Id: I96b11ee68799ac29b756d2034e7f5e4660dbed98
      1d401545
  17. Feb 28, 2018
    • Jeff Vander Stoep's avatar
      system_server: grant read access to vendor/framework · 9e33565c
      Jeff Vander Stoep authored
      avc: denied { getattr } for path="/vendor/framework"
      scontext=u:r:system_server:s0 tcontext=u:object_r:vendor_framework_file:s0
      tclass=dir
      
      Bug: 68826235
      Test: boot Taimen, verify denials no longer occur.
      Change-Id: Id4b311fd423342c8d6399c3b724417aff9d1cd88
      9e33565c
  18. 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
  19. 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
  20. Feb 15, 2018
    • Robert Sesek's avatar
      SELinux changes to accomodate starting the webview_zygote as a child of the zygote. · febdfa4e
      Robert Sesek authored
      In this architecture, the system_server instructs the zygote to fork a
      child-zygote to be the webview_zygote. The system_server tells this new
      zygote to listen for fork requests on a random abstract unix socket of
      its choosing.
      
      A follow-up CL will remove the rules for starting webview_zygote via
      init.
      
      Bug: 63749735
      Test: m
      Test: Launch "Third-party licenses" activity from Settings, and it
            renders correctly via the WebView.
      Merged-In: I864743943c11c18de386010ecd4b616721cb9954
      Change-Id: I1c352e47b66eca3a3fa641daa6ecc3e7a889b54e
      febdfa4e
  21. Feb 14, 2018
    • Robert Sesek's avatar
      SELinux changes to accomodate starting the webview_zygote as a child of the zygote. · bacb19b9
      Robert Sesek authored
      In this architecture, the system_server instructs the zygote to fork a
      child-zygote to be the webview_zygote. The system_server tells this new
      zygote to listen for fork requests on a random abstract unix socket of
      its choosing.
      
      A follow-up CL will remove the rules for starting webview_zygote via
      init.
      
      Bug: 63749735
      Test: m
      Test: Launch "Third-party licenses" activity from Settings, and it
            renders correctly via the WebView.
      Change-Id: I864743943c11c18de386010ecd4b616721cb9954
      bacb19b9
  22. Feb 06, 2018
    • Niklas Brunlid's avatar
      Allow system_server to create files on configfs · 8e0086a8
      Niklas Brunlid authored
      A change in the "open" syscall between kernel 4.4 and 4.9 means that
      the "create" action is now checked and makes system_server trigger
      an SELinux denial when PackageSettings is removing a user ID from
      Settings.java/writeKernelRemoveUserLPr() in PackageManager.
      
      Bug: 70150770
      Test: Manual
      - Add a new user on the device, no need to perform setup.
      - Wait 30s
      - Remove the added user
      - While running, check the result of:
          adb logcat -v time -b events | grep audit | grep system_server
      Change-Id: I1f490ea95d5bcb2adc76cba041bffbea131b447a
      8e0086a8
  23. Feb 05, 2018
  24. Jan 29, 2018
    • Primiano Tucci's avatar
      SELinux policies for Perfetto cmdline client (/system/bin/perfetto) · 1a9f4f7a
      Primiano Tucci authored
      Instead of having statsd linking the perfetto client library
      and talk directly to its socket, we let just statsd exec()
      the /system/bin/perfetto cmdline client.
      
      There are two reasons for this:
      1) Simplify the interaction between statsd and perfetto, reduce
        dependencies, binary size bloat and isolate faults.
      2) The cmdline client also takes care of handing the trace to
        Dropbox. This allows to expose the binder interaction surface
        to the short-lived cmdline client and avoid to grant binder
        access to the perfetto traced daemon.
      
      This cmdline client will be used by:
       - statsd
       - the shell user (for our UI and Studio)
      
      Bug: 70942310
      Change-Id: I8cdde181481ad0a1a5cae5937ac446cedac54a1f
      1a9f4f7a
  25. Jan 25, 2018
  26. 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
  27. Jan 23, 2018
  28. Jan 19, 2018
  29. Jan 17, 2018
    • Tri Vo's avatar
      system_server: remove access sysfs_devices_system_cpu · 35c65c1e
      Tri Vo authored
      CpuFrequency.java seems to be the only thing that depends on
      /sys/devices/system/cpu in system_server. And according to
      b/68988722#comment15, that dependency is not exercised.
      
      Bug: 68988722
      Test: walleye boots without denials to sysfs_devices_system_cpu
      Change-Id: If777b716bf74188581327b7f5aa709f5d88aad2d
      35c65c1e
  30. Jan 16, 2018
  31. Jan 12, 2018
    • Roshan Pius's avatar
      sepolicy(hostapd): Add a HIDL interface for hostapd · 5bca3e86
      Roshan Pius authored
      Change sepolicy permissions to now classify hostapd as a HAL exposing
      HIDL interface.
      
      Sepolicy denial for accessing /data/vendor/misc/wifi/hostapd:
      12-27 23:40:55.913  4952  4952 W hostapd : type=1400 audit(0.0:19): avc:
      denied { write } for name="hostapd" dev="sda13" ino=4587601
      scontext=u:r:hal_wifi_hostapd_default:s0
      tcontext=u:object_r:system_data_file:s0 tclass=dir permissive=0
      
      01-02 19:07:16.938  5791  5791 W hostapd : type=1400 audit(0.0:31): avc:
      denied { search } for name="net" dev="sysfs" ino=30521
      scontext=u:r:hal_wifi_hostapd_default:s0
      tcontext=u:object_r:sysfs_net:s0 tclass=dir permissive=0
      
      Bug: 36646171
      Test: Device boots up and able to turn on SoftAp.
      Change-Id: Ibacfcc938deab40096b54b8d0e608d53ca91b947
      5bca3e86
  32. 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
  33. Jan 10, 2018
    • Andrew Scull's avatar
      authsecret HAL policies. · 1aedf4b5
      Andrew Scull authored
      Bug: 71527305
      Test: compile and boot
      Change-Id: I91097bd62d99b8dd9eb6f53060badbaf0f4b8b4a
      1aedf4b5
    • Jaekyun Seok's avatar
      Whitelist exported platform properties · e4971454
      Jaekyun Seok authored
      This CL lists all the exported platform properties in
      private/exported_property_contexts.
      
      Additionally accessing core_property_type from vendor components is
      restricted.
      Instead public_readable_property_type is used to allow vendor components
      to read exported platform properties, and accessibility from
      vendor_init is also specified explicitly.
      
      Note that whitelisting would be applied only if
      PRODUCT_COMPATIBLE_PROPERTY is set on.
      
      Bug: 38146102
      Test: tested on walleye with PRODUCT_COMPATIBLE_PROPERTY=true
      Change-Id: I304ba428cc4ca82668fec2ddeb17c971e7ec065e
      e4971454
  34. Jan 02, 2018
Loading