Commit Graph

1863 Commits

Author SHA1 Message Date
Treehugger Robot
33e236823f 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
884a1ada47 [automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master. am: e963030676 -s ours
am: bd1a8961e2 -s ours
am skip reason: subject contains skip directive

Change-Id: I862d40111b2e525e5838bf09e169c8c3f416633b
2019-05-09 17:16:31 -07:00
Junyu Lai
75eabfeb7c Revert "Add NATT keepalive resources and methods into IpSecService"
This reverts commit 4aac3e9e48.

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
Xin Li
e963030676 DO NOT MERGE - Merge Pie Bonito/Sargo into master.
Bug: 131756210
Change-Id: I77a701deda4935526ad452564f9bda77af345f46
2019-05-09 09:27:04 -07:00
Lorenzo Colitti
707fc41210 Merge "Add IPsec checks for IPSEC_TUNNEL feature" into qt-dev
am: 22e0b2c514

Change-Id: I9bd0fa3958c63a148af98abfe7cc6e4301cf01c2
2019-05-08 21:20:19 -07:00
Lorenzo Colitti
22e0b2c514 Merge "Add IPsec checks for IPSEC_TUNNEL feature" into qt-dev 2019-05-09 03:25:35 +00:00
Lorenzo Colitti
d50abfdae5 [automerger skipped] Merge "Add EPROTONOSUPPORT to IpSecManager SSE map" into qt-dev
am: a1a0653dab -s ours
am skip reason: change_id Iec3d5fc4a9bcad7c104414afefae775232d46558 with SHA1 7e9c1ceadd is in history

Change-Id: Ifb346ddf63b0d6547f3c67110c17c630f3aa72c9
2019-05-08 02:37:04 -07:00
Benedict Wong
e9763752c7 Add IPsec checks for IPSEC_TUNNEL feature
This patch adds checks to ensure that the IPSEC_TUNNEL feature flag is
enabled.

Bug: 117183273
Test: Compiles & tests passing
Change-Id: I2699dda29e1eed139bc6fd1b70071e5ab33cad88
2019-05-08 00:11:28 +00:00
Android Build Merger (Role)
5b5a0240a6 Merge changes into qt-dev-plus-aosp 2019-05-07 22:19:43 +00:00
Benedict Wong
c45974b0d6 Add EPROTONOSUPPORT to IpSecManager SSE map
This change maps EPROTONOSUPPORT to the list of error codes that map to
UnsupportedOperationException in IpSecManager.

Bug: 80103456
Test: Compiles, CTS tests ran
Change-Id: Iec3d5fc4a9bcad7c104414afefae775232d46558
Merged-In: Iec3d5fc4a9bcad7c104414afefae775232d46558
(cherry picked from commit dcbc670688d815ce89954765fac46aa2ad6d8adb)
2019-05-07 14:32:17 -07:00
Benedict Wong
7a2cf07c8d Merge "Add EPROTONOSUPPORT to IpSecManager SSE map" am: 7050ce9434
am: 533559234e

Change-Id: I23e0b56529b9df23558002ddb9e6210d711228cf
2019-04-29 14:16:30 -07:00
Benedict Wong
533559234e Merge "Add EPROTONOSUPPORT to IpSecManager SSE map"
am: 7050ce9434

Change-Id: I9ab4161e2b04615ce782c89cd9e99d98cdbdc92d
2019-04-29 13:35:37 -07:00
Benedict Wong
7e9c1ceadd Add EPROTONOSUPPORT to IpSecManager SSE map
This change maps EPROTONOSUPPORT to the list of error codes that map to
UnsupportedOperationException in IpSecManager.

Bug: 80103456
Test: Compiles, CTS tests ran
Change-Id: Iec3d5fc4a9bcad7c104414afefae775232d46558
2019-04-24 21:31:01 +00:00
Chenbo Feng
811f91f337 [automerger skipped] Merge "Ask netd to swap stats map before reading" into qt-dev
am: 197077dc8f -s ours
am skip reason: change_id I8fa37c26bec23ffca0b29b679e72ba1189f557f1 with SHA1 876218abcb is in history

Change-Id: I48dc5783885a97a0b0c975202c5878c058695524
2019-04-23 15:13:56 -07:00
TreeHugger Robot
197077dc8f Merge "Ask netd to swap stats map before reading" into qt-dev 2019-04-23 21:57:09 +00:00
Chenbo Feng
2c8ab195b0 [automerger skipped] Merge "Add a lock to protect persistent stats snapshot" into qt-dev
am: 8e7794e97b -s ours
am skip reason: change_id I73851336452110afb74d6dd1ca5e50047d5b3d4a with SHA1 57f207b1c7 is in history

Change-Id: I30d66ea36a7beee9ccf940c547c47a6f7220e0a2
2019-04-23 12:23:12 -07:00
TreeHugger Robot
8e7794e97b Merge "Add a lock to protect persistent stats snapshot" into qt-dev 2019-04-23 18:19:06 +00:00
Chenbo Feng
10fac71887 Ask netd to swap stats map before reading
To avoid protentail race problem between netd and system_server when
reading the network stats map. Always inform netd before reading the
stats and let netd to do a swap between active stats map and inactive
stats map. So the system_server can safely remove the stats after
reading.

Bug: 126620214
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: I8fa37c26bec23ffca0b29b679e72ba1189f557f1
Merged-In: I8fa37c26bec23ffca0b29b679e72ba1189f557f1
(cherry picked from commit f729cb5fd654a0f099128734f849800fde9ba525)
2019-04-23 14:21:32 +00:00
Chenbo Feng
aeb31b53c6 Add a lock to protect persistent stats snapshot
Since the network stats could be polled from multiple services at
runtime, it is not thread safe for networkStatsFactory to hold a
persistent stats snapshot without any protection. Use a internal lock to
prevent concurrent modification on mPersistentSnapshot to fix the
problem.

Bug: 124764595
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: I73851336452110afb74d6dd1ca5e50047d5b3d4a
Merged-In: I73851336452110afb74d6dd1ca5e50047d5b3d4a
Merged-In: I22afb46f17697e8b6359d4f593802e0f4b95db8b
(cherry picked from commit 25243b4eb93c234412a35f9e5d9f1649f8964f83)
2019-04-23 14:21:05 +00:00
Benedict Wong
5dd6a60745 Merge "Add NATT keepalive resources and methods into IpSecService" am: c345527430
am: 70e5117542

Change-Id: I3affb5bdbb0c3f980b6606d728668e74c31646d0
2019-04-22 13:44:20 -07:00
Benedict Wong
70e5117542 Merge "Add NATT keepalive resources and methods into IpSecService"
am: c345527430

Change-Id: I97e7451959d619f42d68a5c29cca410bf0740852
2019-04-22 13:31:52 -07:00
Chalard Jean
0ea6659635 [automerger skipped] Merge "Restrict access to dangerous methods to <= P" into qt-dev
am: f3a812858c -s ours
am skip reason: change_id I95107f7b628eecb54e9f4411785186b668e9f3d8 with SHA1 b3dbc3f845 is in history

Change-Id: I18b0c3f0f36f39e8cc758b98c3e8c44a23b69f25
2019-04-22 00:32:19 -07:00
TreeHugger Robot
f3a812858c Merge "Restrict access to dangerous methods to <= P" into qt-dev 2019-04-22 07:14:10 +00:00
Benedict Wong
4aac3e9e48 Add NATT keepalive resources and methods into IpSecService
This change adds a new NATTKeepalive resource type, along with the
associated allocation/deallocation. Additionally, this change allows
ReferenceCountedResource(s) to not be binder-linked, to allow the
ConnectivityService to verify ownership and allocate a NattKeepalive
without double-registering for binder-death notifications.

Bug: 125517194
Test: IpSecService frameworks tests ran
Change-Id: I8293f79940ad57dabb6f2b9de5e334d06b869443
2019-04-19 11:17:21 -07:00
Chalard Jean
19a6b5c027 [automerger skipped] Merge "Move TrafficStats tags for the network stack constants" am: d2eb7f71b8
am: 2c28ee4cb8 -s ours
am skip reason: change_id I9b648ed6c687d56db61a54570c7880c51c1bae51 with SHA1 1c9c56a164 is in history

Change-Id: If30091ab2a164d01cab11fdd7e6e3aeaa805082c
2019-04-16 23:19:28 -07:00
Chalard Jean
2c28ee4cb8 Merge "Move TrafficStats tags for the network stack constants"
am: d2eb7f71b8

Change-Id: I13ba9e3077bb4ec28229a09f2d4747a43c281bcc
2019-04-16 23:08:07 -07:00
Chalard Jean
d2eb7f71b8 Merge "Move TrafficStats tags for the network stack constants" 2019-04-17 05:45:56 +00:00
Chalard Jean
8a93ab8eef Move TrafficStats tags for the network stack constants
As per API council feedback, these constants should live in
a place that is private to the network stack, only with a
range defined in system API.

Bug: 129433383
Test: m
Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086
Merged-In: I4882686a86e7c6d42f4b0619b921d02619ed6d4c
Merged-In: I9b648ed6c687d56db61a54570c7880c51c1bae51
2019-04-17 05:45:40 +00:00
Chalard Jean
1c9c56a164 Merge "Move TrafficStats tags for the network stack constants" into qt-dev
am: e7ef0a61f2

Change-Id: I9b648ed6c687d56db61a54570c7880c51c1bae51
2019-04-16 15:06:03 -07:00
Chalard Jean
a69a73ece7 Restrict access to dangerous methods to <= P
Test: make
Fixes: 130143562
Change-Id: I1a6a472f83cf00a1ab174a9c5e67d3e9357a0c45
Merged-In: I95107f7b628eecb54e9f4411785186b668e9f3d8
Merged-In: I890030580fdad45c3f8589bf6adbe5798d578cfe
(cherry picked from commit 0bb53dbb64bbc937a23e1dc7641c8988a6d11d64)
2019-04-16 06:13:09 +00:00
Chalard Jean
b3dbc3f845 Merge "Restrict access to dangerous methods to <= P" am: a1c9270562
am: af8f384985

Change-Id: I95107f7b628eecb54e9f4411785186b668e9f3d8
2019-04-15 22:39:08 -07:00
Chalard Jean
af8f384985 Merge "Restrict access to dangerous methods to <= P"
am: a1c9270562

Change-Id: I3c1271e00e026518e9c4ddafc931a2cac87dcee0
2019-04-15 22:29:28 -07:00
Chalard Jean
a1c9270562 Merge "Restrict access to dangerous methods to <= P" 2019-04-16 05:17:20 +00:00
Chalard Jean
65081e4cf6 Move TrafficStats tags for the network stack constants
As per API council feedback, these constants should live in
a place that is private to the network stack, only with a
range defined in system API.

Bug: 129433383
Test: m
Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086
(cherry picked from commit 79a6330650ca04bd7a08afbd63f8016a3b30bc72)
2019-04-16 00:41:54 +09:00
Chenbo Feng
273e13711d Merge "Ask netd to swap stats map before reading" am: f8b251fd28
am: 3878f31aff

Change-Id: I333e4cdc807da0dd1e2ca118f9ebcf2d94c683de
2019-04-12 16:39:07 -07:00
Chenbo Feng
3878f31aff Merge "Ask netd to swap stats map before reading"
am: f8b251fd28

Change-Id: I7a683e479fe7631a167138314bcf5948e72386ec
2019-04-12 16:06:30 -07:00
Treehugger Robot
f8b251fd28 Merge "Ask netd to swap stats map before reading" 2019-04-12 22:35:52 +00:00
Chenbo Feng
24e9a313cd Merge "Add a lock to protect persistent stats snapshot" am: f31face531
am: 57f207b1c7

Change-Id: Ia91b71536447e65725a85ebf2ac4f411aebe86c8
2019-04-12 05:59:36 -07:00
Chenbo Feng
57f207b1c7 Merge "Add a lock to protect persistent stats snapshot"
am: f31face531

Change-Id: I73851336452110afb74d6dd1ca5e50047d5b3d4a
2019-04-11 18:44:45 -07:00
Treehugger Robot
f31face531 Merge "Add a lock to protect persistent stats snapshot" 2019-04-12 01:33:00 +00:00
Chenbo Feng
876218abcb Ask netd to swap stats map before reading
To avoid protentail race problem between netd and system_server when
reading the network stats map. Always inform netd before reading the
stats and let netd to do a swap between active stats map and inactive
stats map. So the system_server can safely remove the stats after
reading.

Bug: 126620214
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: I8fa37c26bec23ffca0b29b679e72ba1189f557f1
2019-04-10 12:59:38 -07:00
Chenbo Feng
0c419ca9eb Add a lock to protect persistent stats snapshot
Since the network stats could be polled from multiple services at
runtime, it is not thread safe for networkStatsFactory to hold a
persistent stats snapshot without any protection. Use a internal lock to
prevent concurrent modification on mPersistentSnapshot to fix the
problem.

Bug: 124764595
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: I22afb46f17697e8b6359d4f593802e0f4b95db8b
2019-04-10 12:59:18 -07:00
Benedict Wong
80e078d789 [automerger skipped] Merge "Fix remove-before-add for IpSecService RefcountedResource" into qt-dev
am: 21dbd30681 -s ours
am skip reason: change_id I6db75853da9f29e1573512e26351623f22770c5d with SHA1 04738f5b07 is in history

Change-Id: I3e0bd244d8a2ddf86cf4dab99d4a563ea1e2b01e
2019-04-10 11:14:47 -07:00
Benedict Wong
21dbd30681 Merge "Fix remove-before-add for IpSecService RefcountedResource" into qt-dev 2019-04-10 17:07:02 +00:00
Chiachang Wang
dee0e3d241 [automerger skipped] Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces" into qt-dev
am: 60cc2ab6e7 -s ours
am skip reason: change_id I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60 with SHA1 e3f8027e89 is in history

Change-Id: I23657309145be45306d2df70dcc517e4c36a82a1
2019-04-10 04:14:11 -07:00
Chiachang Wang
8757df33e4 Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces
ConnectivityManager and its usages are removed from
NetworkStatsService. After that, forceUpdateIfaces requires
information that only ConnectivityService has, hence
restricting the calling permission to NETWORK_STACK or
MAINLINE_NETWORK_STACK permission. The required permission
will be changed from READ_NETWORK_USAGE_HISTORY to
NETWORK_STACK or MAINLINE_NETWORK_STACK. This change would make
it impossible to call outside the system.

Bug: 126830974
Test: atest FrameworksNetTests
Merged-In: I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60
Change-Id: I4ea421e4126a45f65d25fe0bec74243a3b20aeab
(cherry picked from commit 6b895dea25b4fca87d275bb78367411623ded1d4)
2019-04-10 06:36:55 +00:00
Chiachang Wang
e3f8027e89 Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces" am: 41c49d1a8e
am: a1a994c7eb

Change-Id: I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60
2019-04-09 20:14:44 -07:00
Chiachang Wang
a1a994c7eb Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces"
am: 41c49d1a8e

Change-Id: Id5922a41d07c95958090f88a65d22ef5883aefff
2019-04-09 19:37:20 -07:00
Chiachang Wang
41c49d1a8e Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces" 2019-04-10 02:27:30 +00:00
Benedict Wong
098b1e8ab0 Fix remove-before-add for IpSecService RefcountedResource
This patch fixes a bug where if a binder dies before the linkToDeath
call, the cleanup will be performed before the entry is added to the
array. While it is safe in that quotas and tracking performs as per
normal, the RefcountedRecord may not be cleaned up.

Rethrowing this exception is safe, since the only paths that would hit
this are all on binder threads coming from applications. Further, it
seems there is only one real way of this getting hit - if the app that
called the creation died during the binder call.

Bug: 126802451
Test: Compiled, CTS tests passing
Change-Id: Ib955acaa5e498c0e977cb5f2e48cffbc9fea8c7c
Merged-In: I6db75853da9f29e1573512e26351623f22770c5d
Merged-In: I416c2e43961ec0e1cc6b2fbcef970fbce858603b
Merged-In: Ib955acaa5e498c0e977cb5f2e48cffbc9fea8c7c
(cherry picked from commit 6c089d90bfa728e9842de0f5947f0c557c62dea0)
2019-04-09 21:37:26 +00:00