capsicum: Add an fexecve() system call.

Currently, fexecve() on Linux is implemented in glibc, as a hack that
calls execve("/proc/self/fd/NN", ...). This is not compatible with
Capsicum, which forbids absolute path lookups, and in any case is not
suitable for use in environments without /proc mounted (eg chroots).
This patch introduces a dedicated fexecve() system call for x86-64
(and UML).

BUG=none
TEST=run-test fexecve_syscall.test; run-test -vm fexecve_syscall.test

Signed-off-by: Meredydd Luff <meredydd@chromium.org>
Change-Id: Ib5fe92bc59fd04a35c882186c770c02d0da042b8
Reviewed-on: https://gerrit.chromium.org/gerrit/26645
Reviewed-by: Kees Cook <keescook@chromium.org>
14 files changed