Commit Graph

58327 Commits

Author SHA1 Message Date
Charles He
8bcdab7e6f Prevent writing to FRP partition during factory reset. am: a9437bd1ca am: 2ce5c4320d am: 133ff4d611 am: 00a581f882 am: e5156ec1e9
am: 9a47fa7fc0

Change-Id: Ifb9f5b177f7c031352e6e9cf308e6295f7c60074
2016-12-29 10:34:04 +00:00
Charles He
9a47fa7fc0 Prevent writing to FRP partition during factory reset. am: a9437bd1ca am: 2ce5c4320d am: 133ff4d611 am: 00a581f882
am: e5156ec1e9

Change-Id: I62b79fe7ef5a2febce27729f4709a599832cb3da
2016-12-29 10:25:50 +00:00
Charles He
e5156ec1e9 Prevent writing to FRP partition during factory reset. am: a9437bd1ca am: 2ce5c4320d am: 133ff4d611
am: 00a581f882

Change-Id: I016955744e48d7a91380c2ff39f7c64536a39c7e
2016-12-29 10:18:49 +00:00
Charles He
00a581f882 Prevent writing to FRP partition during factory reset. am: a9437bd1ca am: 2ce5c4320d
am: 133ff4d611

Change-Id: I54b163f645f561243aac3df1a55c1023531997b3
2016-12-29 10:11:20 +00:00
Charles He
133ff4d611 Prevent writing to FRP partition during factory reset. am: a9437bd1ca
am: 2ce5c4320d

Change-Id: I29339a634fd22cd46bfc08619464da8fe159a2b7
2016-12-29 10:03:53 +00:00
Charles He
2ce5c4320d Prevent writing to FRP partition during factory reset.
am: a9437bd1ca

Change-Id: Ib0b8db2357317dc3e680910c08f15f098baf2af9
2016-12-29 09:48:45 +00:00
Charles He
a9437bd1ca Prevent writing to FRP partition during factory reset.
Avoid potential race condition between FRP wipe and write operations
during factory reset by making the FRP partition unwritable after
wipe.

Bug: 30352311
Test: manual
Change-Id: If3f024a1611366c0677a996705724458094fcfad
(cherry picked from commit a629c772f4)
2016-12-14 12:08:30 +00:00
Svetoslav Ganov
a97171ec49 Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying
ashmem region to mmap the data but the ashmem size
can be changed until the former is memory mapped.
Since we use the ashmem region size for boundary
checking and memory unmapping if it does not match
the size used while mapping an attacker can force
the system to unmap memory or to access undefined
memory and crash.

Also we were passing the memory address where the
ashmem region is mapped in the owner process to
support cases where the client can pass back the
MemoryIntArray instance. This allows an attacker
to put invalid address and cause arbitrary memory
to be freed.

Now we no longer support passing back the instance
to the owner process (the passed back instance is
read only), so no need to pass the memory adress
of the owner's mapping, thus not allowing freeing
arbitrary memory.

 Further, we now check the memory mapped size against
 the size of the underlying ashmem region after we do
 the memory mapping (to fix the ahsmem size) and if
 an attacker changed the size under us we throw.

 Tests: Updated the tests and they pass.

 bug:33039926
 bug:33042690

Change-Id: I1004579181ff7a223ef659e85c46100c47ab2409
2016-12-08 11:51:26 -08:00
Svetoslav Ganov
1f06508bc6 Revert "Fix vulnerability in MemoryIntArray"
This reverts commit 4694cad511.

Change-Id: I235ea3c4bd86d90bf97bc1a2d023f4780251e570
2016-12-08 02:17:40 +00:00
Svetoslav Ganov
4694cad511 Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying
ashmem region to mmap the data but the ashmem size
can be changed until the former is memory mapped.
Since we use the ashmem region size for boundary
checking and memory unmapping if it does not match
the size used while mapping an attacker can force
the system to unmap memory or to access undefined
memory and crash.

Also we were passing the memory address where the
ashmem region is mapped in the owner process to
support cases where the client can pass back the
MemoryIntArray instance. This allows an attacker
to put invalid address and cause arbitrary memory
to be freed.

Now we no longer support passing back the instance
to the owner process (the passed back instance is
read only), so no need to pass the memory adress
of the owner's mapping, thus not allowing freeing
arbitrary memory.

Further, we now check the memory mapped size against
the size of the underlying ashmem region after we do
the memory mapping (to fix the ahsmem size) and if
an attacker changed the size under us we throw.

Tests: Updated the tests and they pass.

bug:33039926
bug:33042690

Change-Id: Id7f0e8a4c861b0b9fa796767e0c22d96633b14d1
2016-12-08 01:35:08 +00:00
Aart Bik
29139a8ae5 Revert "Fix vulnerability in MemoryIntArray"
This reverts commit 86dfa094de.


BROKE BUILD (as shown in some treehugger builds)

frameworks/base/core/java/android/util/MemoryIntArray.java:84: error: cannot find symbol
        mCloseGuard.open("close");
        ^
        
       
bug:33039926
bug:33042690

Change-Id: Ief875e543ec849fe55c747fb1ed5253f0cd9a122
2016-12-08 01:12:48 +00:00
Svetoslav Ganov
86dfa094de Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying
ashmem region to mmap the data but the ashmem size
can be changed until the former is memory mapped.
Since we use the ashmem region size for boundary
checking and memory unmapping if it does not match
the size used while mapping an attacker can force
the system to unmap memory or to access undefined
memory and crash.

Also we were passing the memory address where the
ashmem region is mapped in the owner process to
support cases where the client can pass back the
MemoryIntArray instance. This allows an attacker
to put invalid address and cause arbitrary memory
to be freed.

Now we no longer support passing back the instance
to the owner process (the passed back instance is
read only), so no need to pass the memory adress
of the owner's mapping, thus not allowing freeing
arbitrary memory.

Further, we now check the memory mapped size against
the size of the underlying ashmem region after we do
the memory mapping (to fix the ahsmem size) and if
an attacker changed the size under us we throw.

Tests: Updated the tests and they pass.

bug:33039926
bug:33042690

Change-Id: Ie267646eb88014034fbd048d7a9bc273420c7eff
2016-12-07 15:19:13 -08:00
Jeff Sharkey
792d49dfb5 DO NOT MERGE. Check provider access for content changes.
am: 91add43ae7

Change-Id: I158a5dab0643fb5d2c07393f0df030e93b3c006a
2016-12-02 18:19:51 +00:00
Jeff Sharkey
7340749c2a DO NOT MERGE: Check provider access for content changes.
am: ff2fede0dd

Change-Id: I7de766d1acc1f20e83f07953dedfe3810f906db8
2016-12-02 18:19:42 +00:00
Jeff Sharkey
6b89229d14 Merge "DO NOT MERGE. Check provider access for content changes." into lmp-mr1-dev 2016-12-02 18:10:16 +00:00
Jeff Sharkey
48f6bdfce4 Merge "DO NOT MERGE: Check provider access for content changes." into mnc-dr-dev 2016-12-02 18:10:14 +00:00
Jeff Sharkey
0be332852e Merge "DO NOT MERGE: Check provider access for content changes." into mnc-dr1.5-dev 2016-12-02 18:10:12 +00:00
Jeff Sharkey
8e14278209 Merge "DO NOT MERGE: Check provider access for content changes." into mnc-dev 2016-12-02 18:10:11 +00:00
Jeff Sharkey
fdef2cd87d Merge "DO NOT MERGE: Check provider access for content changes." into nyc-dev 2016-12-02 18:10:10 +00:00
Jeff Sharkey
b981c3be70 DO NOT MERGE. Retain DownloadManager Uri grants when clearing. am: fbf395c220
am: 2d549764be

Change-Id: Iad255e684d36524388a659181da0535bd15e37dc
2016-12-02 01:01:49 +00:00
Jeff Sharkey
2d549764be DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
am: fbf395c220

Change-Id: I453445723ea9f6124d876dc32c6defab42432351
2016-12-02 00:56:26 +00:00
Jeff Sharkey
b9a0b79675 DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
am: 1de465bec2

Change-Id: I14f82fa9c555bea0e71553713436a6836a421691
2016-12-02 00:50:29 +00:00
Jeff Sharkey
17010dc0d2 DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
As part of fixing a recent security issue, DownloadManager now needs
to issue Uri permission grants for all downloads.  However, if an app
that requested a download is upgraded or otherwise force-stopped,
the required permission grants are removed.

We could tell DownloadManager about the app being stopped, but that
would be racy (due to background broadcast), and waking it up would
degrade system health.  Instead, as a special case we now only
consider clearing DownloadManager permission grants when app data
is being cleared.

Bug: 32172542, 30537115
Test: builds, boots, app upgrade doesn't clear grants
Change-Id: I7e3d4546fd12bfe5f81b9fb9857ece58d574a6b9
(cherry picked from commit 23ec811266)
2016-12-02 00:05:40 +00:00
Jeff Sharkey
1de465bec2 DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
As part of fixing a recent security issue, DownloadManager now needs
to issue Uri permission grants for all downloads.  However, if an app
that requested a download is upgraded or otherwise force-stopped,
the required permission grants are removed.

We could tell DownloadManager about the app being stopped, but that
would be racy (due to background broadcast), and waking it up would
degrade system health.  Instead, as a special case we now only
consider clearing DownloadManager permission grants when app data
is being cleared.

Bug: 32172542, 30537115
Test: builds, boots, app upgrade doesn't clear grants
Change-Id: I7e3d4546fd12bfe5f81b9fb9857ece58d574a6b9
(cherry picked from commit 23ec811266)
2016-12-01 23:54:04 +00:00
Jeff Sharkey
fbf395c220 DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
As part of fixing a recent security issue, DownloadManager now needs
to issue Uri permission grants for all downloads.  However, if an app
that requested a download is upgraded or otherwise force-stopped,
the required permission grants are removed.

We could tell DownloadManager about the app being stopped, but that
would be racy (due to background broadcast), and waking it up would
degrade system health.  Instead, as a special case we now only
consider clearing DownloadManager permission grants when app data
is being cleared.

Bug: 32172542, 30537115
Test: builds, boots, app upgrade doesn't clear grants
Change-Id: I7e3d4546fd12bfe5f81b9fb9857ece58d574a6b9
(cherry picked from commit 23ec811266)
2016-12-01 23:51:25 +00:00
Jeff Sharkey
3b0aa060a3 DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
As part of fixing a recent security issue, DownloadManager now needs
to issue Uri permission grants for all downloads.  However, if an app
that requested a download is upgraded or otherwise force-stopped,
the required permission grants are removed.

We could tell DownloadManager about the app being stopped, but that
would be racy (due to background broadcast), and waking it up would
degrade system health.  Instead, as a special case we now only
consider clearing DownloadManager permission grants when app data
is being cleared.

Bug: 32172542, 30537115
Test: builds, boots, app upgrade doesn't clear grants
Change-Id: I7e3d4546fd12bfe5f81b9fb9857ece58d574a6b9
(cherry picked from commit 23ec811266)
2016-12-01 16:50:29 -07:00
Jeff Sharkey
91add43ae7 DO NOT MERGE. Check provider access for content changes.
For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
2016-11-18 15:37:57 -07:00
Jeff Sharkey
ff2fede0dd DO NOT MERGE: Check provider access for content changes.
For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
2016-11-17 21:02:40 +00:00
Jeff Sharkey
956bc433dc DO NOT MERGE: Check provider access for content changes.
For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
2016-11-17 21:02:38 +00:00
Jeff Sharkey
4ddbf942a0 DO NOT MERGE: Check provider access for content changes.
For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
2016-11-17 21:02:37 +00:00
Jeff Sharkey
11e3e52bd9 DO NOT MERGE: Check provider access for content changes.
For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
2016-11-17 21:01:43 +00:00
Andriy Naborskyy
11da2b5de3 Merge "DO NOT MERGE ANYWHERE Revert "DO NOT MERGE ANYWHERE libhwui: make setSurface asynchronous"" into cw-e-dev 2016-11-12 03:18:55 +00:00
Andriy Naborskyy
c5bf8bc74d DO NOT MERGE ANYWHERE Revert "DO NOT MERGE ANYWHERE libhwui: make setSurface asynchronous"
This reverts commit 80e6d8873b.

Bug: 32771832

Change-Id: Ia2f2ffd08dfd87cbce1ec750d6b61277799b536f
2016-11-10 03:17:08 +00:00
Shuo Gao
1b5d5bd119 DO NOT MERGE ANYWHERE Enable shader cache for applications that shared UID with multiple packages
from AOSP: https://android-review.googlesource.com/#/c/209490/

Frameworks supported a mature mechanism for shader cache per each package already,
but as a special case such as Settings APP, if there are several packages in this
application which means that multiple packages shared the same SharedUserID with it,
it won't initialize the graphics disk caches, thereby APP like Settings have to
rebuild and relink shader every time during launch, which cause a bad launching
performance, so here to enable the GFX and RS cache initialization for multiple
shared packages case too.

Change-Id: If0f927e3399b775804abf1d9a868887951f471c5
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
2016-10-25 18:49:47 -07:00
Thomas Buhot
80e6d8873b DO NOT MERGE ANYWHERE libhwui: make setSurface asynchronous
from AOSP: https://android-review.googlesource.com/#/c/183305/

On the critical path of the cold launch of applications
the main thread of the started application tells the RenderThread
to create a surface. This process is synchronous and blocks
the main thread of the application until the creation
of the EGLContext is complete.
As a consequence the launch time of the application is delayed
by time spent allocating the EGL Context in the RenderThread.

With this optimization the launch time of any application
is improved (for example settings by 20 to 40 ms).

Change-Id: Ibf47aaa0abb8dedf7aa00693073db3785d9d6b08
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
2016-10-25 18:48:50 -07:00
Xin Li
7e0483fcec Merge "Merge "DO NOT MERGE - Added Emergency affordance feature" into
lollipop-mr1-dev" into lmp-mr1-dev.

Change-Id: Ia47211f647d0d49b0adf3cb65eba4b9b686bcbff
2016-10-13 13:54:54 -07:00
Xin Li
ee2903686f Merge "Merge "DO NOT MERGE - Added Emergency affordance feature" into
marshmallow-dev" into mnc-dev.

Change-Id: I7215eebd4a2cc9a4b6ccf2a3e36ed8edc556d208
2016-10-13 13:51:42 -07:00
Xin Li
9b9906e9c0 Merge "Merge "DO NOT MERGE - Added Emergency affordance feature"
into nougat-dev" into nyc-dev.

Change-Id: Iffde36524f2335b90d4887dcdd189eaf55dc60e6
2016-10-13 13:40:33 -07:00
Selim Cinek
cd22634003 DO NOT MERGE - Added Emergency affordance feature
Added a service that listens whether emergency affordances
are necessary.

If the they are needed, it adds an option to the
global actions dialog that directly launches the
emergency call and also adds a long-press listener
to the keyguard emergency button.

Test: adb shell settings put global force_emergency_affordance 1 && adb shell settings put global emergency_affordance_number 111112
Bug: 30404490
Change-Id: Ib96a15da2ef4b568a8d77140ebca6aa6f20f5ddb
2016-10-06 02:15:31 +00:00
Selim Cinek
5fbc86bfd6 DO NOT MERGE - Added Emergency affordance feature
Added a service that listens whether emergency affordances
are necessary.

If the they are needed, it adds an option to the
global actions dialog that directly launches the
emergency call and also adds a long-press listener
to the keyguard emergency button.

Test: adb shell settings put global force_emergency_affordance 1 && adb shell settings put global emergency_affordance_number 111112
Bug: 30404490
Change-Id: Ib96a15da2ef4b568a8d77140ebca6aa6f20f5ddb
2016-10-05 18:40:07 -07:00
Selim Cinek
e6680d93db DO NOT MERGE - Added Emergency affordance feature
Added a service that listens whether emergency affordances
are necessary.

If the they are needed, it adds an option to the
global actions dialog that directly launches the
emergency call and also adds a long-press listener
to the keyguard emergency button.

Test: adb shell settings put global force_emergency_affordance 1 && adb shell settings put global emergency_affordance_number 111112
Bug: 30404490
Change-Id: Ib96a15da2ef4b568a8d77140ebca6aa6f20f5ddb
2016-10-06 01:29:56 +00:00
Hemal Patel
1918214589 Docs: Fixed the Service link
Bug: 29086415
Change-Id: Id9505ade39c19eb817f556d72f689568148e1782
2016-09-30 14:59:23 -07:00
Kevin Hufnagle
ade93296ff Merge "docs: Added min/max values and descriptions for alpha getter/setter in ImageView" into nyc-dev 2016-09-26 22:55:34 +00:00
Kevin Hufnagle
996274a611 Merge "docs: Added note in getCacheDir() that developers can use directory obtained from getExternalCacheDir() to store app caches larger than 1 MB." into nyc-dev 2016-09-26 22:55:00 +00:00
Kevin Hufnagle
4738231a55 Merge "docs: Removed all instances of "i.e." in IntentFilter parameter descriptions." into nyc-dev 2016-09-26 22:54:28 +00:00
Kevin Hufnagle
0b498d6139 Merge "docs: Added note in LayoutTransition class reference that APPEARING and DISAPPEARING animation timelines cannot overlap" into nyc-dev 2016-09-26 22:46:58 +00:00
Kevin Hufnagle
358b289a4d Merge "docs: Clarified definition of KeyEvent.Callback.onKeyMultiple()" into nyc-dev 2016-09-26 22:46:02 +00:00
Kevin Hufnagle
adca055df1 Merge "docs: Fixed example of ACTION_VIEW intent" into nyc-dev 2016-09-26 22:40:15 +00:00
Kevin Hufnagle
91ade06f93 Merge "docs: Adjusted return value desc. for getApplicationEnabledSetting" into nyc-dev 2016-09-26 22:35:27 +00:00
Mark Lu
0a544fa4a7 Merge "docs: improve docs for sqlite package summary" into nyc-dev 2016-09-26 17:12:51 +00:00