syscalls,x86: implement execveat() system call

This patch set adds execveat(2) for x86, and is derived from Meredydd
Luff's patch from Sept 2012 (https://lkml.org/lkml/2012/9/11/528).

The primary aim of adding an execveat syscall is to allow an
implementation of fexecve(3) that does not rely on the /proc
filesystem.  The current glibc version of fexecve(3) is implemented
via /proc, which causes problems in sandboxed or otherwise restricted
environments.

Given the desire for a /proc-free fexecve() implementation, HPA
suggested (https://lkml.org/lkml/2006/7/11/556) that an execveat(2)
syscall would be an appropriate generalization.

Also, having a new syscall means that it can take a flags argument
without back-compatibility concerns.  The current implementation just
defines the AT_EMPTY_PATH and AT_SYMLINK_NOFOLLOW flags, but other
flags could be added in future -- for example, flags for new namespaces
(as suggested at https://lkml.org/lkml/2006/7/11/474).

Related history:
 - https://lkml.org/lkml/2006/12/27/123 is an example of someone
   realizing that fexecve() is likely to fail in a chroot environment.
 - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514043 covered
   documenting the /proc requirement of fexecve(3) in its manpage, to
   "prevent other people from wasting their time".
 - https://bugzilla.kernel.org/show_bug.cgi?id=74481 documented that
   it's not possible to fexecve() a file descriptor for a script with
   close-on-exec set (which is possible with the implementation here).
 - https://bugzilla.redhat.com/show_bug.cgi?id=241609 described a
   problem where a process that did setuid() could not fexecve()
   because it no longer had access to /proc/self/fd; this has since
   been fixed.

This patch in particular (of 3 = 2 kernel + 1 man-pages):

Adds the new system execveat(2) syscall. execveat() is to execve() as
openat() is to open(): it takes a file descriptor that refers to a
directory, and resolves the filename relative to that.

In addition, if the filename is empty and AT_EMPTY_PATH is specified,
execveat() executes the file to which the file descriptor refers. This
replicates the functionality of fexecve(), which is a system call in
other UNIXen, but in Linux glibc it depends on /proc being mounted.

Only x86-64, i386 and x32 ABIs are supported in this patch.

Based on patches by Meredydd Luff <meredydd@senatehouse.org>

Signed-off-by: David Drysdale <drysdale@google.com>
syscalls,x86: add selftest for execveat(2)

Signed-off-by: David Drysdale <drysdale@google.com>
fs: Add anon_new_inode_getfile

Create a variant of anon_inode_getfile() that gets a new file instance
that is attached to a new anonymous inode.  This allow attributes
associated with the inode (e.g. mode) to be changed specifically for
this file instance.

Signed-off-by: David Drysdale <drysdale@google.com>
kernel/fork.c: add option to return task_struct

Add a new do_fork_task() entry point, equivalent to do_fork but which
also optionally returns a reference to the new struct task_struct,
and implement do_fork() in terms of this.

Signed-off-by: David Drysdale <drysdale@google.com>
procdesc: Add support for process descriptors

Add support for process descriptors, which are special file descriptors
associated with a process.  The termination of a task that has an extant
process descriptor is reported as a POLLHUP event on the file
descriptor, rather than by generating a SIGCHLD to the parent process.

Also, wildcard wait4(2) operations do not reap zombie processes that
have an extant process descriptor (although a wait4(2) operation that
explicitly specifies the pid of such a process will reap it).

When all process descriptors associated with a process are closed, the
process is terminated with SIGKILL unless the PD_DAEMON flag was set at
process creation time.

Signed-off-by: David Drysdale <drysdale@google.com>
procdesc: wire up process descriptor syscalls

Add the hooks for syscalls related to process descriptors.  These are:
 - pdfork: create new process, as per fork(2), with associated
   process descriptor.
 - pdgetpid: get the PID value associated with a process descriptor.
 - pdkill: send signal to process identified by process descriptor.
 - pdwait4: perform a wait4(2) operation on a process identified by
   process descriptor.

Signed-off-by: David Drysdale <drysdale@google.com>