Do not double-unref send rights when using POLICY_SUBSTITUE_PORT.
commitcdd0be1b2d639a31eae9acbb49771653ec86510f
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 3 Jun 2014 10:48:26 +0000 (3 10:48 +0000)
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 3 Jun 2014 10:48:26 +0000 (3 10:48 +0000)
treedbe55a59ac16560d5aefe74a3d90f7cbec171b34
parent98e5a9e1c8c1dd1931850a4e0bd99124c67d3c95
Do not double-unref send rights when using POLICY_SUBSTITUE_PORT.

By destroying the reply message, the already-copied-out right will be unrefed
again, leading to an over-release of send rights.

This also requires that Rule(POLICY_SUBSTITUTE_PORT) users provide a send right
that can be duplicated with MACH_MSG_TYPE_COPY_SEND, rather than using MAKE_SEND.

BUG=367863
R=mark@chromium.org

Review URL: https://codereview.chromium.org/306123012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274467 0039d316-1c4b-4281-b951-d872f2087c98
sandbox/mac/bootstrap_sandbox_unittest.mm
sandbox/mac/launchd_interception_server.cc
sandbox/mac/launchd_interception_server.h
sandbox/mac/os_compatibility.cc
sandbox/mac/policy.h