Skip to content
Snippets Groups Projects
  1. May 23, 2022
  2. May 16, 2022
    • Maciej Żenczykowski's avatar
      drop support for pre-4.14 kernels · 6ed2ab9b
      Maciej Żenczykowski authored
      
      S had a minimum kernel requirement of 4.9,
      T bumps this up to 4.14, which adds net cgroup bpf support.
      
      It's important to ship T with this otherwise we'll be forced
      into trying to somehow support 4.9 kernels with T mainline
      module updates for years and years, when we no longer have
      any tests of the old code paths...
      
      Test: TreeHugger
      Bug: 232017472
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: I6e873f0815f176f5618278087132156c9974d6ea
      6ed2ab9b
  3. Mar 07, 2022
    • Hungming Chen's avatar
      BpfHandler: only allow to tag INET/INET6 socket · bcc0f5b1
      Hungming Chen authored
      This is a follow up commit for the family validation {INET, INET6}.
      The protocol validation {TCP, UDP} has been added in previous
      commit.
      
      The TrafficController socket destroy listener only monitors
      on the group {INET_TCP, INET_UDP, INET6_TCP, INET6_UDP}.
      Tagging listener unsupported socket causes that the tag can't
      be removed from tag map automatically. Eventually, the tag map
      run out of space because of dead tag entries.
      
      See TrafficController::makeSkDestroyListener in
      packages/modules/Connectivity/service/native/TrafficController.cpp
      
      Also address the comments from previous commit.
      - Remove the useless else-statment in tagSocket protocol validation.
      - Make the socket cookie query and test into one line in
        BpfHandlerTest#TestTagSocketWithUnsupportedProtocol
      
      Bug: 223094609
      Test: atest BpfHandlerTest
      Change-Id: I0f571fc00caa01c86399f0dbb593e8a40ad94bbd
      bcc0f5b1
    • Hungming Chen's avatar
      BpfHandler: only allow to tag udp/tcp socket · 478c0eb2
      Hungming Chen authored
      The TrafficController socket destroy listener only monitors
      on the group {INET_TCP, INET_UDP, INET6_TCP, INET6_UDP}.
      Tagging listener unsupported socket causes that the tag can't
      be removed from tag map automatically. Eventually, the tag map
      run out of space because of dead tag entries.
      
      See TrafficController::makeSkDestroyListener in
      packages/modules/Connectivity/service/native/TrafficController.cpp
      
      Bug: 223094609
      Test: atest BpfHandlerTest
      Change-Id: Icc19b7c9f37fef498b89f43e44767f6b9e931a5a
      478c0eb2
  4. Mar 04, 2022
  5. Feb 10, 2022
  6. Feb 03, 2022
    • Maciej Żenczykowski's avatar
      link libbase & libnetdutils dynamically - save ~17.5 kiB · dcae3516
      Maciej Żenczykowski authored
      
      Before:
        $ adbz root && adbz wait-for-device && adbz shell ls -l /apex/com.android.tethering/{bin/for-system,lib,liv64}
        /apex/com.android.tethering/bin/for-system:
      = -rwsr-sr-x 1 clat clat 18412 1969-12-31 16:00 clatd
      
        /apex/com.android.tethering/lib:
      = -rw-r--r-- 1 system system  64560 1969-12-31 16:00 libandroid_net_connectivity_com_android_net_module_util_jni.so
      = -rw-r--r-- 1 system system 713636 1969-12-31 16:00 libc++.so
      = -rw-r--r-- 1 system system  13596 1969-12-31 16:00 libframework-connectivity-jni.so
      d -rw-r--r-- 1 system system 212624 1969-12-31 16:00 libnetd_updatable.so
      d -rw-r--r-- 1 system system 948044 1969-12-31 16:00 libservice-connectivity.so
      
      After:
        $ adbz root && adbz wait-for-device && adbz shell ls -l /apex/com.android.
        /apex/com.android.tethering/bin/for-system:
      = -rwsr-sr-x 1 clat clat 18412 1969-12-31 16:00 clatd
      
        /apex/com.android.tethering/lib:
      = -rw-r--r-- 1 system system  64560 1969-12-31 16:00 libandroid_net_connectivity_com_android_net_module_util_jni.so
      + -rw-r--r-- 1 system system 251404 1969-12-31 16:00 libbase.so
      = -rw-r--r-- 1 system system 713636 1969-12-31 16:00 libc++.so
      = -rw-r--r-- 1 system system  13596 1969-12-31 16:00 libframework-connectivity-jni.so
      d -rw-r--r-- 1 system system  45584 1969-12-31 16:00 libnetd_updatable.so
      + -rw-r--r-- 1 system system  95872 1969-12-31 16:00 libnetdutils.so
      d -rw-r--r-- 1 system system 749980 1969-12-31 16:00 libservice-connectivity.so
      
      Delta: -212624-948044+251404+45584+95872+749980 == -17828
      
      Test: TreeHugger
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: Id88468442c4f3f24d5bca96b75effb69f20038bf
      dcae3516
  7. Feb 01, 2022
    • Maciej Żenczykowski's avatar
      link libbase statically into libnetd_updatable - saves ~85 kB · f8943ea3
      Maciej Żenczykowski authored
      
      Before (aosp_cf_x86_phone-userdebug):
        $ adbz shell ls -l /apex/com.android.tethering/lib
        -rw-r--r-- 1 system system 251404 1969-12-31 16:00 libbase.so
        -rw-r--r-- 1 system system 713636 1969-12-31 16:00 libc++.so
        -rw-r--r-- 1 system system  64560 1969-12-31 16:00 libcom_android_connectivity_com_android_net_module_util_jni.so
        -rw-r--r-- 1 system system  13596 1969-12-31 16:00 libframework-connectivity-jni.so
        -rw-r--r-- 1 system system  45776 1969-12-31 16:00 libnetd_updatable.so
        -rw-r--r-- 1 system system 948032 1969-12-31 16:00 libservice-connectivity.so
      
      After (aosp_cf_x86_phone-userdebug):
        $ adbz shell ls -l /apex/com.android.tethering/lib
        -rw-r--r-- 1 system system 713636 1969-12-31 16:00 libc++.so
        -rw-r--r-- 1 system system  64560 1969-12-31 16:00 libcom_android_connectivity_com_android_net_module_util_jni.so
        -rw-r--r-- 1 system system  13596 1969-12-31 16:00 libframework-connectivity-jni.so
        -rw-r--r-- 1 system system 212624 1969-12-31 16:00 libnetd_updatable.so
        -rw-r--r-- 1 system system 948032 1969-12-31 16:00 libservice-connectivity.so
      
      Test: TreeHugger
      Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: I19c9d73ba3555bbc1987fbdc0be19af1f0511948
      f8943ea3
  8. Jan 30, 2022
    • Ken Chen's avatar
      [NETD-BPF#19] Mainline part of bpf code from netd · 1647f60d
      Ken Chen authored
      1. Add libnetd_updatable.so in com.android.tethering. The library is
      loaded by netd. Currently, it mainly targets on a few functions which
      access BPF maps. The functionality may extend in the future.
      
      2. Attach gcroup progs from libnetd_updatable.so.
      
      3. Move (privileged)TagSocket and untagSocket implementation to mainline
      module. Combine privilegedTagSocket and untagSocket into a single
      function.
      
      4. Split related unit tests from netd_unit_test to
      libnetd_updatable_unit_test as well.
      
      Bug: 202086915
      Test: cd system/netd; atest
      Test: atest TrafficStatsTest NetworkUsageStatsTest
      
      Change-Id: Ib556458103a4cbb643c1342d9b689ac692160de0
      1647f60d
Loading