OSDN Git Service

Finish fixing Zygote descriptor leakage problem
authorDave Platt <dplatt@google.com>
Thu, 6 Feb 2014 01:06:42 +0000 (17:06 -0800)
committerDave Platt <dplatt@google.com>
Thu, 6 Feb 2014 21:24:38 +0000 (13:24 -0800)
commit89d4c897a0e1bc06688bcb1fd39913ece81fe05f
treedb0f9ae9a706d1aae9bf708d06b5202c6d274049
parentf5294ed57cf388973a1db29b062b1577966f90d1
Finish fixing Zygote descriptor leakage problem

In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID.  These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change: dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected.  The CLs need to be approved
together, lest the build break or the software fail to boot.

Round 2: indent change

Bug: 12114500
Change-Id: I090402136a8a8b7d6aad6eb153026e85d7cf6ad3
core/java/com/android/internal/os/ZygoteConnection.java
core/java/com/android/internal/os/ZygoteInit.java