android_packages_modules_Co.../tests/net/java/android/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rubin Xu dc587d75e1 Block incoming non-VPN packets to apps under fully-routed VPN
When a fully-routed VPN is running, we want to prevent normal apps
under the VPN from receiving packets originating from any local non-VPN
interfaces. This is achieved by using eBPF to create a per-UID input
interface whitelist and populate the whitelist such that all
non-bypassable apps under a VPN can only receive packets from the VPN's
TUN interface (and loopback implicitly)

This is the framework part of the change that build the whitelist.
The whitelist needs to be updated in the following cases:
* When a VPN is connected and disconnected
    This will cover the change to allowBypass bit, since that can't be
    changed without reconnecting.
* When a VPN's NetworkCapabilites is changed (whitelist/blacklist app changes)
* When a new app is installed
* When an existing app is removed
* When a VPN becomes fully-routed or is no longer fully-routed

New user/profile creation will automatically result in a whitelist app change
transition so it doesn't need to be handled specially here.

Due to the limitation of the kernel IPSec interacting with eBPF (sk_buf->ifindex
does not point to the virtual tunnel interface for kernel IPSec), the whitelist
will only apply to app VPNs but not legacy VPN connections, to prevent breaking
connectivity with kernel IPSec entirely.

Test: atest PermissionMonitorTest
Test: atest android.net.RouteInfoTest
Test: atest com.android.server.ConnectivityServiceTest
Test: atest HostsideVpnTests
Bug: 114231106

Merged-In: I5af81bc80dadd086261ba4b1eb706cc873bb7cfa
Change-Id: I5af81bc80dadd086261ba4b1eb706cc873bb7cfa
(cherry picked from commit 65968ea16bf49f678d4a43c220e1d67393170459)
2019-04-24 11:56:46 +01:00
..
apf Add Parcelable implementation for ApfCapabilities 2019-03-15 13:41:59 +09:00
ipmemorystore Add DHCP address lease expiry in IpMemoryStore. 2019-03-29 16:51:47 +09:00
nsd Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
ConnectivityManagerTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
IpMemoryStoreTest.java Move the IpMemoryStore to the network stack. 2019-03-18 11:33:17 +09:00
IpSecAlgorithmTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
IpSecConfigTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
IpSecManagerTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
IpSecTransformTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
LinkAddressTest.java Fix Automated API Review issues. 2019-03-21 13:55:37 +08:00
LinkPropertiesTest.java Fix Automated API Review issues. 2019-03-21 13:55:37 +08:00
MacAddressTest.java Merge "Migrate frameworks/base/tests/net/ to androidx.test" am: e69a7a1554 am: 29e6ab8d01 2019-03-06 22:10:32 -08:00
NetworkCapabilitiesTest.java Check if network has partial connectivity 2019-03-12 07:37:33 +00:00
NetworkStatsHistoryTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
NetworkStatsTest.java NetworkStatsService: Fix getDetailedUidStats to take VPNs into account. 2019-03-28 10:31:51 -07:00
NetworkTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
NetworkUtilsTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
RouteInfoTest.java Block incoming non-VPN packets to apps under fully-routed VPN 2019-04-24 11:56:46 +01:00
StaticIpConfigurationTest.java Migrate frameworks/base/tests/net/ to androidx.test 2019-03-05 09:05:47 -08:00
TcpKeepalivePacketDataTest.java [TCPKeepalive] Fill correct TOS and TTL value 2019-03-25 11:14:57 +08:00