Commit Graph

1178 Commits

Author SHA1 Message Date
Android Build Merger (Role)
e3ccb35df6 Merge "Merge "[CHERRY-PICK] API for apps to tag sockets with their own UID." am: 476398c50d am: 826657a9c2" into oc-mr1-dev-plus-aosp
am: 11448df5a1  -s ours

Change-Id: I3289c409e2014c898cba8ba14768ea174937ffed
2017-12-18 22:14:52 +00:00
Benedict Wong
59dd893f9e Merge "[CHERRY-PICK] API for apps to tag sockets with their own UID." am: 476398c50d
am: 826657a9c2

Change-Id: Ia06653e6c1cccddcd2de17dd88a9ef47263f5c79
2017-12-18 21:56:41 +00:00
Benedict Wong
476398c50d Merge "[CHERRY-PICK] API for apps to tag sockets with their own UID." 2017-12-18 21:32:10 +00:00
Benedict Wong
083faee14a [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
Jeff Sharkey
1fb74318cf [CHERRY-PICK] API for apps to tag sockets with their own UID.
This enables app A to create a socket, pass it to app B, and have
app B accept blame for the traffic performed on that socket.

Also adds helpful public APIs for tagging raw FileDescriptor sockets
instead of making developers go through shady SocketImpl wrappers.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests#testAppFailAccessPrivateData
Bug: 63932076
Change-Id: I08925c843974675fc82e4080cec2eaab9ab7cd41
Merged-In: I08925c843974675fc82e4080cec2eaab9ab7cd41
(cherry picked from commit 4e164f9e94)
2017-12-18 19:44:40 +00:00
android-build-team Robot
568cc1a854 Snap for 4507345 from d6815d74dd051c0881cbbfa9fb68a8f91a6634bd to pi-release
Change-Id: I2aa3c47e2acaf1fd28f934c74ae599d508f807d8
2017-12-17 08:21:43 +00:00
nharold
05e99ef743 Merge "Use consistent naming for allocating SPI." am: 816f0ebaab am: 4753ed4b1b
am: 63f6a5625f

Change-Id: Ib6845ab0d7f385fbd1d59c0179771542e12c8be0
2017-12-14 21:48:58 +00:00
nharold
63f6a5625f Merge "Use consistent naming for allocating SPI." am: 816f0ebaab
am: 4753ed4b1b

Change-Id: Ib5d89044313341790b1ee9271642072ddce181af
2017-12-14 21:36:32 +00:00
nharold
816f0ebaab Merge "Use consistent naming for allocating SPI." 2017-12-14 21:10:16 +00:00
android-build-team Robot
6ca91231a6 Snap for 4502278 from c9f1a9e3dd214b167a49ac4560382e2e98084ff6 to pi-release
Change-Id: I90327a54990367873664fe9dd5c64e73e83f5078
2017-12-14 08:34:50 +00:00
TreeHugger Robot
4f47e565a9 Merge "Add more IntDef prefixes for auto-documenting." 2017-12-14 07:17:52 +00:00
Jeff Sharkey
f95fb35f01 Add more IntDef prefixes for auto-documenting.
Test: builds, boots
Bug: 70177949
Exempt-From-Owner-Approval: annotation-only changes
Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
2017-12-13 20:05:36 -07:00
Benedict Wong
d49373feb3 Merge "Convert IpSecService resources to use refcounting" am: 670db0329b am: 8698b33cc2
am: 8d32535eec

Change-Id: Ib18839d7dff8e25898f81e877337fbb8cb24cc7b
2017-12-14 02:41:28 +00:00
Benedict Wong
8d32535eec Merge "Convert IpSecService resources to use refcounting" am: 670db0329b
am: 8698b33cc2

Change-Id: I9645df5304d7f11068d190cbdaccfe83ca0580bc
2017-12-14 02:20:20 +00:00
Benedict Wong
670db0329b Merge "Convert IpSecService resources to use refcounting" 2017-12-14 01:45:15 +00:00
Benedict Wong
6855aeeea2 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
ea022aef1f Merge "Add reference counted resources to IpSecService" am: 20f80d2083 am: adb6437fea
am: dde203cc4d

Change-Id: Iae17a5d33d71e8abf24211cbf2b215520f45c619
2017-12-13 22:11:20 +00:00
Benedict Wong
dde203cc4d Merge "Add reference counted resources to IpSecService" am: 20f80d2083
am: adb6437fea

Change-Id: I927ac534570b3836510e0fb4feda8cf544f5a9e4
2017-12-13 22:00:26 +00:00
Benedict Wong
20f80d2083 Merge "Add reference counted resources to IpSecService" 2017-12-13 21:33:38 +00:00
Benedict Wong
023468286a 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
20e96c55d5 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
android-build-team Robot
65e87206b6 Snap for 4496165 from 0b62766d27da6867cc6d00347cd81427a6ec9e86 to pi-release
Change-Id: I873873f416470a831e1a317fc79396d3049bcac8
2017-12-11 12:24:01 +00:00
Xin Li
6d9c671952 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: b5b6726458 -s ours am: 3aafa4c9ce
am: eab0bd7d94  -s ours

Change-Id: Iba7fa3c7c0a70e34f97b408fe5b58187b1e433ac
2017-12-08 00:40:44 +00:00
Xin Li
eab0bd7d94 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: b5b6726458 -s ours
am: 3aafa4c9ce

Change-Id: I0e586f759df230aeff2dd045e5ff1d138d284ec3
2017-12-07 08:34:18 +00:00
Xin Li
b5b6726458 Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:26 +00:00
android-build-team Robot
c1b2aacdeb Snap for 4484469 from f62c26562f150109d9498488ffb9798e4e2a84d8 to pi-release
Change-Id: I382b60bef0752eeb6bbb2d9db555ff7f81d1fdf2
2017-12-05 08:33:39 +00:00
Jeff Sharkey
c10b61fc54 Merge "API for apps to tag sockets with their own UID." 2017-12-05 05:00:46 +00:00
nharold
97e981cca3 Merge "Validate IpSecAlgorithm Length" am: 68b81299d2 am: f0dd03e114
am: c8347df907

Change-Id: I1a28d860ac7125afc1f82ac17d1834b0121c0e11
2017-12-05 02:46:06 +00:00
nharold
c8347df907 Merge "Validate IpSecAlgorithm Length" am: 68b81299d2
am: f0dd03e114

Change-Id: I1ffaa4de392777c5199a411aef9cd10f4e7c3666
2017-12-05 02:37:14 +00:00
nharold
f0dd03e114 Merge "Validate IpSecAlgorithm Length"
am: 68b81299d2

Change-Id: I23f7612c119e67f9a1647568aeefde38a365f8da
2017-12-05 02:28:10 +00:00
Jeff Sharkey
4e164f9e94 API for apps to tag sockets with their own UID.
This enables app A to create a socket, pass it to app B, and have
app B accept blame for the traffic performed on that socket.

Also adds helpful public APIs for tagging raw FileDescriptor sockets
instead of making developers go through shady SocketImpl wrappers.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests#testAppFailAccessPrivateData
Bug: 63932076
Change-Id: I08925c843974675fc82e4080cec2eaab9ab7cd41
2017-12-04 17:43:40 -07:00
Nathan Harold
eb1d489332 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
android-build-team Robot
e210ce0475 Snap for 4464948 from 181704c9629a6dabedb378a565463e60c072494a to pi-release
Change-Id: I1d4de232dbdf27d323c85390de1a9619126e7a1c
2017-11-22 08:20:36 +00:00
Jonathan Basseri
b77b161454 Merge "Javadoc cleanup of IpSecManager API." am: d09d106ec0 am: f96bfee165
am: 3947cda36f

Change-Id: Id10e39da5495f9367332cbc5c754506fc64f3c75
2017-11-22 02:10:32 +00:00
Jonathan Basseri
3947cda36f Merge "Javadoc cleanup of IpSecManager API." am: d09d106ec0
am: f96bfee165

Change-Id: I53e9b3d18fda1122f6a8a6300185c743cc26dbf6
2017-11-22 02:00:53 +00:00
Jonathan Basseri
f96bfee165 Merge "Javadoc cleanup of IpSecManager API."
am: d09d106ec0

Change-Id: Iaf206b0980d3bed14fe6b8318d2073577212b460
2017-11-22 01:51:46 +00:00
Jonathan Basseri
2725a233c9 Javadoc cleanup of IpSecManager API.
This changes only comments and annotations, which results
in minor API changes.

Bug: 63777932
Test: `make update-api` and visually inspect generated HTML.
Change-Id: I7a7a9244eade6cc55aca17a47e0a838cd6f84cc9
2017-11-20 10:49:59 -08:00
android-build-team Robot
e977989212 Snap for 4453288 from 1610206b04c16bccd0847b7af1faa2ece523850e to pi-release
Change-Id: I688505a12c9d78ec53ea636f37957a8224128209
2017-11-15 08:36:35 +00:00
Xin Li
5d3f7dcf9e Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master. am: 47beb1e8a3 -s ours
am: 1f3983785b  -s ours

Change-Id: Idfc0b2349f7475089373c8fdceebe7f166a5cd37
2017-11-15 02:39:52 +00:00
Xin Li
1f3983785b Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.
am: 47beb1e8a3  -s ours

Change-Id: I2d08ca9a952babfd1480278ca6331b697be2a32e
2017-11-15 01:30:08 +00:00
Xin Li
47beb1e8a3 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
android-build-team Robot
f19304d13e Snap for 4447680 from e33bc3b967aef6f10df82e5b374e4b701ce6ca69 to pi-release
Change-Id: I01a65cfddf0f5d774ae55f359b88845ce8518ff2
2017-11-12 08:31:52 +00:00
Ricky Wai
3e97a6fc40 Hide NetworkStatsFactory class
Test: Able to compile
Change-Id: I37f385c773120405c437643b5de406772a684dcd
2017-11-09 15:22:59 +00:00
android-build-team Robot
69a006e6b3 Snap for 4442369 from 7b6dc75285ad08cdca6f75aac150c29c7618dd2f to pi-release
Change-Id: I1b5419a3fe0334a11a70a3f78a557113f1278a20
2017-11-09 08:26:18 +00:00
nharold
2fd8e1a9e6 Merge "Fix signature for finalize() to resolve API Lint error" am: 28dc8a29a1
am: c09d405e1d

Change-Id: I1f8915547876e0e0045724eb9a1e29123ab4edda
2017-11-08 18:20:06 +00:00
Benedict Wong
d12ea7c331 Merge "Update documentation for AES-GCM-ESP keymat length" am: f27dc03921
am: 6491b03410

Change-Id: I5e61a9c28dac49f2dca554ce2fdf755ab7be0dab
2017-11-08 18:12:25 +00:00
nharold
28dc8a29a1 Merge "Fix signature for finalize() to resolve API Lint error" 2017-11-08 17:56:43 +00:00
Benedict Wong
f27dc03921 Merge "Update documentation for AES-GCM-ESP keymat length" 2017-11-08 17:47:40 +00:00
Nathan Harold
2a30daf3f7 Fix signature for finalize() to resolve API Lint error
The API linter on goog/master noticed that this method is
listed in the public API even though it's protected. The
change is probably related to a signature change from the
internal finalize method which throws a Throwable. Fix the
method in IpSecManager to throw Throwable, which should
fix the current.txt and resolve the lint error.

Bug: 69006767
Test: compilation, make update-api
Change-Id: I173d014baaa505c365b7916fcb52f2a8b4af9373
2017-11-07 17:46:12 -08:00
Benedict Wong
01b1ab4034 Update documentation for AES-GCM-ESP keymat length
Added notes that keymat length must include 32 bits of salt.

Bug: 68672051
Test: Frameworks-net unit tests & IpSecManager CTS tests run
Change-Id: I0ae0c5be8a45b2374783b3bd1fa8bf930f15e687
2017-11-07 17:39:35 -08:00