Commit Graph

73224 Commits

Author SHA1 Message Date
Tony Mak
3f552669e3 RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
am: d9e75a497e

Change-Id: Id1b62f552f29ef9a20d78bb7487201452dfda601
2019-01-08 02:50:57 -08:00
Tony Mak
d9e75a497e RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: runtest -x cts/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
Change-Id: Ib2ee544b5783234fba8ee2f93adf0b36b039520f
Merged-In: Ib2ee544b5783234fba8ee2f93adf0b36b039520f
2019-01-03 17:10:46 +00:00
Jakub Pawlowski
0712542a6f Bluetooth: Check descriptors size in BluetoothHidDeviceAppSdpSettings
am: f843ccbf9e

Change-Id: I73800fa61a09d6a5e603582a0a4046a8bb7fd5d8
2018-11-30 08:22:48 -08:00
Jakub Pawlowski
f843ccbf9e Bluetooth: Check descriptors size in BluetoothHidDeviceAppSdpSettings
Bug: 119819889
Test: compilation
Change-Id: If51d0e2af74d99758f79a603d40cc2f5c84e4dde
Merged-In: If51d0e2af74d99758f79a603d40cc2f5c84e4dde
2018-11-30 07:22:04 +00:00
Varun Shah
84376cb95a Merge "RESTRICT AUTOMERGE: Added an app id security check in isAppForeground." into oc-dev
am: 546ba589a2

Change-Id: I0b63c0bef57320b7465c2fe4e45304fd637e712d
2018-11-19 15:11:59 -08:00
Varun Shah
ad02e59ac2 RESTRICT AUTOMERGE: Added an app id security check in isAppForeground.
ActivityManagerService#isAppForeground now checks if the caller has the
permission to view if an app is in the foreground.

Bug: 115384617
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.ActivityManagerTest#testIsAppInForegroundNormal
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.ActivityManagerTest#testIsAppInForegroundMalicious
Change-Id: I9602c89b2d40036e525c38960a08326dc74c6682
2018-11-07 23:37:18 +00:00
Jeff Sharkey
893598cd4b Merge "RESTRICT AUTOMERGE: Recover shady content:// paths." into oc-dev
am: ab80221a8c

Change-Id: I61ef6b1a189ef345326a5455ff17b47d67f18f8d
2018-10-11 21:56:21 -07:00
Jeff Sharkey
a1ec7b115c 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 20:39:03 +00:00
Michael Wachenschwanz
1f5050c054 Merge changes from topic "am-bdb0270e-8295-4ee6-be36-2709e172d48f" into oc-dev
am: d32c2a4189

Change-Id: Ie2ad590368e9c10f6222d9ae65470ebb12dabac2
2018-09-05 18:46:57 -07:00
Android Build Merger (Role)
7cf42221c6 [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3 am: d6947f1cbf am: 628cbe5c53 am: 433e4173ec am: 686897ddd9
Change-Id: I07c1d68a0c5d8da6ec81c717dff97d33dba86a16
2018-08-30 20:46:20 +00:00
Android Build Merger (Role)
686897ddd9 [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3 am: d6947f1cbf am: 628cbe5c53 am: 433e4173ec
Change-Id: I8375f1c1a860f5021efc5873e94b452a44d6c145
2018-08-30 20:46:12 +00:00
Android Build Merger (Role)
433e4173ec [automerger] Verify number of Map entries written to Parcel am: 057a01d1f3 am: d6947f1cbf am: 628cbe5c53
Change-Id: Id32bd5aa02d5689873bb311eebc87f367af9a9d9
2018-08-30 20:46:05 +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
Mihai Popa
06829a62b1 Merge "Fix crash during cursor moving on BiDi text" into oc-dev
am: e385255db4

Change-Id: Ib094039b1c515af77fcc3c051352de5cb15861cb
2018-08-15 12:43:55 -07:00
Android Build Merger (Role)
8f85f5ffd2 [automerger] Fix crash during cursor moving on BiDi text am: 82c84d5fbb am: 12baaa2bc3 am: 99e3f649b4 am: a959ee227a
Change-Id: I7cb6623befc84f76e783b8800aa18ce28a8cc2b7
2018-08-15 19:13:10 +00:00
Android Build Merger (Role)
a959ee227a [automerger] Fix crash during cursor moving on BiDi text am: 82c84d5fbb am: 12baaa2bc3 am: 99e3f649b4
Change-Id: I16bff43cf755e443ed53f7a45469351c498f977f
2018-08-15 19:13:04 +00: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
Seigo Nonaka
f496a7cdc6 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:27 +00:00
Jeff Sharkey
5e8e47d4f8 Merge changes from topic "back111085900" into oc-dev
am: f0095ec4d6

Change-Id: Ie563f7c17a201dadfe8a6696d2cf99aebc07b855
2018-08-10 11:12:36 -07:00
Jeff Sharkey
628667ac86 DO NOT MERGE. Execute "strict" queries with extra parentheses.
am: 5a55a72fcd

Change-Id: I4be4620726e30ca4131320bde074a2e572c51a42
2018-08-10 11:05:51 -07:00
Android Build Merger (Role)
a2ad2596b7 [automerger] DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete. am: 8e95967f09 am: c09bb997e8 am: 424304f893 am: b2e2b1386f
Change-Id: Icdb977d8cb260d5210d103f306de550b3f8fed96
2018-08-09 20:16:00 +00:00
Android Build Merger (Role)
b2e2b1386f [automerger] DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete. am: 8e95967f09 am: c09bb997e8 am: 424304f893
Change-Id: I4c0f715b12df5e7ffb4f3a1b7cf9ae5da4be22ca
2018-08-09 20:15:55 +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)
19d2af61df [automerger] DO NOT MERGE. Execute "strict" queries with extra parentheses. am: 286fd5652a am: 8ecd22c0a4 am: 97d0d2c209 am: ca5fd693bc
Change-Id: Iccacb48d382a3fd8012dff81c3d8482afe0e5f14
2018-08-09 20:15:39 +00:00
Android Build Merger (Role)
ca5fd693bc [automerger] DO NOT MERGE. Execute "strict" queries with extra parentheses. am: 286fd5652a am: 8ecd22c0a4 am: 97d0d2c209
Change-Id: I92820ffe7b45077bc4beaf97144a7b7eb3117af0
2018-08-09 20:15:33 +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
09d4953133 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:43:22 -06:00
Jeff Sharkey
5a55a72fcd 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:43:16 -06: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
Arthur Ishiguro
bf8733b162 [automerger] Resolve inconsistent parcel read in NanoAppFilter am: abe5a73a4a am: 2895b320b4 am: 77e6e34644 am: 49e97ea1dc am: c2cfe453f2
am: cab2fa779e

Change-Id: Ifdd69396d202951f8b9ed5fe6e5766133955a5e5
2018-07-11 14:13:30 -07:00
Android Build Merger (Role)
cab2fa779e [automerger] Resolve inconsistent parcel read in NanoAppFilter am: abe5a73a4a am: 2895b320b4 am: 77e6e34644 am: 49e97ea1dc am: c2cfe453f2
Change-Id: I6e3461125290f2835ff1f9a996beb92e64172386
2018-07-06 22:55:21 +00:00
Android Build Merger (Role)
c2cfe453f2 [automerger] Resolve inconsistent parcel read in NanoAppFilter am: abe5a73a4a am: 2895b320b4 am: 77e6e34644 am: 49e97ea1dc
Change-Id: I19c512999a0eae233e2cc7c4d31d0c62556e4ffd
2018-07-06 22:55:14 +00:00
Android Build Merger (Role)
49e97ea1dc [automerger] Resolve inconsistent parcel read in NanoAppFilter am: abe5a73a4a am: 2895b320b4 am: 77e6e34644
Change-Id: I87ad6c5bad9275df8b1a131b3ac0daf7ec8ed5e4
2018-07-06 22:55:07 +00: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
f306664f4f Merge changes from topic "am-2d17369d-a241-482f-bad0-edb5147de00b" into nyc-mr2-dev
* changes:
  [automerger] Optimise the hit test algorithm am: 71ecf5bd5c am: 42eaa8f932 am: a72cb45f89 am: f5d69aa775
  [automerger] Optimise the hit test algorithm am: 71ecf5bd5c am: 42eaa8f932 am: a72cb45f89
  [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
b878c6a737 Merge changes from topic "am-2d17369d-a241-482f-bad0-edb5147de00b" into cw-f-dev
* changes:
  [automerger] Optimise the hit test algorithm am: 71ecf5bd5c am: 42eaa8f932 am: a72cb45f89
  [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
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
Atanas Kirilov
4f74605d11 Merge changes from topic "am-f5dc500e-4d32-4849-891e-c618cef666de" into oc-dev
am: c3b4881ea5

Change-Id: Ia58465b88ef5334753094719f4fdbb175b423f24
2018-06-05 14:24:30 -07:00
Atanas Kirilov
c3b4881ea5 Merge changes from topic "am-f5dc500e-4d32-4849-891e-c618cef666de" into oc-dev
* changes:
  [automerger] Make safe label more safe am: 2263da9539 am: 05086b1008 am: 77f449068a am: 46f4563313 am: 6be1d6713f
  [automerger] Make safe label more safe am: 2263da9539 am: 05086b1008 am: 77f449068a am: 46f4563313
  [automerger] Make safe label more safe am: 2263da9539 am: 05086b1008 am: 77f449068a
  [automerger] Make safe label more safe am: 2263da9539 am: 05086b1008
  [automerger] Make safe label more safe am: 2263da9539
  Make safe label more safe
2018-06-05 19:37:52 +00:00