Commit Graph

6839 Commits

Author SHA1 Message Date
Chalard Jean
6ca3cd12c4 Merge "Support strict mode private DNS on VPNs that provide Internet." am: 9db77747a6 am: e3950cf24a
am: c455822846

Change-Id: I7fd1ca9ad791593daa2fd0b095b3b654aa89b309
2019-05-10 16:30:14 -07:00
Xiao Ma
57810fc502 [automerger skipped] Merge "adopt non-blocking method to obtain the IpMemoryStore service." into qt-dev am: 29510ea4d8 -s ours
am: ac9eef3530 -s ours
am skip reason: change_id I7de4f23370bdf9c9df5e74ed074c794080d93d95 with SHA1 afc8845452 is in history

Change-Id: I0c382d8b7909ac2bac194071693132ab558f5051
2019-05-10 15:56:20 -07:00
Paul Hu
8ac1cb5b50 Merge "Add LinkProperties common test cases" am: 78415c34f4 am: 5574b26c8e
am: 612724480f

Change-Id: I03d162ea3c5bc2ccb8f913bbfdf85ebcd194c35a
2019-05-10 15:28:40 -07:00
Junyu Lai
8cd83445b9 Merge "Merge changes Ibcb91105,I0218f367 am: 6a5c545890 am: 278e66a401" into qt-dev-plus-aosp
am: d2a243075a

Change-Id: Icaaf8e84a85ccecb19f0d6eda049b77f38c2df1c
2019-05-10 15:22:10 -07:00
Chalard Jean
c455822846 Merge "Support strict mode private DNS on VPNs that provide Internet." am: 9db77747a6
am: e3950cf24a

Change-Id: I28cc679def7cdd4dc5187e65f4524c3998ebcafc
2019-05-10 04:33:43 -07:00
Chalard Jean
e3950cf24a Merge "Support strict mode private DNS on VPNs that provide Internet."
am: 9db77747a6

Change-Id: I6522706917731a944483ad3cb9cdbc20447be6c2
2019-05-10 03:58:01 -07:00
Xiao Ma
ac9eef3530 [automerger skipped] Merge "adopt non-blocking method to obtain the IpMemoryStore service." into qt-dev
am: 29510ea4d8 -s ours
am skip reason: change_id I7de4f23370bdf9c9df5e74ed074c794080d93d95 with SHA1 afc8845452 is in history

Change-Id: I82ccab369a264ac6e7629a83d0ed9b1dbca67725
2019-05-10 02:44:47 -07:00
Chalard Jean
9db77747a6 Merge "Support strict mode private DNS on VPNs that provide Internet." 2019-05-10 09:39:17 +00:00
Junyu Lai
bf07eeea07 Merge changes Ibff278a6,If6d537a3 am: 5cb924da73 am: 6c6580aa4f
am: 1e518579a8

Change-Id: Ib9ef9ff5c943c4502b91feaa2690f0838215809d
2019-05-10 02:36:04 -07:00
Paul Hu
612724480f Merge "Add LinkProperties common test cases" am: 78415c34f4
am: 5574b26c8e

Change-Id: I8d36177cbf4f39da602331e091a60a40f6eaea33
2019-05-10 02:20:04 -07:00
Junyu Lai
04a972ec05 Merge changes Ibcb91105,I0218f367 am: 6a5c545890
am: 278e66a401

Change-Id: Ia667386c1a8949839871a6949d79552d9c8b88f0
2019-05-10 02:13:34 -07:00
Paul Hu
5574b26c8e Merge "Add LinkProperties common test cases"
am: 78415c34f4

Change-Id: I8f856d3851458e2a3f32034c9b9e1395123e0f89
2019-05-10 01:18:33 -07:00
Junyu Lai
278e66a401 Merge changes Ibcb91105,I0218f367
am: 6a5c545890

Change-Id: I4972d42657aa118e17240546c223723ed7b546ec
2019-05-10 01:14:05 -07:00
Junyu Lai
1e518579a8 Merge changes Ibff278a6,If6d537a3 am: 5cb924da73
am: 6c6580aa4f

Change-Id: Ic51f3b32375378ff74bdd54d1f36569b277fc80f
2019-05-09 23:30:19 -07:00
Paul Hu
78415c34f4 Merge "Add LinkProperties common test cases" 2019-05-10 05:55:11 +00:00
Xin Li
8ba89ea022 [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." am: b4da895ce0 -s ours am: a50f7a2fb3 -s ours
am: c161521c15 -s ours
am skip reason: subject contains skip directive

Change-Id: I92ccbc9d4850b4822ef03d08117452c66680a2a4
2019-05-09 22:47:57 -07:00
Junyu Lai
6a5c545890 Merge changes Ibcb91105,I0218f367
* changes:
  Limit unprivileged keepalives per uid
  Support customization of supported keepalive count per transport
2019-05-10 05:47:23 +00:00
Lorenzo Colitti
2fca7e3cb3 Support strict mode private DNS on VPNs that provide Internet.
Currently, strict mode private DNS does not work on VPNs because
NetworkMonitor does not validate VPNs. When a VPN connects, it
immediately transitions to ValidatedState, skipping private DNS
hostname resolution.

This change makes NetworkMonitor perform private DNS hostname
resolution and evaluation even on VPNs.

In order to ensure that the system always immediately switches to
the VPN as soon as it connects, remove the unvalidated penalty
for VPN networks. This ensures that the VPN score is always 101
and the VPN always outscores other networks as soon as it
connects. Previously, it would only outscore other networks
when no-op validation completed.

Bug: 122652057
Test: atest FrameworksNetTests NetworkStackTests
Test: manually ran a VPN with private DNS in strict mode
atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
2019-05-10 14:30:54 +09:00
Junyu Lai
6c6580aa4f Merge changes Ibff278a6,If6d537a3
am: 5cb924da73

Change-Id: If1d215b0fae85bfeeb5b6190abf4e4dc841912e5
2019-05-09 21:32:10 -07:00
Xin Li
1895e43f38 [automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master. am: 82e787f227 -s ours am: 00a98876ad -s ours
am: 036efcc5c5 -s ours
am skip reason: subject contains skip directive

Change-Id: If1ca678ef3942f98d1e68a28a59a2831de27b919
2019-05-09 21:26:56 -07:00
Treehugger Robot
5cb924da73 Merge changes Ibff278a6,If6d537a3
* changes:
  Revert "Add NATT keepalive resources and methods into IpSecService"
  Revert "[KA11] Verify fd ownership and allocate resource for NattKeepalive"
2019-05-10 01:42:26 +00:00
Xin Li
c161521c15 [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." am: b4da895ce0 -s ours
am: a50f7a2fb3 -s ours
am skip reason: subject contains skip directive

Change-Id: I27cf7d7b751417bac1087a3778e012076c0e66c6
2019-05-09 17:57:48 -07:00
Xiao Ma
015598ea52 adopt non-blocking method to obtain the IpMemoryStore service.
Bug: 131133347
Test: atest FrameworksNetTests
Merged-In: I7de4f23370bdf9c9df5e74ed074c794080d93d95
Merged-In: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2

Change-Id: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2
(cherry picked from commit c4e4fd7beeda36c84548c7bb4a16312f20bdf188)
2019-05-10 00:55:14 +00:00
Xin Li
036efcc5c5 [automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master. am: 82e787f227 -s ours
am: 00a98876ad -s ours
am skip reason: subject contains skip directive

Change-Id: I862d40111b2e525e5838bf09e169c8c3f416633b
2019-05-09 17:16:31 -07:00
Xin Li
a50f7a2fb3 [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master."
am: b4da895ce0 -s ours
am skip reason: subject contains skip directive

Change-Id: Id9cffb46751533cdd19a71577bf4dddea6219ddb
2019-05-09 16:46:13 -07:00
Xin Li
00a98876ad [automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master.
am: 82e787f227 -s ours
am skip reason: subject contains skip directive

Change-Id: Ib109cf35cae4b70ac762f9f3d4951968cfa91e9e
2019-05-09 15:56:19 -07:00
Junyu Lai
5b21515a81 Merge "Merge "Clean up the keepalive slots when network disconnect" am: 192f09d63e am: 56001c90c8" into qt-dev-plus-aosp
am: 4a3040b776

Change-Id: Icb5a1b5bb10617aa5a7b35db6cf48db3dc53b7fd
2019-05-09 15:56:10 -07:00
Xin Li
b4da895ce0 Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." 2019-05-09 22:05:45 +00:00
Junyu Lai
6f9be90965 Merge "Clean up the keepalive slots when network disconnect" am: 192f09d63e
am: 56001c90c8

Change-Id: Id3e4e159713c0ed7e03f45169e87b73ae6408e4f
2019-05-09 13:24:32 -07:00
Junyu Lai
56001c90c8 Merge "Clean up the keepalive slots when network disconnect"
am: 192f09d63e

Change-Id: I2cedf5752d37f96337ab69d94534cb7745e8efa3
2019-05-09 12:29:16 -07:00
Junyu Lai
192f09d63e Merge "Clean up the keepalive slots when network disconnect" 2019-05-09 18:53:03 +00:00
junyulai
782e216494 Clean up the keepalive slots when network disconnect
In general, keepalive slots are released after result of
stopping has returned. However, for network disconnect case,
the service side cannot communicate with network agent since
the async channel is broken.

Clean up keepalive slots right after stop in this case.

Bug: 132341736
Test: 1. atest com.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 100
      2. atest FrameworksNetTests --generate-new-metrics 10

Change-Id: Ia30741f71fa72fc117e071976fd73991fa3c9535
2019-05-09 17:16:17 +00:00
Junyu Lai
b4864e6c40 Revert "Add NATT keepalive resources and methods into IpSecService"
This reverts commit bdf7048571.

Reason for revert: Adds dependency between IpSecService and
                   ConnectivityService may lead to future deadlock
		   problems. Uses a simpler approach instead,
		   hence the solution is not needed.
		   See aosp/954040.

Change-Id: Ibff278a6eee666cd85dba81c2bed94d568679b02
2019-05-10 00:58:18 +08:00
junyulai
0586a60292 Limit unprivileged keepalives per uid
Public APIs for creating unprivileged NATT socket keepalive
might allow users to exhaust resource if malicious apps try
to create keepalives with fd which is not created by
IpSecService through binder call. Thus, this change add
customizable limitation per uid to prevent resource exhaustion
attack.

Bug: 129371366
Bug: 132307230
Test: atest FrameworksNetTests
Change-Id: Ibcb91105e46f7e898b8aa7c2babc3344ef2c6257
2019-05-10 00:36:58 +08:00
junyulai
4dca18aa31 Support customization of supported keepalive count per transport
This change specifies the required minimum supported keepalives
in SDK, and allows OEMs to customize supported keepalive count
per network through resource overlay.

Bug: 129371366
Test: 1. m -j doc-comment-check-docs
      2. atest FrameworksNetTests

Change-Id: I0218f3674628c13ead63fc9a873895ba7f113033
2019-05-10 00:36:58 +08:00
Xin Li
82e787f227 DO NOT MERGE - Merge Pie Bonito/Sargo into master.
Bug: 131756210
Change-Id: I77a701deda4935526ad452564f9bda77af345f46
2019-05-09 09:27:04 -07:00
Xiao Ma
3ec07e51a9 Merge "adopt non-blocking method to obtain the IpMemoryStore service." am: 14b9e8b6d8 am: 042800ead0
am: 42f6be8b40

Change-Id: I0c7af3c4e664c45b828dcb833b0698e246a2c770
2019-05-09 05:12:59 -07:00
Xiao Ma
42f6be8b40 Merge "adopt non-blocking method to obtain the IpMemoryStore service." am: 14b9e8b6d8
am: 042800ead0

Change-Id: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2
2019-05-09 04:55:13 -07:00
Xiao Ma
042800ead0 Merge "adopt non-blocking method to obtain the IpMemoryStore service."
am: 14b9e8b6d8

Change-Id: Idd6110141795f86dcf28eafab87683eda4c70b93
2019-05-09 04:43:33 -07:00
Xiao Ma
14b9e8b6d8 Merge "adopt non-blocking method to obtain the IpMemoryStore service." 2019-05-09 11:30:56 +00:00
Lorenzo Colitti
5fc7e3c11e [automerger skipped] Merge "[CS] Unregister callback as part of onUnavailable dispatch" into qt-dev am: 80045d35e7 -s ours
am: 2c95b3740f -s ours
am skip reason: change_id I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3 with SHA1 6cb6599ddd is in history

Change-Id: Iab30c2f181a3a666599b5e808fe91dfe920f0552
2019-05-09 03:29:07 -07:00
Lorenzo Colitti
2c95b3740f [automerger skipped] Merge "[CS] Unregister callback as part of onUnavailable dispatch" into qt-dev
am: 80045d35e7 -s ours
am skip reason: change_id I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3 with SHA1 6cb6599ddd is in history

Change-Id: I3a61f64da1fc5d376da06a81ce8a35bac09d4481
2019-05-09 02:57:25 -07:00
Lorenzo Colitti
80045d35e7 Merge "[CS] Unregister callback as part of onUnavailable dispatch" into qt-dev 2019-05-09 09:42:38 +00:00
Etan Cohen
0279a9b072 Merge "[CS] Unregister callback as part of onUnavailable dispatch" am: e2ba92c411 am: 477211720f
am: abc0036a8b

Change-Id: I0c26270878c8b1a447953e0b29a2b0cdb6138f00
2019-05-09 02:39:02 -07:00
Lorenzo Colitti
20d1f70fe9 Merge "Add IPsec checks for IPSEC_TUNNEL feature" into qt-dev am: 44d474d7c7
am: 65365f4320

Change-Id: I0f3376eec642800542b5e516a02aef286be6f614
2019-05-09 01:30:52 -07:00
paulhu
9f7636c722 Add LinkProperties common test cases
Bug: 129198747
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass
Change-Id: I15b8dbd060c313d0f2be89fed4518c18b3196d38
2019-05-09 15:49:00 +08:00
Etan Cohen
abc0036a8b Merge "[CS] Unregister callback as part of onUnavailable dispatch" am: e2ba92c411
am: 477211720f

Change-Id: Ida684c441e7aaedce9a29da071ef5a68403d08b3
2019-05-08 22:42:55 -07:00
Etan Cohen
477211720f Merge "[CS] Unregister callback as part of onUnavailable dispatch"
am: e2ba92c411

Change-Id: I14d3c0f6c606020bd1d1e756174a66ee933cb15f
2019-05-08 22:13:00 -07:00
Lorenzo Colitti
65365f4320 Merge "Add IPsec checks for IPSEC_TUNNEL feature" into qt-dev
am: 44d474d7c7

Change-Id: I9bd0fa3958c63a148af98abfe7cc6e4301cf01c2
2019-05-08 21:20:19 -07:00
Etan Cohen
2f9a465841 [CS] Unregister callback as part of onUnavailable dispatch
The onUnavailable semantics promise that it is equivalent to calling
the unregister callback method. But - it doesn't unregister the callback
allowing it to be reused. Fixed.

Additionally, modified the unregisterNetworkCallback method to not fail
on duplicate unregistration (since a callback could now self
unregister). Instead simply print a log.

Bug: 130651445
Test: atest ConnectivityServiceTest
Merged-In: I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3
Change-Id: I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3
2019-05-09 03:57:54 +00:00