summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-23Snap for 8756258 from fac4f05be7032c5983b427ab0d5edba3fce70b4b to tm-release ↵android13-gsiAndroid Build Coastguard Worker
am: 1106ab8676 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/19036878 Change-Id: I89eae0bfb56c181dc940511647443d436933a22e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22Snap for 8756258 from fac4f05be7032c5983b427ab0d5edba3fce70b4b to tm-releaseandroid-vts-13.0_r1android-security-13.0.0_r1android-cts-13.0_r1android-13.0.0_r6android-13.0.0_r5android-13.0.0_r4android-13.0.0_r3android-13.0.0_r2android-13.0.0_r1android13-s3-releaseandroid13-s2-releaseandroid13-s1-releaseAndroid Build Coastguard Worker
Change-Id: I7350a7eabb6915f9db4c3b0ac90ddb207fcb6801
2022-06-22Merge "Skip cts testFirewallBlocking in instant mode." into tm-devandroid13-devTreeHugger Robot
2022-06-22Merge "Revert "Disable NetworkStatsRecorder Test"" into tm-devAaron Huang
2022-06-22Skip cts testFirewallBlocking in instant mode.Motomu Utsumi
Bug: 236662581 Test: aest android.net.cts.ConnectivityManagerTest#testFirewallBlocking --instant Change-Id: Ib8752439593dcd285146746b06b29f364e66ab85 (cherry picked from commit c4e6fcb6bc25630c5c8a67b425354028ae164644) Merged-In: Ib8752439593dcd285146746b06b29f364e66ab85
2022-06-22Revert "Disable NetworkStatsRecorder Test"Aaron Huang
This reverts commit befadfe3d124b7e6484cdc8693013513c7afb1fc. Reason for revert: Prebuilts are updated and tests should pass now Change-Id: Iccbce39fccc1d47deac8beec4de7c3815c086f86 Merged-In: I47fb59334d00ae7fee91c5694548b3cf89b09b2d
2022-06-22Snap for 8750474 from 5409851f438e90beee996d4f68a0d2408c7c4414 to tm-release ↵Android Build Coastguard Worker
am: 8cc516c798 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/19021787 Change-Id: I87f9a85970a3ee04931c98124f6beeacf5ef16e8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21Snap for 8750474 from 5409851f438e90beee996d4f68a0d2408c7c4414 to tm-releaseAndroid Build Coastguard Worker
Change-Id: Iebe985396981ea7a2fd0c06a569340588c5e5476
2022-06-21Merge "Disable comparison in user release builds" into tm-devRemi NGUYEN VAN
2022-06-21Disable comparison in user release buildsJunyu Lai
This CL disable the comparison mechanism introduced in previous beta releases to stop receiving log.wtf signals from beta users. This CL only affects logging on user release builds. Ignore-AOSP-First: Parent CLs are not in aosp yet Test: 1. NetworkStatsServiceTest 2. manual test with script Bug: 233752318 Change-Id: I7047106b1019c29460d6633b148f501ffa62f139
2022-06-21Merge "Increase fallbacks counter when comparison result is different" into ↵Junyu Lai
tm-dev
2022-06-21Increase fallbacks counter when comparison result is differentJunyu Lai
In current code, the fallbacks counter does not increase when comparison result is different. This will not impact how we print log.wtf but will impact the dry run process for debugging in next every later boots. Ignore-AOSP-First: Parent CLs are not in aosp yet Test: 1. NetworkStatsServiceTest 2. manual test with script Bug: 233752318 Change-Id: Ib152cec2ee0f21d59ccfe4669b31f26b3db71a97
2022-06-21adjust for newly added bpf map/prog definition fields in T+Maciej Żenczykowski
This is needed due to BpfLoader v0.18 supporting more functionality and thus bpf code compilation by default using larger structs than it did during S. Bug: 218408035 Test: booted on cuttlefish, atest CtsNativeNetTestCases OBSigned-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I0a37e59760fb0b55e6d6a6d12d5fd40106accd55 (cherry picked from commit b95db2808073beae71d41e07e2e1c3e6581c7d65) Merged-In: I0a37e59760fb0b55e6d6a6d12d5fd40106accd55
2022-06-20netd bpf program - use finer grained selinux privs, part 1Maciej Żenczykowski
Make use of new BpfLoader functionality: per-map/program selinux context to further restrict access to mainline module shipped bpf maps and programs. Note: minor fixup during cherrypick to deal with lack of the require 4.14 patch in tm-dev. Bug: 218408035 Test: booted on cuttlefish, TreeHugger Change-Id: Iaa33754aaca8bfafef6539abfbdd30b4cdfc4727 Merged-In: Iaa33754aaca8bfafef6539abfbdd30b4cdfc4727 (cherry picked from commit cae181d7773f15d78ce49ec0e839690e39270465)
2022-06-21switch netd_configuration_map from hash map to arrayMaciej Żenczykowski
This eliminates the need for netd_updatable BpfHandler.cpp to initialize the hash map with a zero. On startup the map will be freshly initialized and thus zero. On restart it might not be empty, but it doesn't matter to netd. Furthermore the mainline component of the system server will re-initialize it again anyway: see service/native/TrafficController.cpp initMaps() This does remove the ability to call deleteValue on a key, since that would always return -EINVAL, but since we don't currently do that, that's really a feature. (It does suggest though that we should have a BpfMapNonNullable class which is writeable, but without a deleteValue() function) Additionally BpfMap arrays are more efficient for the kernel bpf jit compiler, as - on newer kernels - it can optimize the read/write into a simple memory access (as opposed to a bpf helper call). Before: $ adb shell ls -l /sys/fs/bpf/netd_shared/map_netd_configuration_map -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:20 /sys/fs/bpf/netd_shared/ map_netd_configuration_map After: $ adbz shell ls -l /sys/fs/bpf/netd_shared/map_netd_configuration_map -r--rw---- 1 root net_bw_acct 0 2022-06-16 15:03 /sys/fs/bpf/netd_shared/map_netd_configuration_map Bug: 218408035 Bug: 235590615 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I21730e4fa22fbf0c94ab0ca5c5db03aa000b7680 (cherry picked from commit b10e055f4b63ef5ae12585069481558b93ecd87f) Merged-In: I21730e4fa22fbf0c94ab0ca5c5db03aa000b7680
2022-06-21verify CLAT_MARK matches aidl constant.Maciej Żenczykowski
Bug: 235778483 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ife3ad35b2e5451727a3795a0e78dd820293c0eae (cherry picked from commit ce9108f01a3713a11a1831d36f60aaa5d169cf11) Merged-In: Ife3ad35b2e5451727a3795a0e78dd820293c0eae
2022-06-21bpf_progs - eliminate netd.c dependency on UidConstants.hMaciej Żenczykowski
Per Lorenzo's request on: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2123888 Bug: 218408035 Bug: 235778483 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Id464fc2418efcb3764fae2a25c11fdda4439f411 (cherry picked from commit b909d8af557105c33501c9e3318b696da9445e11) Merged-In: Id464fc2418efcb3764fae2a25c11fdda4439f411
2022-06-21netd.c - reduce privs on mapsMaciej Żenczykowski
Before: $ adb shell ls -l /sys/fs/bpf/netd_shared/map_netd_* -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_app_uid_stats_map -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_configuration_map -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_cookie_tag_map -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_iface_index_name_map -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_iface_stats_map -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_stats_map_A -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_stats_map_B -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_uid_counterset_map -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_uid_owner_map -rw-rw---- 1 root net_bw_acct 0 2022-06-11 08:17 /sys/fs/bpf/netd_shared/map_netd_uid_permission_map After: $ adb shell ls -l /sys/fs/bpf/netd_shared/map_netd_* ----rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_app_uid_stats_map -rw-rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_configuration_map -rw-rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_cookie_tag_map ----rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_iface_index_name_map ----rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_iface_stats_map -rw-rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_stats_map_A -r--rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_stats_map_B ----rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_uid_counterset_map ----rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_uid_owner_map -rw-rw---- 1 root net_bw_acct 0 2022-06-13 18:17 /sys/fs/bpf/netd_shared/map_netd_uid_permission_map Access required is based on list of maps at netd/BpfHandler.h:62 BpfMap<uint64_t, UidTagValue> mCookieTagMap; BpfMap<StatsKey, StatsValue> mStatsMapA; BpfMap<StatsKey, StatsValue> mStatsMapB; BpfMap<uint32_t, uint32_t> mConfigurationMap; BpfMap<uint32_t, uint8_t> mUidPermissionMap; Note that this is still just a first stab at things. The only one which should really be writable is mCookieTagMap, but that's for follow ups as it gets real difficult to switch due to the tests and BpfMap vs BpfMapRO inheritance inversion. Additionally due to netd being root with CAP_DAC_OVERRIDE, this change is really a no-op, and will be until we add proper per map selinux contexts. So it is in a sense only a documentation of intent change... Bug: 218408035 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I86f3028251818c2025503839c7225d07a2943ed0 (cherry picked from commit a4a58a3be2b106043a096b069e8fbcec86cce7c7) Merged-In: I86f3028251818c2025503839c7225d07a2943ed0
2022-06-21BpfHandler.h - switch mStatsMapB from BpfMap to BpfMapROMaciej Żenczykowski
We'd like to switch more of these (as netd should only be writing into the cookie map), but this is the only one where tests (and the BpfMap vs BpfMapRO inheritence inversion) don't get in our way. We'll fix the rest later. This gives us an *example* for further testing. Bug: 218408035 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I9b280c7ba2d19644fc3cdd0c132de85f45df69b4 (cherry picked from commit 21ce721bc087d679686acedd06ec7d2b19cad164) Merged-In: I9b280c7ba2d19644fc3cdd0c132de85f45df69b4
2022-06-21bpf programs: switch from integers to #define'd bpfloader versionsMaciej Żenczykowski
(per request from Lorenzo) We do bump block/clatd/dscp_policy requirements from 0.12 to 0.13, but this effectively doesn't matter: - Beta2 is too old either way (pre-0.12) - Beta3 is new enough (0.13) - versions in between are simply obsolete / unused / not important - bpfloader 0.12 won't boot right anyway due to lack of netd maps/programs (which cause a netd startup failure) This allows us to have one less #define in the header files, with a hard to write explanation about what exactly v0.12 is (or was). Bug: 218408035 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I1ecf15f9d7abbb82ec6bd49848255fab6a41aed4 (cherry picked from commit f769952212aa081c9f9c77cb264dedaeefd5bcda) Merged-In: I1ecf15f9d7abbb82ec6bd49848255fab6a41aed4
2022-06-21Snap for 8746455 from 99f342e229d006c5d0d7ba93449780243e386fe7 to tm-release ↵Android Build Coastguard Worker
am: 22e5d6402d Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/19005891 Change-Id: Idbdfc3a1f7b047866bf1e6e4c4c684da14be1bf1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20Snap for 8746455 from 99f342e229d006c5d0d7ba93449780243e386fe7 to tm-releaseAndroid Build Coastguard Worker
Change-Id: Iec8d702c4ae42448a9b6fae5baaa84496d20c398
2022-06-18Snap for 8740412 from befadfe3d124b7e6484cdc8693013513c7afb1fc to tm-release ↵Android Build Coastguard Worker
am: 792cbbb5eb Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18976725 Change-Id: I35d2f0e8201022f554e4dcc383461cbeb6ce603a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18Snap for 8735997 from ab3e14471b9340d1f8312c14aa9bbc4c66cb9508 to tm-release ↵Android Build Coastguard Worker
am: c93477b422 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18961620 Change-Id: Ia1c44b0f06c35b6ccbbfee45f1c73ca58aa09bf6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-18Snap for 8740412 from befadfe3d124b7e6484cdc8693013513c7afb1fc to tm-releaseAndroid Build Coastguard Worker
Change-Id: I1352d9e707795a03b088633de95bbe89030e1353
2022-06-17Send callback if ip provisioning is interruptedJames Mattis
A callback is expected to be sent on either success or failure when the EthernetManager#updateConfiguration API is called. Currently, if this API is called for an active interface and marked restricted, after the IP provisioning process is started in EthernetNetworkFactory, the interface will then processe all the onNetworkUneeded requests for the newly restricted network. Assuming no apps have requests for this particular network or restricted networks, the network will be stopped once the outstanding network request count reaches zero. If provisioning hasn't completed yet for the original updateConfiguration call, the original callback will be cleared out on stop and will never notify the original caller of EthernetManager#updateConfiguration whose call was aborted. Bug: 235907515 Test: eth unit and cts tests Change-Id: I91359272c07e090039049370ba9f438546fce3ad (cherry picked from commit 265eba982d1ba0ac9fb3d4c21ad6adc36eab049c) Merged-In: I91359272c07e090039049370ba9f438546fce3ad
2022-06-17Disable NetworkStatsRecorder TestAaron Huang
Disable test since it won't pass until prebuilt module updated. Ignore-AOSP-First: urgent fix and will cherry-pick immediately after. Bug: 233828210 Bug: 234099453 Test: FrameworksNetTests (merged-in tag is pointed to an unrelated CL that only exists on aosp and its downstreams, to make this CL doesn't get merged in aosp downstreams) Change-Id: I81b43e6a1410e7cf241487ef213acf0cbcfd019d Merged-In: I47fb59334d00ae7fee91c5694548b3cf89b09b2d
2022-06-17Add wipeOnError flag to NetworkStatsRecorderAaron Huang
If reading data happens exception while doing data migration, the file will be deleted by legacy recorders. This would cause legacy persistent data being lost and cannot be retrieved by any method. To avoid the files being deleted, add a wipeOnError flag to recorder which indicates this recorder will wipe on error or not . If the flag is set to true then deletes all files when it throws, otherwise keeps all files. Ignore-AOSP-First: urgent fix and will cherry-pick immediately after. Bug: 233828210 Test: FrameworksNetTests:NetworkStatsRecorderTest Change-Id: Id7a3d8bebf8a00d814f9e84bf4c10d927e6ff749
2022-06-16Snap for 8735997 from ab3e14471b9340d1f8312c14aa9bbc4c66cb9508 to tm-releaseAndroid Build Coastguard Worker
Change-Id: I636d0470cc90d989c71c342482a4ab147221c857
2022-06-16Merge "Revert "Temporarily ignore ethernet tests until prebuilts are ↵Patrick Rohr
updated"" into tm-dev
2022-06-16Merge "Revert "Ignore new test until prebuilts are updated."" into tm-devTreeHugger Robot
2022-06-16Merge "Revert "Disable NsdManager tests that need a new prebuilt"" into tm-devTreeHugger Robot
2022-06-16Merge "Revert "Temporarily disable testUidStatsForTransport"" into tm-devTreeHugger Robot
2022-06-16Merge "Revert "Temporarily disable NsdService unit tests"" into tm-devTreeHugger Robot
2022-06-16Merge "Revert "Ignore new EthernetManager test until prebuilts are ↵TreeHugger Robot
updated."" into tm-dev
2022-06-16Merge "fix minor whitespace nit" into tm-devMaciej Żenczykowski
2022-06-16fix minor whitespace nitMaciej Żenczykowski
Test: N/A Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: If472cdec22b04f605f40b680c907a3384dce3cdc (cherry picked from commit fa2b1dc6b00bb22fb0869589b47ebe25a246c3ad) Merged-In: If472cdec22b04f605f40b680c907a3384dce3cdc
2022-06-16move XtBpfProgLocations.h into a new header libraryMaciej Żenczykowski
Bug: 235778483 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ia5e3c72e65cee17ef67907008d8fe6d4e47050de (cherry picked from commit 200d372dc9c023c3fec69d260305f0079be8944b) Merged-In: Ia5e3c72e65cee17ef67907008d8fe6d4e47050de
2022-06-16Snap for 8730838 from 801154ac8a3153d21136cd2187577c29a6d87d2a to tm-release ↵Android Build Coastguard Worker
am: 4e20d5a57d Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/18917423 Change-Id: Ida31b86d7478f290fe0c233427321d1ba4767515 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15Snap for 8730838 from 801154ac8a3153d21136cd2187577c29a6d87d2a to tm-releaseAndroid Build Coastguard Worker
Change-Id: I70031e6589e96871f15ef12d41c991da4eec5b48
2022-06-15Merge "Disable fallback when comparison result is different" into tm-devJunyu Lai
2022-06-15Revert "Temporarily ignore ethernet tests until prebuilts are updated"Patrick Rohr
This reverts commit 14f45a3e988e948bb0fda178f184aa4563b1f4eb. Reason for revert: Reenabling tests after prebuilts are updated. Bug: 233824546 Change-Id: I6883ea55dd390e7fe102b735e0b757e838d9eff6 Merged-In: I8e806b3b884f2e0b6c1a1d2fffdb9a99c5dd60e8
2022-06-15Disable fallback when comparison result is differentJunyu Lai
Follow-up from ag/18452103, where we add fallback code that runs with the importer to make sure they are identical. When the result is different, we'll take the result from fallback code to minimize the rollout risk. However, since the OEMs might change the importer implementation. The fallback code would no longer valid and that makes OEM modified code not working. Hence the fallback code must be disabled before release. This change keeps comparison enabled for all cases to keep getting signals from beta users. And will switch it to read overlay value for OEM to debug their solution. Ignore-AOSP-First: Parent CLs are not in aosp yet Test: 1. NetworkStatsServiceTest 2. Test all datasets with script Bug: 233752318 Change-Id: I869ff05297149bde6e13a204bd8c5a4fece75de0
2022-06-15assert that xt_bpf programs match Android T netd's expectationsMaciej Żenczykowski
Bug: 235778483 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ic0029063e4dbbf1b2cce7d7ca86a017a1c56f072 (cherry picked from commit 1205737641d428c367fab896f41a905eee254c4c) Merged-In: Ic0029063e4dbbf1b2cce7d7ca86a017a1c56f072
2022-06-15Merge "remove no longer needed bpf_connectivity headers visibility" into tm-devTreeHugger Robot
2022-06-15Merge "RateLimitTest: increase rate limit to deflake test on low-end hw" ↵TreeHugger Robot
into tm-dev
2022-06-15Merge "Revert "Disable NetworkStatsHistory builder test in tm-dev"" into tm-devJunyu Lai
2022-06-15remove no longer needed bpf_connectivity headers visibilityMaciej Żenczykowski
Bug: 235778483 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I3829ba49e453918bfcbae2e07dd2aea2b81e12bf (cherry picked from commit 5f5d2e2c10e5e463fc0b111bc5dc4b273c7c6092) Merged-In: I3829ba49e453918bfcbae2e07dd2aea2b81e12bf
2022-06-15Revert "Disable NetworkStatsHistory builder test in tm-dev"Junyu Lai
This CL reverts ag/18615112 and ag/18660036 by pointing the merged-in tag to an unrelated CL that only exists on aosp and its downstreams, to make this CL doesn't get merged in aosp downstreams. Ignore-AOSP-First: tm-dev only change. Bug: 234099453 Test: atest android.net.netstats.NetworkStatsHistoryTest Change-Id: Iefe38f7a671900f45475d1daf2f7d1f781aed540 Merged-In: I47fb59334d00ae7fee91c5694548b3cf89b09b2d Reason: Prebuilt is merged.
2022-06-15RateLimitTest: increase rate limit to deflake test on low-end hwPatrick Rohr
RateLimitTest is flaky on ADT-3; it slightly exceeds the limit when limiting at 1MB/s. This may be related to using a tun instead of a tap interface. After adding the interface MAC address to TestNetworkInterface, this test should be adapted to use a tap interface and properly account for burst size in U. Bug: 231495412 Test: atest RateLimitTest Change-Id: I645267d7143c2364c93998eaa71502e2aa10b5a6 (cherry picked from commit f8785cf1f9ecd810f58128488c5354316e2d57c1) Merged-In: I645267d7143c2364c93998eaa71502e2aa10b5a6