Commit Graph

8943 Commits

Author SHA1 Message Date
Luke Huang
854adb51eb Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I10202dc784bafa044a04546d0a765370331223dc
2020-06-18 14:46:02 +00:00
TreeHugger Robot
9a0218f958 Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev am: 65efcc84a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11869883

Change-Id: I84b0010488024aa9867ad4af7a4013854cdeeaa1
2020-06-18 14:34:45 +00:00
TreeHugger Robot
b3a9f82988 Merge "Treat RouteInfo with different interfaces as different routes" into rvc-dev am: 70e3f56147
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882397

Change-Id: I4c96f81ba9118b545b69eb507333f09ea634bdf8
2020-06-18 14:29:52 +00:00
Luke Huang
bbcd3b326b Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev 2020-06-18 03:03:06 +00:00
Luke Huang
5a42a4132f Disable sockets and DNS if process lacks INTERNET permission.
This is a Client-only solution.
  - Add to NetdClient a per-process std::atomic_boolean
    similar to netIdForProcess and netIdForResolv.
  - The boolean says whether the process should be
    allowed Internet connectivity.
  - Add an @hide method to NetUtils.java to set the boolean;
    call it from the initialization code of the new
    process just after forking from zygote.
  - Make netdClientSocket and dnsOpenProxy check the
    boolean. If the boolean is false, return EPERM from
    socket calls.

Bug: 150028556
Test: atest NetworkUtilsTest
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
Change-Id: If002280fbad493dfc2db3d9d505c0257d49a9056
Exempt-From-Owner-Approval: OWNERS already approved identical patchset 5
2020-06-18 03:02:06 +00:00
TreeHugger Robot
65efcc84a0 Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev 2020-06-17 15:26:22 +00:00
Treehugger Robot
58897cc491 Treat RouteInfo with different interfaces as different routes
On Android different interfaces usually use different routing tables.
As a result, a change in interface should not be treated as route
update, but rather a remove and an add.

This change fixes a bug in VPN seamless handover where routes
failed to be updated when a new tunnel interface replaces the existing
one within the same network.

Bug: 158696878
Test: atest com.android.cts.net.HostsideVpnTests
Test: atest NetworkStackTests
Test: atest CtsNetTestCases
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1331916
Merged-In: I57987233d42a0253eaee2e1ca5f28728c2354620
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620
2020-06-17 13:34:11 +00:00
TreeHugger Robot
35b7392a08 Merge "Test extra info sent to NetworkMonitor" into rvc-dev am: 8202b399da
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862409

Change-Id: Ie8f59a561f7184bcfbbe38e99da78ce092475ff8
2020-06-16 03:28:44 +00:00
Chiachang Wang
1182d5a7fc Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Merged-In: I4f827664c528bea30cc957a0a617dd37693f4460
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460
2020-06-16 01:57:46 +00:00
Benedict Wong
b001522433 Set correct owner UID for VPN agentConnect()
This commit changes agentConnect to set the owner UID as the mOwnerUid
field instead of the Binder.getCallingUid().

Binder.getCallingUid() can return incorrect results for platform VPNs,
as agentConnect() is called under a clean calling UID.

Additionally, this relaxes the ownerUid sanitization check to allow a
VPN network's owner to see it's own ownership information.

Vpn.mOwnerUid is guaranteed to be correct, as all VPNs MUST have called
prepareInternal() at some previous point, which sets mOwnerUid as the
package's UID (or SYSTEM_UID if this is legacy VPN).

Bug: 150135470
Test: CTS tests showing ownership information
Merged-In: Ic979dad73983d722365849fbfb0becfd432b894c
Change-Id: Ic979dad73983d722365849fbfb0becfd432b894c
(cherry picked from commit e29bf99a7fc1067c546d7fa6cbcb9001fb110d16)
2020-06-16 01:42:48 +00:00
Chalard Jean
14280d011d Merge "Document the limitation to a hundred callbacks." into rvc-dev am: df9ce18085
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11835429

Change-Id: Ic82a23e6f949bd2c74c3dc49da516938f0603e2e
2020-06-12 04:58:27 +00:00
Chalard Jean
df9ce18085 Merge "Document the limitation to a hundred callbacks." into rvc-dev 2020-06-12 04:54:02 +00:00
Aaron Huang
2070880fab Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev am: 70afc75769
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788484

Change-Id: I43328c82223382978ac3475a195011547f6d0fdc
2020-06-12 02:11:58 +00:00
Aaron Huang
70afc75769 Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev 2020-06-12 01:58:59 +00:00
Chalard Jean
cece40543e Document the limitation to a hundred callbacks.
Some developers have been surprised by this limitation and had trouble
figuring out what the issue was. Add documentation to address this.

This also includes a drive-by removal of a duplicate check.

Bug: 149867479
Test: doc-only change
Original-Change: https://android-review.googlesource.com/1313813
Merged-In: I5911d01984695550b6c9afe7a8eb535bf5e320a1
Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1
2020-06-12 00:35:39 +00:00
Mark Chien
bd60308b8f Merge "Cleanup config_mobile_hotspot_provision_app usage" into rvc-dev am: ef24e2121d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11716092

Change-Id: Iece352be0190b902c4949c1feb76281653a9b59f
2020-06-11 15:42:41 +00:00
markchien
f949ec251f Cleanup config_mobile_hotspot_provision_app usage
config_mobile_hotspot_provision_app would be move out of framework and
only private for tethering only.
enforceTetherChangePermission is no longer needed because its only
caller PanService already gate by other privileged permission
(BLUETOOTH_PRIVILEGED).

Bug: 146918263
Test: m

Change-Id: I030871c2bc46bc09c4e52970b4995f98d31bb90e
Merged-In: I030871c2bc46bc09c4e52970b4995f98d31bb90e
2020-06-11 13:32:12 +00:00
Lorenzo Colitti
e709bb9955 Merge "Update extra info before registering" into rvc-dev am: 4720606b02
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11745979

Change-Id: I7b68541f2cf1b3367b5aa6b6221b636f54c2e53e
2020-06-10 15:32:55 +00:00
Lorenzo Colitti
4720606b02 Merge "Update extra info before registering" into rvc-dev 2020-06-10 15:17:38 +00:00
Aaron Huang
a8eab54eee Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Change-Id: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91
2020-06-09 00:40:36 +08:00
TreeHugger Robot
5a1fcd7990 Merge "Update javadoc to use complete sentence" into rvc-dev am: 1f883f9099
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11745980

Change-Id: Ic28db88cac7f13c6355eb9ce76cd8cee660c6c93
2020-06-08 09:10:42 +00:00
Treehugger Robot
9d2a21503b Update javadoc to use complete sentence
Avoid using the "iff" abbreviation in our Javadoc.

Bug: 158092978
Test: m doc-comment-check-docs and check the generated doc
Merged-In: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
Change-Id: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
2020-06-05 04:50:14 +00:00
Chiachang Wang
d33028c205 Update extra info before registering
The extra info is taken into NetworkMonitor from while creating
it. The NetworkMonitor is created when a new agent is registered
but the extra info is not available at that time. Make sure the
field is set in the NetworkInfo when registering.

Bug: 156173829
Test: adb shell dumpsys network and check the apn in the extra
      info shown correctly
Test: atest FrameworkNetTests
Merged-In: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
Change-Id: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
2020-06-05 01:46:06 +00:00
Junyu Lai
dac17d9337 Merge "Disable log for per uid blocked status changed event" into rvc-dev am: cba8b949b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11700105

Change-Id: Iaafbe392cbbfa220d6c02b3fa1eced2ac683b8fe
2020-06-03 06:37:03 +00:00
Junyu Lai
edb74fd839 Disable log for per uid blocked status changed event
This consumes ~3.5% system logs, however it is not very useful
when debugging since similar information could be obtained from
dumpsys {connectivity|netpolicy}. Thus, remove the log.

Test: manual
Bug: 135504481
Change-Id: I04d2b7402f892546722fe6868c521afd9534f183
Merged-In: I04d2b7402f892546722fe6868c521afd9534f183
(cherry picked from commit 21a352f761ce558bea6fa9ab2a4e49a164228b56)
2020-06-02 10:19:41 +00:00
Remi NGUYEN VAN
8aa298adce Merge "Allow TRANSPORT_TEST ethernet networks" into rvc-dev am: fcd1fd8f26
Original change: undetermined

Change-Id: Ida76ccf2f5b99f77c17ae3ff732e7f56a1676306
2020-06-02 00:25:06 +00:00
Remi NGUYEN VAN
bfd4336f31 Allow TRANSPORT_TEST ethernet networks
Ethernet networks using tap interfaces should have TRANSPORT_TEST so
they are not considered by network selection.

Test: atest CaptivePortalApiTest FrameworksNetTests
Bug: 156319532
Original-Change: https://android-review.googlesource.com/1317238
Merged-In: I0d9477977c88aa055625ab4046577a41e76b05ff
Change-Id: I0d9477977c88aa055625ab4046577a41e76b05ff
2020-06-01 01:43:32 +00:00
Benedict Wong
1d63ae83d2 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev am: 36d9c275ac
Change-Id: If586cc601523aced520da3ebba00bca60d34a794
2020-05-29 17:32:44 +00:00
Benedict Wong
36d9c275ac Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev 2020-05-29 17:17:10 +00:00
Cody Kesting
909e6477bd Merge "Comment reason for simulateDataStall structure." into rvc-dev am: 84ad118843
Change-Id: I6b27cbb174090936f8dfcbe0d82dcdbe387683ee
2020-05-29 16:40:40 +00:00
Cody Kesting
84ad118843 Merge "Comment reason for simulateDataStall structure." into rvc-dev 2020-05-29 16:29:23 +00:00
TreeHugger Robot
76f82ab58f Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" into rvc-dev am: 51de3f8a10
Change-Id: I3ab5b7ad875abbe7fe6edcb834bf7d0cb06e5116
2020-05-29 14:09:23 +00:00
TreeHugger Robot
51de3f8a10 Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" into rvc-dev 2020-05-29 14:01:18 +00:00
Chalard Jean
42e012ca7d Merge "Adjust tests for renaming groupHint to cluster." into rvc-dev am: 6489161fd5
Change-Id: I91768e43fb69c74058b248a03698d6ffedf94f55
2020-05-29 04:21:59 +00:00
Automerger Merge Worker
dcb0e912b1 Adjust tests for renaming groupHint to cluster.
Bug: 146460486
Test: atest android.net.IpMemoryStoreTest
Test: atest com.android.server.connectivity.ipmemorystore.IpMemoryStoreServiceTest
Change-Id: Ia9797bb93aa4ff89147a77823d342dc22aec6a25
Merged-In: I69f7a2971cc5985d0f0078aecc39d4d6a6130033
(cherry-picked from aosp/1311654)
2020-05-29 02:28:59 +00:00
Benedict Wong
ba8ca78394 Add RequiresFeature annotations for IKEv2 VPN profiles
This change adds the @RequiresFeature annotation to Ikev2VpnProfile
Builder methods, and checks before provisioning VPN profiles.

Bug: 156681625
Test: New tests added, passing.
Change-Id: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
Merged-In: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
(cherry picked from commit e84a17dd1706f4c8373047b2023a1ec4b7cf4bf3)
2020-05-28 19:07:29 -07:00
TreeHugger Robot
0e07dc6af3 Merge changes I289d935f,I0121a4ac,Ie73ba058,I4393afcb,Ifebd946e, ... into rvc-dev am: c119ee1ed2
Change-Id: Iec9a061d0f91993e65c5d110955e8f23b0f0d945
2020-05-28 21:28:28 +00:00
Maciej Żenczykowski
c6bd588b29 NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter. am: 19e7950e50
Change-Id: Ibaee70f31f27f7457bd8524d4ab62bc76fff5dea
2020-05-28 21:28:25 +00:00
Maciej Żenczykowski
7e43a3c269 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload am: bcb4c0db35
Change-Id: I9fea19ddd38b51b65f79c59a53739e94dc833152
2020-05-28 21:28:23 +00:00
Maciej Żenczykowski
26db3bf956 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting am: e32498e437
Change-Id: Ifc902659ea23b9361c57e4b30a55427924c79b5e
2020-05-28 21:28:15 +00:00
Maciej Żenczykowski
c02f38ad9e fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccountingSimple am: 27061604cf
Change-Id: Id47ec36c825e2ec4258a61a01a724bc2a0a94166
2020-05-28 21:28:13 +00:00
Maciej Żenczykowski
1e69127a39 fix android.net.NetworkStatsTest#testApply464xlatAdjustments am: b6662062ff
Change-Id: I039caa0891030a5ebeba87ebfc410e72bd6c8d00
2020-05-28 21:28:10 +00:00
Maciej Żenczykowski
27daadb328 NetworkStats: apply464xlatAdjustments - don't remove CLAT_UID
This should no longer be needed after all the cleanups.

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I289d935f84b616ed857ef4c5a7427d57c282d00c
Merged-In: I289d935f84b616ed857ef4c5a7427d57c282d00c
2020-05-28 02:44:20 -07:00
Maciej Żenczykowski
19e7950e50 NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0121a4ac7ee824adc5930bab786d550b2f00b05b
Merged-In: I0121a4ac7ee824adc5930bab786d550b2f00b05b
2020-05-28 02:44:10 -07:00
Maciej Żenczykowski
bcb4c0db35 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

(so just copy over the rx stats from the before file)

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie73ba0586dafde67bc2726db26e07f7268c18be3
Merged-In: Ie73ba0586dafde67bc2726db26e07f7268c18be3
2020-05-28 02:44:02 -07:00
Maciej Żenczykowski
e32498e437 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

Test: atest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4393afcbe8e1bb886ecf4f5c1573f6ac8a0e29f5
Merged-In: I4393afcbe8e1bb886ecf4f5c1573f6ac8a0e29f5
2020-05-28 02:43:53 -07:00
Maciej Żenczykowski
27061604cf fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccountingSimple
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

Test: atest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifebd946e06b5fa2eeb7ff4fc0b1c423097021692
Merged-In: Ifebd946e06b5fa2eeb7ff4fc0b1c423097021692
2020-05-28 02:43:44 -07:00
Maciej Żenczykowski
b6662062ff fix android.net.NetworkStatsTest#testApply464xlatAdjustments
Test: atest NetworkStatsTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib12ee88295eb502f6da13d212b4fd6298dea380f
Merged-In: Ib12ee88295eb502f6da13d212b4fd6298dea380f
2020-05-28 02:43:33 -07:00
Luke Huang
7bdbb811ff Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS
NETID_USE_LOCAL_NAMESERVERS is no longer in libnetd_client

Bug: 151895202
Test: build
Change-Id: Iea0c2488dcabdd24d6ffca8134cd11ed12e8308a
2020-05-28 16:42:12 +08:00
Cody Kesting
2796382103 Comment reason for simulateDataStall structure.
This change adds a comment to CS#simulateDataStall to explain why the
Data Stall is wrapped in a DataStallReportParcelable before being passed
to the ConnectivityDiagnostics handler. This approach is taken to ensure
that simulated data stalls are handled the exact same as Data Stalls
received directly from NetworkMonitor (including Data Stalls detected by
methods that the platform does not understand).

Bug: 156294356
Test: atest ConnectivityDiagnosticsManager
Change-Id: I751054418bf328c72b977a1cc99c27cb9b8ab7ba
Merged-In: I751054418bf328c72b977a1cc99c27cb9b8ab7ba
(cherry picked from commit c86db7497a27cfbac5c662911a295598b1335bc0)
2020-05-28 00:40:43 +00:00