Commit Graph

6668 Commits

Author SHA1 Message Date
Mark Chien
e252f0fdfc Merge "Add AIDL parcelable for NattKeepalivePacketData" am: 60f78b096f
am: e29c661e04

Change-Id: Iae8d866230dfd8aa2de1b69891d8494812886aac
2019-04-29 04:00:13 -07:00
Mark Chien
e29c661e04 Merge "Add AIDL parcelable for NattKeepalivePacketData"
am: 60f78b096f

Change-Id: Idd5ff9d4d52064dbfe5df1e4677c41bcccd9c09a
2019-04-29 03:49:03 -07:00
Mark Chien
60f78b096f Merge "Add AIDL parcelable for NattKeepalivePacketData" 2019-04-29 10:26:35 +00:00
Lorenzo Colitti
8df0f85e86 Merge "Make DNS cache lifecycle management explicit" am: 8970adbc8c
am: af5b4ab4b1

Change-Id: I51cf1b7cfd49d4731d922578e8512a1326ebec63
2019-04-25 17:50:05 -07:00
Lorenzo Colitti
af5b4ab4b1 Merge "Make DNS cache lifecycle management explicit"
am: 8970adbc8c

Change-Id: Ie97fe453c89476915f3b362b6486c7d4608da2a9
2019-04-25 17:38:23 -07:00
Lorenzo Colitti
8970adbc8c Merge "Make DNS cache lifecycle management explicit" 2019-04-26 00:23:22 +00:00
Lorenzo Colitti
8c4677ab39 [automerger skipped] Merge changes from topic "niap-vpn" into qt-dev
am: 5fd9ef13f2 -s ours
am skip reason: change_id Ic2faef44831575b2d03bc00ef2553d5c549adc95 with SHA1 07ad31c3ec is in history

Change-Id: I4775263c2f422a9738812b02be61e2af95e9c472
2019-04-24 23:02:31 -07:00
Chiachang Wang
052acc4776 Merge "Update exception type thrown when NetworkStack is missing" am: 18aa9b67ea
am: a7e9b83638

Change-Id: I67005a5384888e8acaf1249af79484e2d5ed6f1f
2019-04-24 21:31:21 -07:00
Lorenzo Colitti
5fd9ef13f2 Merge changes from topic "niap-vpn" into qt-dev
* changes:
  Reinstate new VPN uid filtering unit tests
  Revert new tests and PackageManager mock
  Block incoming non-VPN packets to apps under fully-routed VPN
2019-04-25 04:23:01 +00:00
Chiachang Wang
a7e9b83638 Merge "Update exception type thrown when NetworkStack is missing"
am: 18aa9b67ea

Change-Id: Icbf7db83d73a1912573e71c71f694f2d37d788af
2019-04-24 21:19:45 -07:00
Chiachang Wang
18aa9b67ea Merge "Update exception type thrown when NetworkStack is missing" 2019-04-25 03:48:52 +00:00
Wayne Ma
9dc9bed071 [automerger skipped] Merge "Backwards-incompatible resolv module API change for making setResolverConfiguration take a parcelable." into qt-dev
am: e1754842b8 -s ours
am skip reason: change_id I6dc9029af0df0d3b391210bd315516bdf1b5e4c9 with SHA1 7f38159e5b is in history

Change-Id: Ie9bfef68a5c78272d4c7b31e9427ba2f5c57d056
2019-04-24 13:14:17 -07:00
Wayne Ma
4c6d0bda21 [automerger skipped] Backwards-incompatible resolv module API change for making setResolverConfiguration take a parcelable.
am: 9ba0569882 -s ours
am skip reason: change_id I6dc9029af0df0d3b391210bd315516bdf1b5e4c9 with SHA1 7f38159e5b is in history

Change-Id: Ic26258dd1ef7a0f3c7c802d764f83a272c3d519f
2019-04-24 09:21:29 -07:00
Rubin Xu
65e2962333 Reinstate new VPN uid filtering unit tests
Mock out PackageManager and returns correct information corresponding
to the test app package itself.

Test: atest --generate-new-metrics 10 com.android.server.ConnectivityServiceTest
Bug: 114231106
Bug: 130397860

Merged-In: Ic2faef44831575b2d03bc00ef2553d5c549adc95
Change-Id: Ic2faef44831575b2d03bc00ef2553d5c549adc95
(cherry picked from commit 4469b1d8a543613d91a58a88488fd2022a0696b9)
2019-04-24 14:10:21 +00:00
Chiachang Wang
619a8a2b08 Update exception type thrown when NetworkStack is missing
rethrowFromSystemServer is throwing DeadSystemException which
is different from the original log message. Thus, update the
way to rethrow the same RemoteException.

Bug: 130028724
Test: atest FrameworksNetTest
Test: Kill NetworkStack and check the log message
Change-Id: I60862e276dd4e2d143278b272a9ba54219acce26
2019-04-24 13:59:50 +00:00
Wayne Ma
e1754842b8 Merge "Backwards-incompatible resolv module API change for making setResolverConfiguration take a parcelable." into qt-dev 2019-04-24 13:05:59 +00:00
Lorenzo Colitti
0ecd05e7c6 Revert new tests and PackageManager mock
A mocked PackageManager caused test failures in existing tests.
Revert that for now to make tests pass again.

Bug: 114231106
Bug: 130397860
Test: atest FrameworksNetTests

Merged-In: Ib59e211d4329f885108de9ea0a74669ffb144e17
(cherry picked from commit c18f4b5f6f)

Change-Id: I603a0b0dfb67a942679a668c182aa650774c80b2
2019-04-24 13:55:48 +01:00
Rubin Xu
4158c568b8 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 c81642f1a1)
2019-04-24 11:56:46 +01:00
Rubin Xu
07ad31c3ec Merge "Reinstate new VPN uid filtering unit tests" am: 5dd56f3e47
am: 5df955cc01

Change-Id: Ic2faef44831575b2d03bc00ef2553d5c549adc95
2019-04-24 03:05:12 -07:00
Rubin Xu
5df955cc01 Merge "Reinstate new VPN uid filtering unit tests"
am: 5dd56f3e47

Change-Id: Ib76c2cf319377141a374b3bdcf5e6606aaf9c06b
2019-04-24 02:53:44 -07:00
Treehugger Robot
5dd56f3e47 Merge "Reinstate new VPN uid filtering unit tests" 2019-04-24 09:37:49 +00:00
Aaron Huang
15400f216d Add AIDL parcelable for NattKeepalivePacketData
Bug: 33530442
Test: atest FrameworksNetTests

Change-Id: I9b9a51dc5dc06c90229fb36c34c24258991c4146
2019-04-24 16:19:54 +08:00
Aaron Huang
1465573044 Merge "Move NattKeepalivePacketData out of the framework" am: 7640cb0157
am: 7abf8c5880

Change-Id: Idf7c25b6b553d8c0cc4ef2ea8193438480420fb4
2019-04-23 21:26:03 -07:00
Aaron Huang
7abf8c5880 Merge "Move NattKeepalivePacketData out of the framework"
am: 7640cb0157

Change-Id: I3c291d378ed3dc54199708fdc188a908ccb3ee08
2019-04-23 21:17:26 -07:00
Aaron Huang
7640cb0157 Merge "Move NattKeepalivePacketData out of the framework" 2019-04-24 04:00:56 +00:00
Rubin Xu
ad26ff3fa1 Reinstate new VPN uid filtering unit tests
Mock out PackageManager and returns correct information corresponding
to the test app package itself.

Test: atest --generate-new-metrics 10 com.android.server.ConnectivityServiceTest
Bug: 114231106
Bug: 130397860
Change-Id: Ib921700eda417f411d7a2c77c1140fba9ab50bbb
2019-04-23 18:04:14 +01:00
Paul Hu
b547b7b4df Merge "Add tests for DhcpErrorEvent" am: 7e025f750a
am: a5f171ca27

Change-Id: I9b65a2eef94567d2b79a9955619938e64906080d
2019-04-23 09:50:28 -07:00
Lorenzo Colitti
dfe86f1e66 [automerger skipped] Merge "Freeze the networkstack-aidl-interfaces interface" into qt-dev
am: c2f1cc8b8e -s ours
am skip reason: change_id Ideabe73fc93bbefca2d624ee9ca190cf31419424 with SHA1 e72fe2bc46 is in history

Change-Id: I39438b1a3204aa82550ac83117a96f7549d19e42
2019-04-23 09:37:54 -07:00
Paul Hu
a5f171ca27 Merge "Add tests for DhcpErrorEvent"
am: 7e025f750a

Change-Id: I7e6271e9becc974ea38d405914a87859ab700877
2019-04-23 09:12:25 -07:00
Paul Hu
7e025f750a Merge "Add tests for DhcpErrorEvent" 2019-04-23 11:31:03 +00:00
Lorenzo Colitti
2dba5d9b48 Freeze the networkstack-aidl-interfaces interface
This freezes the interface as of the latest beta build, not the tip of
tree. IIpClient#setL2KeyAndGroupHint is not in the frozen definition in
particular.

Generated with:
m networkstack-aidl-interfaces-freeze-api \
    ipmemorystore-aidl-interfaces-freeze-api

Test: flashed, booted, WiFi and captive portal working
Bug: 128803828
Change-Id: Ideabe73fc93bbefca2d624ee9ca190cf31419424
Merged-In: Ideabe73fc93bbefca2d624ee9ca190cf31419424
(cherry picked from commit 9b89cdaaf401a6b77e160807039c06e537fa600a)
2019-04-23 09:41:44 +00:00
Lorenzo Colitti
0498b5aa98 Merge "Freeze the networkstack-aidl-interfaces interface" am: a746ac5036
am: adea8d6da1

Change-Id: I0bc827a6c7995eb7b50b4afeed11317ad8e29666
2019-04-23 01:55:01 -07:00
Lorenzo Colitti
adea8d6da1 Merge "Freeze the networkstack-aidl-interfaces interface"
am: a746ac5036

Change-Id: I32e335756927110e3200f002d32f9e1e8acfd779
2019-04-23 01:45:40 -07:00
Lorenzo Colitti
a746ac5036 Merge "Freeze the networkstack-aidl-interfaces interface" 2019-04-23 08:33:41 +00:00
Junyu Lai
74da4671c4 Merge "[KA11] Verify fd ownership and allocate resource for NattKeepalive" am: 123eb11c48
am: c47cd94455

Change-Id: I410acc19ceb13e32c65cbdf3095da9db0802470c
2019-04-23 01:18:54 -07:00
Junyu Lai
c47cd94455 Merge "[KA11] Verify fd ownership and allocate resource for NattKeepalive"
am: 123eb11c48

Change-Id: I2f5e0e11494866b054668c9224a8732cd8c035f9
2019-04-23 01:08:39 -07:00
Junyu Lai
123eb11c48 Merge "[KA11] Verify fd ownership and allocate resource for NattKeepalive" 2019-04-23 07:48:08 +00:00
Chalard Jean
92cd2d6bff [automerger skipped] Merge "Fix an argument to the legacy broadcast" into qt-dev
am: 587d6cb141 -s ours
am skip reason: change_id I0fc408d546ae9d72b7dd9415e502252b484d4329 with SHA1 fe8c062223 is in history

Change-Id: I5ebe636715e8cf1ea5e42d12236c1f5fa07c38d0
2019-04-23 00:27:22 -07:00
Chalard Jean
587d6cb141 Merge "Fix an argument to the legacy broadcast" into qt-dev 2019-04-23 07:04:26 +00:00
Remi NGUYEN VAN
e72fe2bc46 Freeze the networkstack-aidl-interfaces interface
This freezes the interface as of the latest beta build, not the tip of
tree. IIpClient#setL2KeyAndGroupHint is not in the frozen definition in
particular.

Generated with:
m networkstack-aidl-interfaces-freeze-api \
    ipmemorystore-aidl-interfaces-freeze-api

Test: flashed, booted, WiFi and captive portal working
Bug: 128803828
Change-Id: Ideabe73fc93bbefca2d624ee9ca190cf31419424
2019-04-23 06:49:58 +00:00
junyulai
8368fe9fe0 [KA11] Verify fd ownership and allocate resource for NattKeepalive
Since socket keepalive APIs for UDP encapsulation sockets are
public to generic app. In order to ensure the given fd is valid,
this change verifies the resource id inside the UDP
encapsulation socket by using methods provided by IpSecService.

Bug: 125517194
Fix: 123968920
Test: 1. atest FrameworksNetTests --generate-new-metrics 10
      2. atestcom.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 100
Change-Id: I408aacc19b364683854d15a095c34e72389a6e5b
2019-04-23 10:47:19 +08:00
Chalard Jean
55cd1a323e Fix an argument to the legacy broadcast
Test: new test for this
Fixes: 62650382
Change-Id: I918b8271d3c3c058553ca888cb54cd36a6efba66
Merged-In: I0fc408d546ae9d72b7dd9415e502252b484d4329
Merged-In: I9282930106d1eee3274d9e5c4e89de60e929a0e6
2019-04-23 02:36:32 +00:00
Chalard Jean
fe8c062223 Merge "Fix an argument to the legacy broadcast" am: 5036127856
am: 182fe69f50

Change-Id: I0fc408d546ae9d72b7dd9415e502252b484d4329
2019-04-22 18:12:27 -07:00
Chalard Jean
182fe69f50 Merge "Fix an argument to the legacy broadcast"
am: 5036127856

Change-Id: I76149167598a862a2cc519fbf0b08df0887b27f0
2019-04-22 18:00:01 -07:00
Chalard Jean
5036127856 Merge "Fix an argument to the legacy broadcast" 2019-04-23 00:38:10 +00:00
Chenbo Feng
a93733fa35 [automerger skipped] Merge "Add smoke test for jni library" into qt-dev
am: 30096e070d -s ours
am skip reason: change_id Id24e7f0558b5643e4ad7393e85f1f0a2bd875615 with SHA1 dc2d592e68 is in history

Change-Id: Ib3f66d33a54be4216c098e2cde2023ece3fbf41e
2019-04-22 14:33:35 -07:00
Benedict Wong
37c1d5c0d8 Merge "Add NATT keepalive resources and methods into IpSecService" am: 4d31a792fa
am: 535187424f

Change-Id: I3affb5bdbb0c3f980b6606d728668e74c31646d0
2019-04-22 13:44:20 -07:00
Benedict Wong
535187424f Merge "Add NATT keepalive resources and methods into IpSecService"
am: 4d31a792fa

Change-Id: I97e7451959d619f42d68a5c29cca410bf0740852
2019-04-22 13:31:52 -07:00
TreeHugger Robot
30096e070d Merge "Add smoke test for jni library" into qt-dev 2019-04-22 20:14:31 +00:00
Benedict Wong
4d31a792fa Merge "Add NATT keepalive resources and methods into IpSecService" 2019-04-22 20:03:54 +00:00