Commit Graph

4310 Commits

Author SHA1 Message Date
Benedict Wong
b72b41b121 Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" am: 0b8bf40ae4
am: 8caa274ade

Change-Id: I2f27c76a1f493ff4f0bd423c06f159e629866d4d
2017-12-19 00:27:57 +00:00
Hugo Benichi
be36e5929e Merge changes I798d8fec,I4a2d5866 am: c5212b6654
am: 99be302c71

Change-Id: I41b507c4e4bf9b8b9082f5e7eaab8985b5bbef41
2017-12-19 00:06:00 +00:00
Benedict Wong
0b8bf40ae4 Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" 2017-12-18 23:50:52 +00:00
Benedict Wong
c41067d51a [ipsec-qtaguid] Tag sockets upon creation of encap sockets
Added calls to tag encap sockets to that of the UID for which the encap
socket is being created on behalf of. This ensures that all data
accounting generated for the UDP-encap-ESP socket is correctly billed to
the right UID.

Bug: 62994731
Test: New tests added to IpSecServiceTest.java, passing
Change-Id: I15365ea9c982fd7b4e3cdeff314ddfba2289c86e
2017-12-18 19:46:06 +00:00
Hugo Benichi
3f83b8ad4e MacAddress: address api review comments
1) toSafeString() is renamed to toOuiString()
2) toOuiString() returns a String that only contains the first 3 bytes
   of the mac address.

Bug: 70336442
Test: runtest frameworks-net
Change-Id: I798d8fec32dbff5687a682028e5d90eb941f81c1
2017-12-18 09:22:47 +09:00
Hugo Benichi
3f33d23522 Expose the MacAddress class in the api
Test: built,  flashed, $ runtest frameworks-net
Bug: 69390696
Change-Id: Ica5efdf5ffe8ad2500a87f574508a2bcd074b33d
Merged-In: Ica5efdf5ffe8ad2500a87f574508a2bcd074b33d

(cherry picked from commit d411cf61ed5b948aaf6f6234217d6c6999c35159)
2017-12-18 09:21:26 +09:00
nharold
9f34247bc3 Merge "Fix broken test due to API rename" am: 2ea0bc5ffa
am: ee898c81a7

Change-Id: I7e99991cd2c71c66e1acb3aa3957efb28c9a426a
2017-12-14 23:28:16 +00:00
nharold
2ea0bc5ffa Merge "Fix broken test due to API rename" 2017-12-14 23:07:53 +00:00
Nathan Harold
bcbe3b6bf2 Fix broken test due to API rename
A race condition during an Api rename has caused
the name change from reserveSecurityParameterIndex
to allocateSecurityParameterIndex to be wrong in
a test. Fixing.

Bug: 69128142
Test: runtest frameworks-net
Change-Id: I12fb9832cb938dc19f463b1f1124127435d7b173
2017-12-14 23:04:42 +00:00
nharold
b6bca5a59d Merge "Use consistent naming for allocating SPI." am: 37303d5e94
am: 4753ed4b1b

Change-Id: Ib5d89044313341790b1ee9271642072ddce181af
2017-12-14 21:36:32 +00:00
nharold
37303d5e94 Merge "Use consistent naming for allocating SPI." 2017-12-14 21:10:16 +00:00
Benedict Wong
393a328478 Merge "Convert IpSecService resources to use refcounting" am: a87a442c5a
am: 8698b33cc2

Change-Id: I9645df5304d7f11068d190cbdaccfe83ca0580bc
2017-12-14 02:20:20 +00:00
Benedict Wong
a87a442c5a Merge "Convert IpSecService resources to use refcounting" 2017-12-14 01:45:15 +00:00
Benedict Wong
d21105064e Convert IpSecService resources to use refcounting
This is part 2 of 2 of the refcounting refactor for IpSecService
resources.

Switched ManagedResources to use RefcountedResource structure for
managing reference counts and eventual cleanup. Further, resource arrays
and quota management have been aggregated into a UserRecord for better
isolation. UID access checking has been similarly moved into the
UserRecordTracker, and resourceId checking has been rolled into
RefcountedResourceArray's accessor methods.

Bug: 63409385
Test: CTS, all unit tests run on aosp_marlin-eng, new tests added
Change-Id: Iee52dd1c9d2583bb6bfaf65be87569e9d50a5b63
2017-12-13 23:28:41 +00:00
Benedict Wong
5dd409e76b Merge "Add reference counted resources to IpSecService" am: 05013f3965
am: adb6437fea

Change-Id: I927ac534570b3836510e0fb4feda8cf544f5a9e4
2017-12-13 22:00:26 +00:00
Benedict Wong
05013f3965 Merge "Add reference counted resources to IpSecService" 2017-12-13 21:33:38 +00:00
Benedict Wong
11c8f27e22 Add reference counted resources to IpSecService
This patch adds (but does not enable the usage of) RefcountedResource
objects to IpSecService, with tests to ensure correct function. This is
patch 1 of a series of patches to refactor the resource management
systems in IpSecService.

RefcountedResource objects allow for management of acyclical dependency
trees, ensuring eventual cleanup when resources are no longer used. This
cleanup may be triggered by binder death or by explicit user action.

Bug: 63409385
Test: New tests written in IpSecServiceRefcountedResourceTest,
explicitly testing the RefcountedResource class

Change-Id: Ib5be7482b2ef5f1c8dec9be68f15e90d8b3aba6d
2017-12-12 23:40:52 -08:00
Jonathan Basseri
fbe3a82340 Use consistent naming for allocating SPI.
Throughout the IPsec code (API, system server, netd) we use "reserve"
SPI and "allocate" SPI interchangeably. This renames to use "allocate"
everywhere for self-consistency and consistency with the kernel
(ALLOCSPI).

In javadoc, I am leaving the word "reserve" in several places because it
is still an accurate description of how the method behaves.

Bug: 69128142
Test: TreeHugger should be enough
Change-Id: I8ea603b4612303b0393beef04032671fa53d2106
2017-12-12 13:50:35 -08:00
Xin Li
26f226f058 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: 49f174beba -s ours
am: 3aafa4c9ce

Change-Id: I0e586f759df230aeff2dd045e5ff1d138d284ec3
2017-12-07 08:34:18 +00:00
Xin Li
49f174beba Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:26 +00:00
ludi
5b77df1729 Merge "Cleanup of resource limit tests" am: 7d0a38956e
am: dc7693b146

Change-Id: I102693c752fb8fbaf9c1bac824047b5ed6d3d9c1
2017-12-06 03:49:56 +00:00
ludi
dc7693b146 Merge "Cleanup of resource limit tests"
am: 7d0a38956e

Change-Id: Ifcbc61ad8003c43ba1baff6d4d534192f6498206
2017-12-06 03:29:35 +00:00
Treehugger Robot
7d0a38956e Merge "Cleanup of resource limit tests" 2017-12-06 02:58:41 +00:00
Hugo Benichi
23649344d2 Merge "Fix bug in MacAddress.fromString()" am: cdb84d2fc7
am: a31109c229

Change-Id: If67d0b8fcc2270d4b152d4e07c79725b457574c6
2017-12-05 10:01:19 +00:00
Hugo Benichi
a31109c229 Merge "Fix bug in MacAddress.fromString()"
am: cdb84d2fc7

Change-Id: If4c85f0a5ea259f53f9cffa6eacb58fcde1fd1df
2017-12-05 09:47:50 +00:00
Hugo Benichi
21c7a52042 Fix bug in MacAddress.fromString()
Test: runtest frameworks-net
Bug: 69390696
Change-Id: I83f01e4915092e08ed201d9b6738bb02498d3bba
2017-12-05 13:14:08 +09:00
nharold
96af5bbd36 Merge "Validate IpSecAlgorithm Length" am: 98ecd7efb2
am: 2a20e7a677

Change-Id: I1ffaa4de392777c5199a411aef9cd10f4e7c3666
2017-12-05 02:37:14 +00:00
nharold
2a20e7a677 Merge "Validate IpSecAlgorithm Length"
am: 98ecd7efb2

Change-Id: I23f7612c119e67f9a1647568aeefde38a365f8da
2017-12-05 02:28:10 +00:00
nharold
98ecd7efb2 Merge "Validate IpSecAlgorithm Length" 2017-12-05 02:13:55 +00:00
Jeff Sharkey
6e46b3bba8 Merge "Match network roaming state to avoid wtf()." am: cd797a5069
am: 5f948c9bc1

Change-Id: I3dd62df8b9bb89936c1c722849bfa921bc8b3e6d
2017-12-05 01:28:55 +00:00
Jeff Sharkey
5f948c9bc1 Merge "Match network roaming state to avoid wtf()."
am: cd797a5069

Change-Id: I6796d37e4458ef4da16d16f4c0f2bdd495007515
2017-12-05 01:11:53 +00:00
Jeff Sharkey
cd797a5069 Merge "Match network roaming state to avoid wtf()." 2017-12-05 00:58:46 +00:00
Hugo Benichi
6600538c55 Merge "MacAddress: light refactors and improve documentation" am: d871cab32d
am: 56eeb80dc5

Change-Id: I1e9948225e7c5ad64fad2e596d03deb3524c411c
2017-12-04 23:51:41 +00:00
Hugo Benichi
56eeb80dc5 Merge "MacAddress: light refactors and improve documentation"
am: d871cab32d

Change-Id: I51bb8786ecd7f53e3342625c7a2625007eedfc0f
2017-12-04 23:38:27 +00:00
Nathan Harold
82c3470df9 Validate IpSecAlgorithm Length
Improve the Validation of IpSecAlgorithm by
explicitly checking the length in addition to
the truncation length (previously an oversight).
In addition, we now check the lengths during
un-parceling, which will catch someone maliciously
manually building a parcel and passing it, bypassing
the checks in the constructor.

Bug: 68780091
Test: runtest -x IpSecAlgorithmTest.java
Change-Id: I8172762617264d34f47d5144336464510f07a701
2017-12-04 15:12:14 -08:00
Jeff Sharkey
58330a79bb Match network roaming state to avoid wtf().
Test: sure
Bug: 70174865
Change-Id: I02faef05e3fb918c3c023fb2fdd1886d45cc8c71
Exempt-From-Owner-Approval: P0 bug
2017-12-04 15:52:54 -07:00
Hugo Benichi
5bc3546cf6 MacAddress: light refactors and improve documentation
This patch does some light refactoring in MacAddress to prepare for
exposing MacAddress in the public api:
 - documention is improved
 - some method names are renamed
 - a toSafeString method is added
 - a padding bug in the conversion methods outputting strings for
   mac addresses is fixed

Bug: 69390696
Test: runtest frameworks-net
Change-Id: I399a97dabc2dfa8df9c5518c8b12484e43ca05c9
2017-12-04 22:34:43 +09:00
ludi
de99e42cc8 Cleanup of resource limit tests
Test: runtest frameworks-net
Bug: 65688605
Change-Id: Ice3ff2624b83c833a99559485c1e782d36c54ae3
2017-11-28 10:21:18 -08:00
Jeff Sharkey
e0b2908be9 Merge "Clarify docs, sanity check roaming state." am: c80a1f23f3
am: 8c089f392e

Change-Id: If4f09f8a0e32c245552f025f1a61d67f842b1841
2017-11-27 21:39:56 +00:00
Jeff Sharkey
8c089f392e Merge "Clarify docs, sanity check roaming state."
am: c80a1f23f3

Change-Id: Ic30d5aaadf2c59978162c53d7e7781847244ce52
2017-11-27 21:30:57 +00:00
Jeff Sharkey
c80a1f23f3 Merge "Clarify docs, sanity check roaming state." 2017-11-27 21:19:40 +00:00
Jeff Sharkey
9ff2ddd7e7 Clarify docs, sanity check roaming state.
Update public docs to hide the fact that NetworkCapabilities is only
used inside NetworkRequest as an implementation detail.

Take up less room on the wire when passing NetworkCapabilities around
via NetworkRequest.

Sanity check that the roaming state between NetworkInfo and
NetworkCapabilities is in agreement.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.,com.android.server.connectivity.,com.android.server.ConnectivityServiceTest
Bug: 67040695
Change-Id: I982b4c3c41a140934bbad3b8ca8f12dc3814e86c
2017-11-27 12:47:14 -07:00
Hugo Benichi
5b13decb2a Merge "IP connectivity metrics: fix LINGER/UNLINGER logging" am: 9632d1eef4
am: 2c939b0d7a

Change-Id: I422ef3cd6eab19cf3de2d6d9520840a7597c4a65
2017-11-15 22:50:22 +00:00
Hugo Benichi
2c939b0d7a Merge "IP connectivity metrics: fix LINGER/UNLINGER logging"
am: 9632d1eef4

Change-Id: I6f10845788ba5558637703da6d8c5c41324935cc
2017-11-15 22:42:50 +00:00
Hugo Benichi
9632d1eef4 Merge "IP connectivity metrics: fix LINGER/UNLINGER logging" 2017-11-15 22:31:59 +00:00
Di Lu
e8c8f6267d Merge "Add test case for user quota management in IpSecService" am: baaa5670f5
am: 4288bb9e34

Change-Id: I1022151e9317194ac45501a59f68c9bba89e16df
2017-11-15 20:31:37 +00:00
Di Lu
4288bb9e34 Merge "Add test case for user quota management in IpSecService"
am: baaa5670f5

Change-Id: Ib1887b2395f0b1391711a9df9bebe224b6be1643
2017-11-15 20:23:14 +00:00
Di Lu
baaa5670f5 Merge "Add test case for user quota management in IpSecService" 2017-11-15 20:12:38 +00:00
Xin Li
dbb2641147 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.
am: acae66beee  -s ours

Change-Id: I2d08ca9a952babfd1480278ca6331b697be2a32e
2017-11-15 01:30:08 +00:00
Xin Li
acae66beee Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00