202802 Commits

Author SHA1 Message Date
Sungsoo
e5d9dc7eac DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: aebe2347a7 -s ours am: 3af57850a0 am: c17e29076e am: ca88e604e4 -s ours am: 14bc23be74
am: 2418ef1313

Change-Id: I21056ca0c2858c4414fe3c11d70d96b9fb9a8c57
2016-09-09 23:44:57 +00:00
Sungsoo
2418ef1313 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: aebe2347a7 -s ours am: 3af57850a0 am: c17e29076e am: ca88e604e4 -s ours
am: 14bc23be74

Change-Id: I697d8519269bcf82d47a00b9ed236bd285268261
2016-09-09 23:39:52 +00:00
Sungsoo
bf62cbb95e DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 659275dc30 am: 8d3e6bd3ef am: dde94fc477 -s ours am: aa1d75f5e7
am: e9a7225bf2

Change-Id: Ie7fa7ee8d7f4acee388ec76ae1f687c6235c955b
2016-09-09 23:37:47 +00:00
Sungsoo
14bc23be74 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: aebe2347a7 -s ours am: 3af57850a0 am: c17e29076e
am: ca88e604e4  -s ours

Change-Id: Iae1ea19a96fbf9421a24b5682c4b769af95b2660
2016-09-09 23:27:21 +00:00
Sungsoo
ca88e604e4 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: aebe2347a7 -s ours am: 3af57850a0
am: c17e29076e

Change-Id: If6e85c284a811287a9751eb501e50dabe2dfe8b1
2016-09-09 23:08:29 +00:00
Sungsoo
e9a7225bf2 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 659275dc30 am: 8d3e6bd3ef am: dde94fc477 -s ours
am: aa1d75f5e7

Change-Id: Ib06cad762d46ba7577a87ef19c9cfe8f83f7ba0c
2016-09-09 23:08:25 +00:00
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
c17e29076e DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: aebe2347a7 -s ours
am: 3af57850a0

Change-Id: I70f6b639cab68d401d3927c67192d3b89e08eee3
2016-09-09 23:00:21 +00:00
Sungsoo Lim
883a724193 Merge "DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change" into mnc-dev am: 987472290c
am: bcc0e5a7ab

Change-Id: I03932a82253351dd46dee8bdd7e8910bd5862410
2016-09-09 22:55:14 +00:00
Sungsoo
45e14ffec6 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 2ee53c82cc
am: 865bf88813

Change-Id: I1a59ad0872c98a416efa7bfc8800d65c01cea3f8
2016-09-09 22:55:11 +00:00
Sungsoo
3af57850a0 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
am: aebe2347a7  -s ours

Change-Id: I58dd093cb10fd89e44d59867f5a4c1a378a61661
2016-09-09 22:54:32 +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 Lim
bcc0e5a7ab Merge "DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change" into mnc-dev
am: 987472290c

Change-Id: Ida680d7915f1774e1f4b2cf94d38c384d50c0e64
2016-09-09 22:47:09 +00:00
Sungsoo
865bf88813 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
am: 2ee53c82cc

Change-Id: Ifb5d9af5faae122dcd3111a83e69a218bf4e4f3f
2016-09-09 22:47:06 +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
bd6a29cddc Merge "Backport changes to whitelist sockets opened by the zygote." into lmp-mr1-ub-dev am: 00e808b06b am: e59073096e
am: 24ffc9ab47

Change-Id: I78adbdbbf8ffddfee3cd8b1407415cdf3a4d1b1f
2016-09-09 10:33:40 +00:00
Narayan Kamath
24ffc9ab47 Merge "Backport changes to whitelist sockets opened by the zygote." into lmp-mr1-ub-dev am: 00e808b06b
am: e59073096e

Change-Id: Ifb7972c30d70a0fbc4ffdae100aac2d77ca445ca
2016-09-09 10:28:52 +00:00
Narayan Kamath
8cb6b9335c Backport changes to whitelist sockets opened by the zygote. am: 82c6e6267e -s ours am: 646ee94421
am: 8f0cc3dd13

Change-Id: Ida08d48da51f9f49dc70a916fa379cf89a4d33c0
2016-09-09 10:28:46 +00:00
Narayan Kamath
8f0cc3dd13 Backport changes to whitelist sockets opened by the zygote. am: 82c6e6267e -s ours
am: 646ee94421

Change-Id: I62f6556e630707274daa4ee0a4a57c77f5329bbc
2016-09-09 10:21:48 +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
71e6a6f12a Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dev am: 014016cf32
am: 447d3798f1

Change-Id: I323c669ed44e10f9e3a91271f47800754da5d389
2016-09-08 08:40:03 +00:00
Narayan Kamath
c6ced086d1 Backport changes to whitelist sockets opened by the zygote. am: 0f6a0e1560 -s ours
am: 6fa8339792

Change-Id: Id7ad55a251a26782815005218dc186b53e74cfca
2016-09-08 08:33:40 +00:00
Narayan Kamath
447d3798f1 Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dev
am: 014016cf32

Change-Id: Ic0cf8b5cc2accaad552b82eaadce359e21e5e624
2016-09-08 08:30:41 +00:00
Narayan Kamath
47b88a15f6 Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dr-dev
am: 459810b9b7

Change-Id: I867a7c97c8363ede1b04e4ea8a75045d36d9d58d
2016-09-08 08:24:54 +00:00
Narayan Kamath
49d992fdb0 Backport changes to whitelist sockets opened by the zygote.
am: 41ca1bce01

Change-Id: Id08676457fa3fa022d607e5de754f49b9c396261
2016-09-08 08:24:47 +00:00
Narayan Kamath
6fa8339792 Backport changes to whitelist sockets opened by the zygote.
am: 0f6a0e1560  -s ours

Change-Id: I2cdd131b750b4d04672149dcf7a90d2d566dd621
2016-09-08 08:23:49 +00:00
Narayan Kamath
459810b9b7 Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dr-dev 2016-09-08 08:20:58 +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
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
Narayan Kamath
82c6e6267e 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++).

(cherry picked from commit 7ec85f9d549971af59f047d5eafd7a829e1541c7)

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

Change-Id: Iec55904ecb004d3bf89bf3a065e5811afae798d6
2016-09-07 20:17:02 +00:00
Narayan Kamath
36b90a1934 Backport changes to whitelist sockets opened by the zygote. am: 7ec85f9d54 am: f7b9f84f87 am: 9a409265fc -s ours am: 9802fcfa2b
am: 2acf9f7e3c

Change-Id: Ideae7875e299ec0292054aad85fe8aa92b6aba9b
2016-09-07 20:12:43 +00: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
41ca1bce01 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:
-----------------------------------------------
- add /dev/__properties__ to the whitelist.

Change-Id: I709a7f4913e807a8fec8a58c81e98fe5b5222820
2016-09-07 19:06:04 +01:00
Narayan Kamath
0f6a0e1560 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:
-----------------------------------------------
- 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 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
Sudheer Shanka
203d1bee25 resolve merge conflicts of 270947f to klp-modular-dev am: 76c4b2a7b6 -s ours am: bbbb514bc9 am: 6a50270944 am: a0994c6d58 am: cdf70ba0a3 am: c2a760e68c
am: 77dec89bb3

Change-Id: I1d755ef86b80f723c3fde59476e0018167fbf8b7
2016-08-25 23:22:19 +00:00
Sudheer Shanka
c35a9fed39 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 am: 603a69ffb4
am: 97194798ab

Change-Id: If4a1716de3d54d6a08025665cdff51edc1b2f6da
2016-08-25 23:22:14 +00:00
Amith Yamasani
f6361752ca 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 am: 9080d4462e
am: 75c7391a41

Change-Id: I2646c10763640e6079e09e6fd53b9958b3aba2ea
2016-08-25 23:22:10 +00:00
Sudheer Shanka
2f664374fa 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 am: 86ac88ccdb
am: 2490679d7e

Change-Id: I59f3ace3a9c72a6d2fe1e1bd4cadec102a8c6254
2016-08-25 23:22:04 +00:00
Amith Yamasani
5eed3c9c38 DO NOT MERGE: Clean up when recycling a pid with a pending launch am: b02862c2cf am: dd0be992c0 am: 117a383099 -s ours am: 368ae62e9d
am: 1d513c845a

Change-Id: If920208b052d41a80d3a0bf70af831313c9b9c06
2016-08-25 23:22:00 +00:00
Sudheer Shanka
77dec89bb3 resolve merge conflicts of 270947f to klp-modular-dev am: 76c4b2a7b6 -s ours am: bbbb514bc9 am: 6a50270944 am: a0994c6d58 am: cdf70ba0a3
am: c2a760e68c

Change-Id: I2e5a3bb037921013e78b4270d843cebe239ac520
2016-08-25 23:14:09 +00:00