246342 Commits

Author SHA1 Message Date
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
Cheryl Potter
8a7947b0d6 Merge "docs: Define card data for GPU Debugger b/31318053" into nyc-dev 2016-09-09 01:15:54 +00:00
smain@google.com
b433d73843 update Cloud Test Lab guide for Firebase / Studio 2.2.
Originally written by Aaron Carey.
bug: 30400568

Change-Id: I49132b33b388f1aeca0d286fc589940a4a6e3098
2016-09-08 16:55:05 -07:00
Vladislav Kaznacheev
048f3bfaf0 Update JavaDoc for DragEvent.getLocalState
Explicitly state that "local state" is local to the window
which has started the drag operation.

Bug: 31372686
Change-Id: Idbea7586c4e74097362067fa90390b97744181bb
2016-09-08 16:37:23 -07:00
Andrew Solovay
de40f9d677 Merge "docs: Fixing links to moved Fragments guide, + redirect" into nyc-dev 2016-09-08 17:36:49 +00:00
Narayan Kamath
b126d7c7c5 Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dev am: 014016cf32 am: 447d3798f1 am: 71e6a6f12a
am: 177ee386b9

Change-Id: Ic7a1d8c1ba996024b02915e431f2b7aacc306225
2016-09-08 09:05:08 +00:00
Narayan Kamath
5556367bc1 Backport changes to whitelist sockets opened by the zygote. am: 0f6a0e1560 -s ours am: 6fa8339792 am: c6ced086d1
am: 4474da7b7c

Change-Id: Ie14b0e7887bd2da5c986b077f4563bbc306c88be
2016-09-08 08:48:39 +00:00
Narayan Kamath
45d7b8dd2a Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dr-dev am: 459810b9b7 am: 47b88a15f6
am: 7a0c7ab520

Change-Id: I0ed385ab13ca461c1b77226d3be3cf788a09d3d6
2016-09-08 08:48:31 +00:00
Narayan Kamath
177ee386b9 Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dev am: 014016cf32 am: 447d3798f1
am: 71e6a6f12a

Change-Id: Ib162897a1428ab8c025a414eb0a3872327274f7a
2016-09-08 08:45:47 +00:00
Narayan Kamath
bf16d345a6 Backport changes to whitelist sockets opened by the zygote. am: 41ca1bce01 am: 49d992fdb0
am: 67c4adb5c1  -s ours

Change-Id: I2af50f6d32be035f491df4a0b83489ba7da186e7
2016-09-08 08:44:31 +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
4474da7b7c Backport changes to whitelist sockets opened by the zygote. am: 0f6a0e1560 -s ours am: 6fa8339792
am: c6ced086d1

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

Change-Id: Id267e22508824d569f54068291304584b3343b9a
2016-09-08 08:35:04 +00:00
Narayan Kamath
67c4adb5c1 Backport changes to whitelist sockets opened by the zygote. am: 41ca1bce01
am: 49d992fdb0

Change-Id: I0560d831235bd7ba3ea764b23e64b4e08110d7e5
2016-09-08 08:34:58 +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
56ea7b4901 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: I115a42601c774062485974042464abb0d65c35e9
(cherry picked from commit a8f9a075b14c526a0de75c2ade81ebc4e05e4ef8)
2016-09-08 08:01:13 +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
Narayan Kamath
15ab539368 Merge "Backport changes to whitelist sockets opened by the zygote." into nyc-dev 2016-09-08 07:30:46 +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
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
TreeHugger Robot
bdbed7857b Merge "docs: Added item to Support Library revision history" into nyc-dev 2016-09-07 23:45:39 +00:00
Scott Main
9635756473 Merge "revisions to the Building Your First app class with feedback from mpawlan (thank you!)" into nyc-dev 2016-09-07 23:39:52 +00:00
Mark Lu
2b05f12911 Merge "docs: fix grammar mistake in TextureView" into nyc-dev 2016-09-07 23:24:11 +00:00
Andrew Solovay
f53968061c docs: Fixing links to moved Fragments guide, + redirect
The Fragments API guide was moved, but apparently a redirect was
never set up. Also, there are a few links to the old location in
the Javadocs.

Staged the revised Javadocs (see first comment for stage location).
Not going to stage the redirects file since it would trash another,
bigger CL that deals with the redirects file, but it's pretty
straightforward.

bug: 30559011
Change-Id: Ibd65f85c1ebb9789c1d40614fe11fe4ffda97e58
2016-09-07 15:42:35 -07:00
TreeHugger Robot
fb2cdce7c2 Merge "DO NOT MERGE Stop work challenge freeform bypass" into nyc-dev 2016-09-07 22:07:21 +00:00
Andrew Solovay
89e77eb55c docs: Added item to Support Library revision history
See first comment for doc stage location.

bug: 30622244
Change-Id: I7cfdf2107d57d72565bcc4cc503242741f2452ff
2016-09-07 15:00:33 -07:00
smain@google.com
14f51a724e revisions to the Building Your First app class with feedback from mpawlan (thank you!)
stage: https://android-dot-devsite.googleplex.com/training/basics/firstapp/creating-project.html

Change-Id: I40ce201553226fa36477e54b82721bc6cc85b88b
2016-09-07 21:09:27 +00:00
Alan Viverette
9d25bf73a4 Merge "Support library 24.2.0 API diff" into nyc-dev 2016-09-07 20:54:07 +00:00
Narayan Kamath
f52b30cf8d Backport changes to whitelist sockets opened by the zygote. am: 7ec85f9d54 am: f7b9f84f87 am: 9a409265fc -s ours am: 9802fcfa2b am: 2acf9f7e3c am: 36b90a1934 am: 5febcdd210
am: ebcc7aeda9

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

Change-Id: Ib7e40acc4682e4198dcaab78c57de02acfe89c94
2016-09-07 20:23:28 +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
TreeHugger Robot
33831c02b5 Merge "docs: Fixing redirect file" into nyc-dev 2016-09-07 20:19:09 +00: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
a1252ccbdb Backport changes to whitelist sockets opened by the zygote.
This is the backport of the following commits :

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

(cherry picked from commit c5f27a7cb2ec816f483a65255034a1b57a8aa221)

Fix clang build breakage (-Werror -Wformat).

Use %zd for size_t. Note that this will break only on (-plus-)aosp because
clang is disabled on the N development branches.

bug: 30963384

(cherry picked from commit b334c33d65894f5ca9833fa55c3a1cf75e01c497)

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

(cherry picked from commit 3764a260f0c90dcb323caeda14baf903cc108759)

fd_utils: Remove whitelist for "/dev/pmsg0".

We're now calling __android_log_close prior to a fork, so this file
shouldn't need to be open.

bug: 31243313
bug: 30963384

(cherry picked from commit 8dee0541904e4f792cdebdee4f23f768561cb276)

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

(cherry picked from commit 0b76d6a28e6978151bf245a775329cdae5e574d5)

add dri device to zygote whitelisted FDs

The driver can be used just like /dev/ion for graphic buffers.

(cherry picked from commit 8977e424ee2d6d85fec419532ae510131aa88c45)
2016-09-07 20:54:17 +01:00
TreeHugger Robot
4dc743ac67 Merge "docs: Added note about CustomTabsIntent.setAlwaysUseBrowserUI" into nyc-dev 2016-09-07 19:02:37 +00:00