Commit Graph

65422 Commits

Author SHA1 Message Date
Android Build Merger (Role)
6ef77aedac [automerger] RESTRICT AUTOMERGE: Recover shady content:// paths. am: 301d17e4dd am: 010585fe3c
Change-Id: I5f8b88ca54c22bb978fc6c468259fec9e0e9898a
2018-10-05 00:19:19 +00:00
Android Build Merger (Role)
010585fe3c [automerger] RESTRICT AUTOMERGE: Recover shady content:// paths. am: 301d17e4dd
Change-Id: I80ac911a166e12eedf77518436808d4f3ede872c
2018-10-05 00:19:12 +00:00
Jeff Sharkey
301d17e4dd RESTRICT AUTOMERGE: Recover shady content:// paths.
The path-permission element offers prefix or regex style matching of
paths, but most providers internally use UriMatcher to decide what
to do with an incoming Uri.

This causes trouble because UriMatcher uses Uri.getPathSegments(),
which quietly ignores "empty" paths.  Consider this example:

    <path-permission android:pathPrefix="/private" ... />

    uriMatcher.addURI("com.example", "/private", CODE_PRIVATE);

    content://com.example//private

The Uri above will pass the security check, since it's not
technically a prefix match.  But the UriMatcher will then match it
as CODE_PRIVATE, since it ignores the "//" zero-length path.

Since we can't safely change the behavior of either path-permission
or UriMatcher, we're left with recovering these shady paths by
trimming away zero-length paths.

Bug: 112555574
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests
Change-Id: Ibadbfa4fc904ec54780c8102958735b03293fb9a
2018-10-05 00:19:08 +00:00
Android Build Merger (Role)
628cbe5c53 [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3 am: d6947f1cbf
Change-Id: Idaab5395d9e0970fe57b017bcba10f8757ffe3c7
2018-08-30 20:45:59 +00:00
Android Build Merger (Role)
d6947f1cbf [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3
Change-Id: Idb2572b46c48fe2f3e4b99c5cb4372dcfe6b20ce
2018-08-30 20:45:51 +00:00
Michael Wachenschwanz
057a01d1f3 Verify number of Map entries written to Parcel
Make sure the number of entries written by Parcel#writeMapInternal
matches the size written. If a mismatch were allowed, an exploitable
scenario could occur where the data read from the Parcel would not
match the data written.

Fixes: 112859604
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.cts.ParcelTest

Change-Id: I325d08a8b66b6e80fe76501359c41b6656848607
Merged-In: I325d08a8b66b6e80fe76501359c41b6656848607
2018-08-30 13:40:44 -07:00
Android Build Merger (Role)
99e3f649b4 [automerger] Fix crash during cursor moving on BiDi text am: 82c84d5fbb am: 12baaa2bc3
Change-Id: Iaf0aded3004f33fdb52dd0c19779329991b24746
2018-08-15 19:12:59 +00:00
Android Build Merger (Role)
12baaa2bc3 [automerger] Fix crash during cursor moving on BiDi text am: 82c84d5fbb
Change-Id: I221d974ba9402c088235d5bdb3c94e91cf4167ba
2018-08-15 19:12:52 +00:00
Seigo Nonaka
82c84d5fbb Fix crash during cursor moving on BiDi text
The crash was introduced by Ib66ef392c19c937718e7101f6d48fac3abe51ad0
The root cause of the crashing is requesting out-of-line access for the
horizontal width. This invalid access is silently ignored by
TextLine#measure() method but new implementation end up with out of
bounds access.

To makes behavior as old implementation, calling getHorizontal instead
of accessing measured result array.

Bug: 78464361, 111580019
Test: Manually done
Change-Id: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
(cherry picked from commit 960647d582)
Merged-In: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
2018-08-15 19:12:50 +00:00
Android Build Merger (Role)
424304f893 [automerger] DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete. am: 8e95967f09 am: c09bb997e8
Change-Id: I544bf2c6b5d0177aa70a6fb7bd4225d4d04881fd
2018-08-09 20:15:51 +00:00
Android Build Merger (Role)
c09bb997e8 [automerger] DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete. am: 8e95967f09
Change-Id: I6cdb5a5dd5531ad53ef02174ff5063788d11029d
2018-08-09 20:15:45 +00:00
Android Build Merger (Role)
97d0d2c209 [automerger] DO NOT MERGE. Execute "strict" queries with extra parentheses. am: 286fd5652a am: 8ecd22c0a4
Change-Id: Ia9f489c55def0f592383ac2a10f5bd0b34c2663d
2018-08-09 20:15:28 +00:00
Android Build Merger (Role)
8ecd22c0a4 [automerger] DO NOT MERGE. Execute "strict" queries with extra parentheses. am: 286fd5652a
Change-Id: Ia877305c642c3b7741941d2e438fe77f1d1550f3
2018-08-09 20:15:19 +00:00
Jeff Sharkey
8e95967f09 DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete.
Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks.  This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.

Bug: 111085900
Test: atest packages/providers/DownloadProvider/tests/
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Change-Id: Ib4fc8400f184755ee7e971ab5f2095186341730c
Merged-In: Ib4fc8400f184755ee7e971ab5f2095186341730c
2018-08-03 13:42:35 -06:00
Jeff Sharkey
286fd5652a DO NOT MERGE. Execute "strict" queries with extra parentheses.
SQLiteQueryBuilder has a setStrict() mode which can be used to
detect SQL attacks from untrusted sources, which it does by running
each query twice: once with an extra set of parentheses, and if that
succeeds, it runs the original query verbatim.

This sadly doesn't catch inputs of the type "1=1) OR (1=1", which
creates valid statements for both tests above, but the final executed
query ends up leaking data due to SQLite operator precedence.

Instead, we need to continue compiling both variants, but we need
to execute the query with the additional parentheses to ensure
data won't be leaked.

Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111085900
Change-Id: I6e8746fa48f9de13adae37d2990de11c9c585381
Merged-In: I6e8746fa48f9de13adae37d2990de11c9c585381
2018-08-03 13:38:31 -06:00
Android Build Merger (Role)
77e6e34644 [automerger] Resolve inconsistent parcel read in NanoAppFilter am: abe5a73a4a am: 2895b320b4
Change-Id: I26b97af90ef6ea8b640ff7198b2883297d4fb03e
2018-07-06 22:55:02 +00:00
Android Build Merger (Role)
2895b320b4 [automerger] Resolve inconsistent parcel read in NanoAppFilter am: abe5a73a4a
Change-Id: Ieb925f073b80e4d624552e738d49b0996f0485ae
2018-07-06 22:54:55 +00:00
Arthur Ishiguro
abe5a73a4a Resolve inconsistent parcel read in NanoAppFilter
Bug: 77599679
Test: Compile only
Change-Id: Ib417a5cb4d51744442d2fb14437cabbe5fd1c266
2018-07-06 22:54:52 +00:00
Mihai Popa
3215a1fb09 Merge changes from topic "am-2d17369d-a241-482f-bad0-edb5147de00b" into nyc-mr1-dev
* changes:
  [automerger] Optimise the hit test algorithm am: 71ecf5bd5c am: 42eaa8f932
  [automerger] Optimise the hit test algorithm am: 71ecf5bd5c
  Optimise the hit test algorithm
2018-06-06 16:21:21 +00:00
Mihai Popa
272285b0bd Merge changes from topic "am-2d17369d-a241-482f-bad0-edb5147de00b" into nyc-dr1-dev
* changes:
  [automerger] Optimise the hit test algorithm am: 71ecf5bd5c
  Optimise the hit test algorithm
2018-06-06 16:21:21 +00:00
Mihai Popa
fd730b82f4 Merge "Optimise the hit test algorithm" into nyc-dev 2018-06-06 16:21:21 +00:00
Android Build Merger (Role)
a72cb45f89 [automerger] Optimise the hit test algorithm am: 71ecf5bd5c am: 42eaa8f932
Change-Id: I2ac44759ff615b32724f5235d3e5e8dc8c9b4ced
2018-05-31 16:46:27 +00:00
Android Build Merger (Role)
42eaa8f932 [automerger] Optimise the hit test algorithm am: 71ecf5bd5c
Change-Id: If1c91f3bc1e785434f153c5bc0d14befbc75e6cb
2018-05-31 16:46:17 +00:00
Mihai Popa
71ecf5bd5c Optimise the hit test algorithm
Layout#getOffsetForHorizontal was running in O(n^2) time, where n is the
length of the current line. The method is used when a touch event
happens on a text line, to compute the cursor offset (and the character)
where it happened. Although this is not an issue in common usecases,
where the number of characters on a line is relatively small, this can
be very inefficient as a consequence of Unicode containing 0-width
(invisible) characters. Specifically, there are characters defining the
text direction (LTR or RTL), which cause our algorithm to touch the
worst case quadratic runtime. For example, a person is able to send a
message containing a few visible characters, and also a lot of these
direction changing invisible ones. When the receiver touches the message
(causing the Layout#getOffsetForHorizontal method to be called), the
receiver's application would become not responsive.

This CL optimizes the method to run in O(n) worst case. This is achieved
by computing the measurements of all line prefixes at first, which can
be done in a single pass. Then, all the prefix measurement queries will
be answered in O(1), rather than O(n) as it was happening before.

Bug: 79215201
Test: manual testing
Change-Id: Ib66ef392c19c937718e7101f6d48fac3abe51ad0
Merged-In: Ib66ef392c19c937718e7101f6d48fac3abe51ad0
2018-05-31 17:45:42 +01:00
Android Build Merger (Role)
77f449068a [automerger] Make safe label more safe am: 2263da9539 am: 05086b1008
Change-Id: Ibf0d6da3ef712a2cc45587d59880ddce03a34447
2018-05-22 21:59:30 +00:00
Android Build Merger (Role)
05086b1008 [automerger] Make safe label more safe am: 2263da9539
Change-Id: If833354e5ae2b056de124fe23f0414c7654f6c33
2018-05-22 21:59:24 +00:00
Todd Kennedy
2263da9539 Make safe label more safe
* limit the absolute maximum size of the label to 50000 characters
[which is probably far more than necessary, but, can be dialed down]

* use a string buffer while processing the string [instead of creating
multiple string objects]

Bug: 62537081
Test: Manual. Install APK in bug and see that it can be uninstalled
Change-Id: Ibf63c2691ad7438a123e92110d95b1f50050f8b1
Merged-In: Ibf63c2691ad7438a123e92110d95b1f50050f8b1
2018-05-22 21:59:22 +00:00
Android Build Merger (Role)
232f42c7b8 [automerger] Nullcheck to fix Autofill CTS am: 6c68a69288 am: 743abb939a am: a99414f51f am: 6b95503960 am: 9e291fe8c2 am: 97f7498c18
Change-Id: I4f4b15c92832c0806fcf3e67f6fd5c9b13eebc1f
2018-05-09 17:19:38 +00:00
Android Build Merger (Role)
97f7498c18 [automerger] Nullcheck to fix Autofill CTS am: 6c68a69288 am: 743abb939a am: a99414f51f am: 6b95503960 am: 9e291fe8c2
Change-Id: Ia6ba75b4938ab6d9ec0ffe1bc39b6ce6995a808e
2018-05-09 17:19:32 +00:00
Android Build Merger (Role)
9e291fe8c2 [automerger] Nullcheck to fix Autofill CTS am: 6c68a69288 am: 743abb939a am: a99414f51f am: 6b95503960
Change-Id: Ia3658c17dc890ca2de951da5c701e953ce8c969b
2018-05-09 17:19:18 +00:00
Android Build Merger (Role)
6b95503960 [automerger] Nullcheck to fix Autofill CTS am: 6c68a69288 am: 743abb939a am: a99414f51f
Change-Id: I7aaceff0646a5e738ed862c34645e548aabf62f1
2018-05-09 17:19:12 +00:00
Android Build Merger (Role)
a99414f51f [automerger] Nullcheck to fix Autofill CTS am: 6c68a69288 am: 743abb939a
Change-Id: Ia89ea1adb47be3b70f5db292677c4c19194a04db
2018-05-09 17:19:07 +00:00
Android Build Merger (Role)
743abb939a [automerger] Nullcheck to fix Autofill CTS am: 6c68a69288
Change-Id: I379d54d926e01da53b637bba6b3b1ee8577cbdbb
2018-05-09 17:19:02 +00:00
Eugene Susla
6c68a69288 Nullcheck to fix Autofill CTS
Test: presubmit
Fixes: 70506475
Bug: 69981755
Change-Id: I187bed4889a4901a7137a2995178ea651ed09186
2018-05-09 17:18:59 +00:00
Android Build Merger (Role)
9822117184 [automerger] DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name am: b6cde9ecc1 am: b906043c81
Change-Id: I12322ddbacc848912426bacaa49469d6d5982c60
2018-04-26 21:18:53 +00:00
Android Build Merger (Role)
b906043c81 [automerger] DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name am: b6cde9ecc1
Change-Id: I3f951fac78c6e2da84eac511d3b0e19141e90153
2018-04-26 21:18:47 +00:00
Hansong Zhang
b6cde9ecc1 DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name
Test: manual
Bug: 73173182
Change-Id: I3c25af233742e63351a68e8c5a279b51a94e49e2
2018-04-26 21:18:46 +00:00
Android Build Merger (Role)
365fb1c844 [automerger] DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name am: 984dfe074c am: 8fbe4bce1e am: 0cd0cef08f
Change-Id: I937e2d9a676b38f6a18cda70f42d06eaa22ce051
2018-04-26 21:18:27 +00:00
Android Build Merger (Role)
0cd0cef08f [automerger] DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name am: 984dfe074c am: 8fbe4bce1e
Change-Id: If7693b2ff5785a1a09920061b318aaac33f5d6b6
2018-04-26 21:18:21 +00:00
Android Build Merger (Role)
8fbe4bce1e [automerger] DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name am: 984dfe074c
Change-Id: Iac403f5118d55d9919745d98eba260dd2929d56c
2018-04-26 21:18:14 +00:00
Hansong Zhang
984dfe074c DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name
Test: manual
Bug: 73173182
Change-Id: I3c25af233742e63351a68e8c5a279b51a94e49e2
2018-04-26 14:17:52 -07:00
Android Build Merger (Role)
5ddeef7116 [automerger] RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to nyc-dev) am: 33c37cb37c am: 93d9547b61
Change-Id: If515d9ec229e37bdc1368a96ae1f1b474dd50ebe
2018-04-09 22:24:16 +00:00
Android Build Merger (Role)
93d9547b61 [automerger] RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to nyc-dev) am: 33c37cb37c
Change-Id: I793b787b6275262f1df6caa9262054e15c94840f
2018-04-09 22:24:08 +00:00
akirilov
33c37cb37c RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to nyc-dev)
Test: added AccessibilityEndToEndTest#testPackageNameCannotBeFaked
      cts-tradefed run cts -m CtsAccessibilityServiceTestCases
      cts-tradefed run cts -m CtsAccessibilityTestCases

Bug: 69981755
Change-Id: I187e3e9839f654cea9e06e5de93e10e4d1de3109
2018-04-09 22:24:05 +00:00
Android Build Merger (Role)
0df0b30be9 [automerger] RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to mnc-dev) am: de71ee469a am: d672eef559 am: 86f5488521
Change-Id: I9f6c6fedfdc987a2acf1978a71fb0bdcd034e9e0
2018-04-09 21:00:20 +00:00
Android Build Merger (Role)
86f5488521 [automerger] RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to mnc-dev) am: de71ee469a am: d672eef559
Change-Id: Ib50692050fd4e62ad80f24531818a378c75dfe25
2018-04-09 21:00:15 +00:00
Android Build Merger (Role)
d672eef559 [automerger] RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to mnc-dev) am: de71ee469a
Change-Id: I000fae45e723679ba44b378a36a85daef20ae96d
2018-04-09 21:00:08 +00:00
akirilov
de71ee469a RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to mnc-dev)
Test: added AccessibilityEndToEndTest#testPackageNameCannotBeFaked
      cts-tradefed run cts --package android.accessibilityservice
      cts-tradefed run cts --package android.accessibility

BUG:69981755

Change-Id: Id9990ccf1e88cea441f9b8927e849e67a059cfe4
2018-04-09 21:00:05 +00:00
Android Build Merger (Role)
9d13b0f6ca [automerger] DO NOT MERGE Rework thumbnail cleanup am: b514ce9b38 am: b8dad6c644 am: 019eec3923
Change-Id: I9f69b090824a6c91bf11dbc0929ba5988a06af52
2018-03-15 19:59:37 +00:00
Android Build Merger (Role)
019eec3923 [automerger] DO NOT MERGE Rework thumbnail cleanup am: b514ce9b38 am: b8dad6c644
Change-Id: I8539a02510ed9a61b683c66c66de7d1b319c2603
2018-03-15 19:59:32 +00:00