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
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
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 b95db28080)
Merged-In: I0a37e59760fb0b55e6d6a6d12d5fd40106accd55
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 cae181d777)
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 b10e055f4b)
Merged-In: I21730e4fa22fbf0c94ab0ca5c5db03aa000b7680
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 21ce721bc0)
Merged-In: I9b280c7ba2d19644fc3cdd0c132de85f45df69b4
(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 f769952212)
Merged-In: I1ecf15f9d7abbb82ec6bd49848255fab6a41aed4
The test will fail on T without an updated connectivity module, as it
uses new behavior implemented by a newer module version, such as
TestNetworkManager#createTapInterface(boolean, boolean).
Bug: 236558929
Change-Id: Ia74a31c8f7aabb4aae8eead5bba9f31cb7f2dd8d
Test: atest EthernetManagerTest
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
Make use of new BpfLoader functionality: per-map/program selinux context
to further restrict access to mainline module shipped bpf maps and programs.
Bug: 218408035
Test: booted on cuttlefish, TreeHugger
Change-Id: Iaa33754aaca8bfafef6539abfbdd30b4cdfc4727
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 265eba982d)
Merged-In: I91359272c07e090039049370ba9f438546fce3ad
This reverts the previous commit.
This is no longer required as v0.18 is now the default.
Test: Treehugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9331f27cf20e7932f6ef0e3829c27b6684dece59
This is a temporary thing for testing with framework/libs/net patch
that adds checks for V18 define.
This is very short term and will be reverted in the next topic,
that will make v0.18 the default.
Bug: 218408035
Test: booted on cuttlefish
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I22c414ebc64201db60eb872e0da0fea6c65eaede