No description. Add one?
  • Java 78%
  • Kotlin 11.8%
  • AIDL 4.4%
  • C++ 3.7%
  • C 1.5%
  • Other 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Chalard Jean 366c525b15 Sanitize NetworkCapabilities from agent on the handler thread
NetworkAgents send NetworkCapabilities to ConnectivityService but
there are limits to what exactly they can send. Going forward,
some of these checks will have to happen on the handler thread,
which is already the case when an agent updates its capabilities,
but not upon registration.

This patches moves the sanitization on the handler thread, after
the network monitor is created for a network agent.

Before this patch, upon registration of a new agent, the binder
thread would copy and sanitize the capabilities, then store them
in nai.networkCapabilities. It would store the original caps from
the agent in the NAI, mix in what is known from the network info,
process the LinkProperties, and then proceed to create the
network monitor, but not yet store the NAI in the internal
structures because its registration is not finalized, so other
methods should not see it yet. After the monitor is created in
the network stack process, the NAI is stored in the internal
structures which publishes it for all methods to see. After
that is done, the NAI calls to the network monitor to warn it
that it's registered, what its capabilities are, and that it's
time to start validation if applicable.

With this patch, the validation no longer happens on the binder
thread. Instead, the binder thread stores the capabilities and
link properties as is, before sanitization, in the NAI. This is
fine because no other method can access these until the
registration completes upon notification that the monitor has
been created ; this agent is only stored in the network monitor
callbacks in a self-destructing object precisely to make sure
that's the case.
When the monitor is created and CS receives notification of the
same, it will sanitize the capabilities before adding the NAI
to the internal structures, to protect the invariant that the
un-sanitized capabilities inside the NAI can't ever be seen by
any other method. After that's done, it will call to the
monitor to start validation as usual.

Test: FrameworksNetTests CtsNetTestsCases
Change-Id: I7d43ef0e25955e0349903b4801b9dfd8c3c92586
2022-01-31 17:04:46 +09:00
bpf_progs Process DSCP QoS events for policies 2022-01-27 10:19:27 +00:00
framework Process DSCP QoS events for policies 2022-01-27 10:19:27 +00:00
framework-t Prepare T build rules for backwards compatibility 2022-01-20 13:57:44 +08:00
service Sanitize NetworkCapabilities from agent on the handler thread 2022-01-31 17:04:46 +09:00
service-t Correct typos in libnetworkstats 2022-01-24 11:54:04 +08:00
tests Allow Carrier app to request for CBS capability 2022-01-30 12:12:17 -08:00
Tethering Merge "Conditionally disable TetheringApiCurrentLib" 2022-01-28 05:21:22 +00:00
.gitignore Add a .gitignore in packages/modules/Connectivity. 2020-11-27 18:09:21 +09:00
OWNERS Add additional IPsec owners 2021-12-08 06:57:51 +00:00
OWNERS_core_networking add prohr to OWNERS_core_networking 2022-01-11 18:54:31 +00:00
OWNERS_core_networking_xts Add an OWNERS_core_networking_xts for CTS/GTS/... and use it. 2022-01-18 01:42:39 +00:00
PREUPLOAD.cfg Enable tethering to perform its own hidden API processing 2021-06-28 23:41:38 +01:00
TEST_MAPPING Rename libnetdbpf to libnetworkstats 2022-01-24 11:53:59 +08:00