Commit Graph

199116 Commits

Author SHA1 Message Date
Sungsoo
aa1d75f5e7 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 659275dc30 am: 8d3e6bd3ef
am: dde94fc477  -s ours

Change-Id: I301706cbdc5fd2ca56eb671891e55fd31dfa469a
2016-09-09 23:01:41 +00:00
Sungsoo
dde94fc477 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 659275dc30
am: 8d3e6bd3ef

Change-Id: I83f7733039ee73407aa5d7f3848ad1074e9dfb03
2016-09-09 22:54:28 +00:00
Sungsoo
8d3e6bd3ef DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
am: 659275dc30

Change-Id: I385c86e9753f1c99201a4f32b3c8b840da51376e
2016-09-09 22:46:44 +00:00
Sungsoo Lim
987472290c Merge "DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change" into mnc-dev 2016-09-09 22:39:08 +00:00
Narayan Kamath
e59073096e Merge "Backport changes to whitelist sockets opened by the zygote." into lmp-mr1-ub-dev
am: 00e808b06b

Change-Id: I14939b5bf04ba47229e663b2ffc50543c5c6bc9a
2016-09-09 10:18:19 +00:00
Narayan Kamath
646ee94421 Backport changes to whitelist sockets opened by the zygote.
am: 82c6e6267e  -s ours

Change-Id: Ib35b2567f19aff39d285794951cf9b8cb8d74ef1
2016-09-09 10:15:11 +00:00
Narayan Kamath
00e808b06b Merge "Backport changes to whitelist sockets opened by the zygote." into lmp-mr1-ub-dev 2016-09-09 10:05:46 +00:00
Narayan Kamath
014016cf32 Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dev 2016-09-08 08:12:20 +00:00
Sungsoo
2ee53c82cc 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:57:56 +00:00
Sungsoo
659275dc30 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:11:04 +00:00
Narayan Kamath
82c6e6267e Backport changes to whitelist sockets opened by the zygote.
This is the backport of the following commits :

Commit c5f27a7cb2:
-----------------------------------------------

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 3764a260f0:
-----------------------------------------------

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 0b76d6a28e:
-----------------------------------------------
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++).

(cherry picked from commit 7ec85f9d54)

Change-Id: If44dc64275d753553233b78a05d41df9d5bfdc36
2016-09-07 21:22:59 +01:00
Narayan Kamath
2acf9f7e3c Backport changes to whitelist sockets opened by the zygote. am: 7ec85f9d54 am: f7b9f84f87 am: 9a409265fc -s ours
am: 9802fcfa2b

Change-Id: Iabeefa7d07d78002c124ce62dc210111b83a99b7
2016-09-07 20:07:58 +00:00
Narayan Kamath
9802fcfa2b Backport changes to whitelist sockets opened by the zygote. am: 7ec85f9d54 am: f7b9f84f87
am: 9a409265fc  -s ours

Change-Id: Idf4dcc5ab7e8b0510848cbd2f220fe7a8e4b3e04
2016-09-07 20:01:56 +00:00
Narayan Kamath
9a409265fc Backport changes to whitelist sockets opened by the zygote. am: 7ec85f9d54
am: f7b9f84f87

Change-Id: I317cecff389f30c5d47e4adee1afafbde8d9d23d
2016-09-07 18:58:41 +00:00
Narayan Kamath
f7b9f84f87 Backport changes to whitelist sockets opened by the zygote.
am: 7ec85f9d54

Change-Id: I6db56b5b06636201382f6d908297644183253c0b
2016-09-07 18:53:40 +00:00
Narayan Kamath
0f6a0e1560 Backport changes to whitelist sockets opened by the zygote.
This is the backport of the following commits :

Commit c5f27a7cb2:
-----------------------------------------------

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 3764a260f0:
-----------------------------------------------

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 0b76d6a28e:
-----------------------------------------------

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:
-----------------------------------------------
- add /dev/__properties__ to the whitelist.

Change-Id: Ic512be6362c3c5d84767e933884872b7e995dfea
2016-09-07 18:52:50 +01:00
Narayan Kamath
7ec85f9d54 Backport changes to whitelist sockets opened by the zygote.
This is the backport of the following commits :

Commit c5f27a7cb2:
-----------------------------------------------

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 3764a260f0:
-----------------------------------------------

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 0b76d6a28e:
-----------------------------------------------
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
Sudheer Shanka
c2a760e68c resolve merge conflicts of 270947f to klp-modular-dev am: 76c4b2a7b6 -s ours am: bbbb514bc9 am: 6a50270944 am: a0994c6d58
am: cdf70ba0a3

Change-Id: Ia7c597b1b96e65cce89396a6b509a796bb17bc2c
2016-08-25 23:07:56 +00:00
Sudheer Shanka
603a69ffb4 Merge "DO NOT MERGE: Clean up when recycling a pid with a pending launch" into lmp-dev am: 96052ea905 -s ours am: f368bdee06 am: f21534a288
am: dfc2d0a4bc  -s ours

Change-Id: Ia4a5952bc4fda5be8602708215ff1d72a5db297a
2016-08-25 23:07:53 +00:00
Amith Yamasani
9080d4462e DO NOT MERGE: Clean up when recycling a pid with a pending launch am: a92810a189 -s ours am: 9be12f8986 am: 03b0f5c3ec
am: 7b8140652b  -s ours

Change-Id: I40d855d0f87483a6a8733475b490ddf6ee582433
2016-08-25 23:07:51 +00:00
Sudheer Shanka
86ac88ccdb Merge "DO NOT MERGE: Clean up when recycling a pid with a pending launch" into lmp-mr1-dev am: 5e55214ab7 am: c8aedeeaf6
am: 26bb7bf86c  -s ours

Change-Id: Id2ddb640c8d041f13a78c5f07fb1749968618b61
2016-08-25 23:07:49 +00:00
Amith Yamasani
368ae62e9d DO NOT MERGE: Clean up when recycling a pid with a pending launch am: b02862c2cf am: dd0be992c0
am: 117a383099  -s ours

Change-Id: I8173ba5c3156a6294d672db63c4a310b0c880cfb
2016-08-25 23:07:46 +00:00
Narayan Kamath
1fbc4b8624 resolve merge conflicts of 5191225 to mnc-dev
Change-Id: I8dd276f61e77b0fe2d861f4b0d34d76bf533192f
2016-08-25 10:43:25 +01:00
Narayan Kamath
c01db7dca3 Process: Fix communication with zygote. am: e29c6493c0 am: 1bd43c162f am: 3c63bb367f
am: c11e8fcc04

Change-Id: Idd314c1e12919d8cbaf9e71d72519d34d18e6f01
2016-08-24 22:14:36 +00:00
David Christie
3970ee98f7 Fix vulnerability where large GPS XTRA data can be injected. -Can potentially crash system with OOM. Bug: 29555864 am: dde12c6923 am: 3462e52676 am: 5a6b11114a am: 655361b2b1 am: 62783bde30 am: 8788a2413c
am: c6ab92e93b

Change-Id: I0d17aacc1d83b2bceb9abcfa3da1f1ff3dc74e09
2016-08-24 22:14:32 +00:00
David Christie
d610363a48 resolve merge conflicts of b4a5615 to lmp-dev am: 288166cbb2 am: b7f8b59e24 am: 41a0dd41f1
am: af369f6e66

Change-Id: I6973f8f1053644548062b94c1696c123f47f0ad4
2016-08-24 22:14:28 +00:00
David Christie
dd1016c619 resolve merge conflicts of 1081a15 to lmp-mr1-ub-dev
am: 975879a18d

Change-Id: Icf81e5ce2bc02750d66b13feedfc098dd9374167
2016-08-24 22:14:24 +00:00
David Christie
6195acc2b5 resolve merge conflicts of a2399b4 to mnc-dev
Change-Id: Ifc9e13cdb047ef70799ba8b1b9e91357ef5f2d2a
2016-08-24 13:47:57 -07:00
Sudheer Shanka
cdf70ba0a3 resolve merge conflicts of 270947f to klp-modular-dev am: 76c4b2a7b6 -s ours am: bbbb514bc9 am: 6a50270944
am: a0994c6d58

Change-Id: I50cb41c74c4d049390155fc0981f6609673febd0
2016-08-24 20:38:40 +00:00
Sudheer Shanka
dfc2d0a4bc Merge "DO NOT MERGE: Clean up when recycling a pid with a pending launch" into lmp-dev am: 96052ea905 -s ours am: f368bdee06
am: f21534a288

Change-Id: I4e5a6b4eb30dde276a1293e986398a8dba21ef05
2016-08-24 20:38:30 +00:00
Amith Yamasani
7b8140652b DO NOT MERGE: Clean up when recycling a pid with a pending launch am: a92810a189 -s ours am: 9be12f8986
am: 03b0f5c3ec

Change-Id: Ic8565bef0bbd034c4d54eff428731809b29ee0c3
2016-08-24 20:38:20 +00:00
Sudheer Shanka
26bb7bf86c Merge "DO NOT MERGE: Clean up when recycling a pid with a pending launch" into lmp-mr1-dev am: 5e55214ab7
am: c8aedeeaf6

Change-Id: Id8f62a0c41004aa713d61a87f59e7ee1eff4ee0a
2016-08-24 20:38:16 +00:00
Amith Yamasani
117a383099 DO NOT MERGE: Clean up when recycling a pid with a pending launch am: b02862c2cf
am: dd0be992c0

Change-Id: I93958d0b8cf2d7a79af4ff534209848f3b0e35c2
2016-08-24 20:38:12 +00:00
Narayan Kamath
5191225400 Merge "Process: Fix communication with zygote." into klp-dev am: 6829cf28e2 am: 8fdee85e87 am: 4cf5241f47 am: efab128e67 am: 86437ec433
am: 4d7740907e

Change-Id: If0e46bb3e4fd182a46b714e0e9140deac8fc470e
2016-08-24 20:30:21 +00:00
Narayan Kamath
c11e8fcc04 Process: Fix communication with zygote. am: 8e69dd2284 am: b85e9e9108 am: b56f4f53e1 -s ours am: 2984748753 am: b9fae65605
am: c6c7ca0cde

Change-Id: Ifca9f825dac758c653560c41b81a13bd13c9fd4c
2016-08-24 20:30:13 +00:00
Narayan Kamath
c6ab92e93b Process: Fix communication with zygote. am: e29c6493c0 am: 1bd43c162f
am: 3c63bb367f

Change-Id: Iaa5ba9f3fcc28da14b60dc489e49bd177d2bfcb3
2016-08-24 20:30:09 +00:00
David Christie
af369f6e66 Fix vulnerability where large GPS XTRA data can be injected. -Can potentially crash system with OOM. Bug: 29555864 am: dde12c6923 am: 3462e52676 am: 5a6b11114a am: 655361b2b1 am: 62783bde30
am: 8788a2413c

Change-Id: If9d5385d7d949e85932e5586d4884ffe84d51d47
2016-08-24 20:30:06 +00:00
David Christie
975879a18d resolve merge conflicts of b4a5615 to lmp-dev am: 288166cbb2 am: b7f8b59e24
am: 41a0dd41f1

Change-Id: Ib74b0efa9b9345257d2b3ba59911baa324ec5801
2016-08-24 20:30:01 +00:00
David Christie
a2399b45e2 resolve merge conflicts of 1081a15 to lmp-mr1-ub-dev
Change-Id: Ic44c577ef364bf81dd1e30b50c71718d4910eb10
2016-08-23 16:19:51 -07:00
Sudheer Shanka
a0994c6d58 DO NOT MERGE: Clean up when recycling a pid with a pending launch am: a3af5c6207 am: 21ef672cab am: e0d1ff1c42 -s ours am: b31a6955a4 -s ours
am: 52d0f48f80

Change-Id: I01d36d2e160c3e33e3f2701843d768b5f581af1b
2016-08-22 22:38:23 +00:00
Sudheer Shanka
52d0f48f80 DO NOT MERGE: Clean up when recycling a pid with a pending launch am: a3af5c6207 am: 21ef672cab am: e0d1ff1c42 -s ours
am: b31a6955a4  -s ours

Change-Id: I6fb134e75355bc1fdcc2dd9a21b51802575c28f3
2016-08-22 22:33:15 +00:00
Sudheer Shanka
f21534a288 resolve merge conflicts of 270947f to klp-modular-dev am: 76c4b2a7b6 -s ours am: bbbb514bc9
am: 6a50270944

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

Change-Id: I47bfb18ce300e52a092da534b8aac720f0b8aa3f
2016-08-22 22:28:24 +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
03b0f5c3ec Merge "DO NOT MERGE: Clean up when recycling a pid with a pending launch" into lmp-dev am: 96052ea905 -s ours
am: f368bdee06

Change-Id: I56d187b0466e674e423754818ba51ca0cdd61a3c
2016-08-19 18:01:17 +00: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