permission_broker: reland "Add OpenPath method."

This new method allows a client to request that the permission
broker open the given path for them instead of just making the
path accessible. This will allow the permission broker to set
flags on the file descriptor before passing it back to the client.
Not leaving files permanently chown'd is a nice side-effect.

The permission broker must retain the DAC_OVERRIDE capability to
open device nodes.

BUG=chromium:496469
TEST=Opened a USB device from Chrome App, debugged a remote instance instance of Chrome for Android over USB and verified that webservd can open ports on the firewall.

Change-Id: I0618cd54caf8a7daac5842354c43bc4490202f66
Reviewed-on: https://chromium-review.googlesource.com/281224
Tested-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Trybot-Ready: Reilly Grant <reillyg@chromium.org>
5 files changed