153963 Commits

Author SHA1 Message Date
Sudheer Shanka
d1e3e53d79 Merge "DO NOT MERGE: Fix deadlock in AcitivityManagerService." into klp-dev 2016-09-19 19:59:22 +00:00
Paul Jensen
3532f10fcb Merge "Avoid crashing when downloading MitM'd PAC that is too big" into klp-dev am: 96c045807b am: 7c08c4d5cc
am: 963ca6f947

Change-Id: I1a509c39640e7f9d76bd2e420764aeb3d823a3df
2016-09-19 11:34:00 +00:00
Paul Jensen
66ee2296a9 Avoid crashing when downloading MitM'd PAC that is too big am: 7d2198b586 am: 9c1cb7a273
am: 6634e90ad7

Change-Id: Id46b32b80d47f6b7e2bfab2740978377a6b711cf
2016-09-19 11:31:54 +00:00
Paul Jensen
963ca6f947 Merge "Avoid crashing when downloading MitM'd PAC that is too big" into klp-dev am: 96c045807b
am: 7c08c4d5cc

Change-Id: Idd0a3598ffac808a39703a23238b47a02bca66ed
2016-09-19 11:27:47 +00:00
Paul Jensen
6634e90ad7 Avoid crashing when downloading MitM'd PAC that is too big am: 7d2198b586
am: 9c1cb7a273

Change-Id: I8cd4b0d33da22bc29abd176672659c3eeb8c7d5b
2016-09-19 11:25:21 +00:00
Paul Jensen
7c08c4d5cc Merge "Avoid crashing when downloading MitM'd PAC that is too big" into klp-dev
am: 96c045807b

Change-Id: Ia20ba679f7b0445567b43aa74eef27f751453d4e
2016-09-19 11:19:16 +00:00
Paul Jensen
9c1cb7a273 Avoid crashing when downloading MitM'd PAC that is too big
am: 7d2198b586

Change-Id: I512d6f9de6a92dd3cabec93bcadf437f5cf2e16d
2016-09-19 11:19:13 +00:00
Paul Jensen
96c045807b Merge "Avoid crashing when downloading MitM'd PAC that is too big" into klp-dev 2016-09-19 11:11:06 +00:00
Tadashi G. Takaoka
2578264b86 DO NOT MERGE: Catch all exceptions when parsing IME meta data am: f71d2cddf1 am: 57454cf15e
am: 29f2e1d93a  -s ours

Change-Id: Iaed8d1cc6e6a6bf00a9602ebb829d008f8c4e56e
2016-09-18 12:22:55 +00:00
Tadashi G. Takaoka
29f2e1d93a DO NOT MERGE: Catch all exceptions when parsing IME meta data am: f71d2cddf1
am: 57454cf15e

Change-Id: I2620580fca624c6ab4520f0a31c42cef42bafa01
2016-09-18 12:17:17 +00:00
Tadashi G. Takaoka
57454cf15e DO NOT MERGE: Catch all exceptions when parsing IME meta data
am: f71d2cddf1

Change-Id: Iaa5041d4b5fc61860f7ce95ecce60d39bbd5023b
2016-09-18 12:03:59 +00:00
Tadashi G. Takaoka
5fa097311c Merge "DO NOT MERGE: Catch all exceptions when parsing IME meta data" into lmp-dev 2016-09-18 11:55:34 +00:00
Jeff Sharkey
1547194418 Use "all_downloads" instead of "my_downloads".
We can no longer return the "my_downloads" paths: if those Uris were
shared beyond the app that requested the download, access would be
denied.  Instead, we need to switch to using "all_downloads" Uris so
that permission grants can be issued to third-party viewer apps.

Since an app requesting a download doesn't normally have permission
to "all_downloads" paths, DownloadProvider now issues narrow grants
toward the owner of each download, both at device boot and when new
downloads are started.

Bug: 30537115, 30945409
Change-Id: I533125b36444877f54373d88922f2acc777e250b
2016-09-16 12:04:05 -06:00
Tadashi G. Takaoka
c6fc6c3b55 DO NOT MERGE: Catch all exceptions when parsing IME meta data
Bug: 30568284
Change-Id: I0b613f8ce0f014320c5ac1bf445699ea2702a0a2
(manually cherry picked from 9b2997d22e6ce2a15065d8e7608dd77b316c2065)
2016-09-16 13:57:05 +09:00
Tadashi G. Takaoka
f71d2cddf1 DO NOT MERGE: Catch all exceptions when parsing IME meta data
Bug: 30568284
Change-Id: I0b613f8ce0f014320c5ac1bf445699ea2702a0a2
(manually cherry picked from 9b2997d22e6ce2a15065d8e7608dd77b316c2065)
2016-09-16 13:51:43 +09:00
Sudheer Shanka
dce4be63bb DO NOT MERGE: Fix deadlock in AcitivityManagerService.
Don't hold mPidsSelfLocked lock when calling
cleanUpApplicationRecordLocked.

Bug: 31463143
Change-Id: I1fddd06f5e35b67fea041741f5746c57a39208ba
2016-09-15 19:00:43 -07:00
Sudheer Shanka
2d608378f4 DO NOT MERGE: Fix deadlock in AcitivityManagerService.
Don't hold mPidsSelfLocked lock when calling
cleanUpApplicationRecordLocked.

Bug: 31463143
Change-Id: I421962cbfd7c466662edcef805c3e27321dc5a98
2016-09-15 17:59:52 -07:00
Ajay Panicker
786e2694b1 [DO NOT MERGE] Prevent FDs from being leaked when accepted sockets are closed
Bug: 28672558
Change-Id: I4bc14bd7f098e34012c2ae1eeba2d439145901f0
2016-09-13 21:09:44 +00:00
Sungsoo
f495cf6944 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 1bdd10a953 am: b336cce830
am: d07324fe85  -s ours

Change-Id: Ie3049cea7663d06632b0e3139f30f01e7dba5df0
2016-09-09 23:00:35 +00:00
Sungsoo
d07324fe85 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 1bdd10a953
am: b336cce830

Change-Id: Ib90b72ce9abefc6a7ceab1070555ded45dc8567d
2016-09-09 22:54:12 +00:00
Sungsoo
b336cce830 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
am: 1bdd10a953

Change-Id: I644f8187ed6f5957fc273b98c10ed0c602ed1879
2016-09-09 22:46:23 +00:00
Ajay Panicker
27b3d578b9 [DO NOT MERGE] Prevent FDs from being leaked when accepted sockets are closed
Bug: 28672558
Change-Id: I4bc14bd7f098e34012c2ae1eeba2d439145901f0
2016-09-08 13:23:02 -07:00
Ajay Panicker
0ea21bc70e [DO NOT MERGE] Fix setPairingConfirmation permissions issue (2/2)
setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: Iddc935f0b02f5ff56e930914b4b664377e786184
2016-09-08 18:03:58 +00:00
Ajay Panicker
edae39d59a [DO NOT MERGE] Fix setPairingConfirmation permissions issue (2/2)
setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: Iddc935f0b02f5ff56e930914b4b664377e786184
2016-09-08 11:01:29 -07:00
Sungsoo
aebe2347a7 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
ExifInterface object can be created with a unsupported file format.
If saveAttribute is called with an unsupported file format, ExifInterface
makes the file corrupted. This CL prevents those cases by throwing
an exception before making any change on the file.

Bug: 30936376
Change-Id: I915f56b00ec9422b53591ac5534e070a1d6798e6
2016-09-08 07:10:26 +00:00
Sungsoo
1bdd10a953 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
ExifInterface object can be created with a unsupported file format.
If saveAttribute is called with an unsupported file format, ExifInterface
makes the file corrupted. This CL prevents those cases by throwing
an exception before making any change on the file.

Bug: 30936376
Change-Id: I915f56b00ec9422b53591ac5534e070a1d6798e6
2016-09-08 16:04:44 +09:00
Narayan Kamath
7ec85f9d54 Backport changes to whitelist sockets opened by the zygote.
This is the backport of the following commits :

Commit c5f27a7cb2ec816f483a65255034a1b57a8aa22:
-----------------------------------------------

Reopen whitelisted zygote file descriptors after a fork.

We don't want these descriptors to be shared post-fork, so we'll
have to close and reopen them when the zygote forks. The set of
open descriptors is checked against a whitelist and it is a fatal
error if a non whitelisted FD is opened. It is also a fatal error
if anything other than a regular file / character device or socket
is opened at the time of forking.

This work is done in two stages :
- An initial list of FDs is constructed and cached prior to the
  first zygote fork.

- On each subsequent fork, we check whether the list of open FDs
  has changed. We are currently tolerant of changes, but in the
  longer term, it should be a fatal error if the set of open file
  descriptors in the zygote changes.

- Post fork, we traverse the list of open descriptors and reopen
  them if necessary.

bug: 30963384

Commit 3764a260f0c90dcb323caeda14baf903cc108759:
-----------------------------------------------

Add a whitelist of sockets on fork.

Maintain a whitelist of AF_UNIX sockets that are permitted
to exist at the time of forking. If an open socket does not belong
to the whitelist (or is not AF_UNIX), the process will abort. If an
open socket is whitelisted, it will be redirected to /dev/null after
a sucessful fork. This allows us to unify our handling of the special
zygote sockets (/dev/socket/zygote[_secondary]) with the existing
whitelist of non socket file descriptors.

This change also removes non-fatal ALOGW messages since they have the
side effect of reopening the logging socket.

bug: 30963384

Commit 0b76d6a28e6978151bf245a775329cdae5e574d5:
-----------------------------------------------
fd_utils: Fix broken usage of iterators.

There were two separate issues here :
- RestatInternal was using an iterator after a call to erase(). This
  will not work because it will be invalidated.
- The "standard" for loop idiom for iterating over a map while making
  structural changes to it is broken. Switch to a while loop and treat
  cases where elements are erased differently from cases where they
  aren't.

bug: 31092930
bug: 30963384

Plus additional changes:
-----------------------------------------------
- change std::unordered_map to std::tr1::unordered_map.
- add /dev/alarm and /dev/__properties__ to the whitelist.
- map.erase(iterator) returns void prior to C++11, so need the kludge
  of calling erase(it++).

Change-Id: I694ff66d5f227239b0190ffc2287882b16e336fa
2016-09-07 18:48:48 +01:00
Paul Jensen
7d2198b586 Avoid crashing when downloading MitM'd PAC that is too big
There's two pieces to this fix:
1. Move PAC loading off IoThread which isn't meant for
   blocking network fetches.  If the fetch takes more than
   60s Android reboots when the IoThread is used.
2. Limit PAC fetching to 20MB.  Any PAC bigger than that
   is likely evil.
MitM of PACs should only be possbile when a non-SSL PAC URL
is used.

Change-Id: Ie1658a1c705615dc85a7fc68053f0dad8d048294
Fixes: 30100884
2016-08-25 02:09:37 +00:00
Sudheer Shanka
b31a6955a4 DO NOT MERGE: Clean up when recycling a pid with a pending launch am: a3af5c6207 am: 21ef672cab
am: e0d1ff1c42  -s ours

Change-Id: I8a1464443e84bb7987235d25ad40ae01386d72ef
2016-08-22 22:19:10 +00:00
Sudheer Shanka
bbbb514bc9 resolve merge conflicts of 270947f to klp-modular-dev
am: 76c4b2a7b6  -s ours

Change-Id: Icdcd0929eb7bd32665e91fe2598af46db3ff01bd
2016-08-22 22:19:06 +00:00
Sudheer Shanka
e0d1ff1c42 DO NOT MERGE: Clean up when recycling a pid with a pending launch am: a3af5c6207
am: 21ef672cab

Change-Id: Ia073a40c330038e77ff5992c056a8fe0a5924edb
2016-08-22 22:11:52 +00:00
Sudheer Shanka
76c4b2a7b6 resolve merge conflicts of 270947f to klp-modular-dev
Change-Id: I703a7f8eb0897e518c3df9e8c7efa19508611a47
2016-08-19 11:37:22 -07:00
Sudheer Shanka
21ef672cab Merge "DO NOT MERGE: Clean up when recycling a pid with a pending launch" into klp-dev
am: de04301f9a

Change-Id: I1d04889e2227d0a9a6b86b44ce38cdc5763dfac0
2016-08-19 17:46:12 +00:00
Sudheer Shanka
270947f78c DO NOT MERGE: Clean up when recycling a pid with a pending launch
am: a3af5c6207

Change-Id: Ibdd69f2fa346dc31224fa6357718f56aa26ded1d
2016-08-19 17:32:01 +00:00
Sudheer Shanka
de04301f9a Merge "DO NOT MERGE: Clean up when recycling a pid with a pending launch" into klp-dev 2016-08-19 17:07:06 +00:00
Sudheer Shanka
96052ea905 Merge "DO NOT MERGE: Clean up when recycling a pid with a pending launch" into lmp-dev 2016-08-19 17:06:58 +00:00
Narayan Kamath
efab128e67 Merge "Process: Fix communication with zygote." into klp-dev am: 6829cf28e2 am: 8fdee85e87
am: 4cf5241f47

Change-Id: Ibd736c16c8af9397e774c5abb917a9a3d31681a0
2016-08-18 10:19:28 +00:00
Narayan Kamath
2984748753 Process: Fix communication with zygote. am: 8e69dd2284 am: b85e9e9108
am: b56f4f53e1  -s ours

Change-Id: I67e1ff67c88d8c70a9d6d0698c857be77f09f534
2016-08-18 10:16:48 +00:00
Narayan Kamath
4cf5241f47 Merge "Process: Fix communication with zygote." into klp-dev am: 6829cf28e2
am: 8fdee85e87

Change-Id: I654191bebb88a8005e9f46ad8b8b1f932214b3c9
2016-08-18 09:56:29 +00:00
Narayan Kamath
b56f4f53e1 Process: Fix communication with zygote. am: 8e69dd2284
am: b85e9e9108

Change-Id: Ie4874c088e05f4f5bc2073661010d413e60b3f7b
2016-08-18 09:56:24 +00:00
Narayan Kamath
8fdee85e87 Merge "Process: Fix communication with zygote." into klp-dev
am: 6829cf28e2

Change-Id: I740364ba90a8d1f14a5b2d2aacfe44948a4583d2
2016-08-18 09:50:56 +00:00
Narayan Kamath
b85e9e9108 Process: Fix communication with zygote.
am: 8e69dd2284

Change-Id: I3860d3f66e256a6446df5d8ce20f752d1c002e0f
2016-08-18 09:50:52 +00:00
Narayan Kamath
6829cf28e2 Merge "Process: Fix communication with zygote." into klp-dev 2016-08-18 09:46:18 +00:00
Narayan Kamath
8e69dd2284 Process: Fix communication with zygote.
Don't write partial requests, and don't return (or throw) early after
partially reading a response.

bug: 30143607

(cherry-picked from commit 448be0a62209c977593d81617853a8a428d013df)

Change-Id: I5881fdd5e81023cd21fb4d23a471a5031987a1f1
2016-08-16 17:21:49 +01:00
Narayan Kamath
e29c6493c0 Process: Fix communication with zygote.
Don't write partial requests, and don't return (or throw) early after
partially reading a response.

bug: 30143607

(cherry-picked from commit 448be0a62209c977593d81617853a8a428d013df)

Change-Id: I5881fdd5e81023cd21fb4d23a471a5031987a1f1
2016-08-16 16:17:29 +00:00
Sudheer Shanka
a3af5c6207 DO NOT MERGE: Clean up when recycling a pid with a pending launch
Fix for accidental launch of a broadcast receiver in an
incorrect app instance.

Bug: 30202481
Change-Id: I84b74edc29ca3fb88048b44af682ecbeb176b774
2016-08-12 18:49:56 -07:00
Amith Yamasani
a92810a189 DO NOT MERGE: Clean up when recycling a pid with a pending launch
Fix for accidental launch of a broadcast receiver in an
incorrect app instance.

Bug: 30202481
Change-Id: I8ec8f19c633f3aec8da084dab5fd5b312443336f
2016-08-12 18:28:45 -07:00
David Christie
655361b2b1 Fix vulnerability where large GPS XTRA data can be injected. -Can potentially crash system with OOM. Bug: 29555864 am: dde12c6923 am: 3462e52676
am: 5a6b11114a

Change-Id: Ie2c2290014481772cf10c5f9e4fc565bf06e74a3
2016-08-12 19:56:57 +00:00
David Christie
288166cbb2 resolve merge conflicts of b4a5615 to lmp-dev
Change-Id: I1b9ebc398226ead9d7f494c4ac56a7b1d9d6586f
2016-08-11 13:06:08 -07:00
David Christie
5a6b11114a Merge "Fix vulnerability where large GPS XTRA data can be injected. -Can potentially crash system with OOM. Bug: 29555864" into klp-dev am: df7bd91dfa
am: b9fe170c6a

Change-Id: I3e320844622617d9ae63fea4cc3a34f9f0e1e93a
2016-08-11 18:33:18 +00:00