capsicum: fill in more CAP_TODO entries

 - fcntl(2) operations need varying rights depending on the operation
   being performed.

 - Operations for aio(7) need rights depending on the async opcode
   being performed (CAP_READ|CAP_SEEK, CAP_WRITE|CAP_SEEK or
   CAP_FSYNC).

 - The backing file descriptor for virtio host acceleration support
   needs CAP_READ|CAP_WRITE.

 - Android Binder IPC mechanism needs to transfer rights associated
   with any transferred file descriptor.

 - The file descriptor used in the MSM MDP interface needs CAP_FSTAT
   (to retrieve its inode and check device number).

 - The file descriptor used for iSCSI support over TCP needs all of
   CAP_READ|CAP_WRITE|CAP_SEEK|CAP_GETSOCKNAME|CAP_GETPEERNAME|
   CAP_GETSOCKOPT.

 - The file descriptor used for a network block device needs
   CAP_READ|CAP_WRITE|CAP_SHUTDOWN.

 - The backing file for a loopback device needs
   CAP_WRITE|CAP_READ|CAP_SEEK|CAP_FSYNC|CAP_FSTAT.

 - When assigning a VFIO character group device to a container using
   ioctl(vfio_dev_fd, VFIO_GROUP_SET_CONTAINER, &container_fd),
   no specific rights are needed.

 - When opening an Infiniband XRC domain, need CAP_FSTAT (for the
   lookup of the corresponding inode).

 - When creating an Infiniband completion queue with an associated
   completion channel, no specific rights are needed on the completion
   channel FD.

 - When transferring an RDMA communication identifier with the
   RDMA_USER_CM_CMD_MIGRATE_ID command, the source file descriptor
   needs rights CAP_READ|CAP_WRITE|CAP_SEEK|CAP_POLL_EVENT.

 - The file descriptor used for a layer 2 tunnel needs
   CAP_READ|CAP_WRITE in general, and CAP_SHUTDOWN for closedown
   processing.

 - For btrfs snapshotting, the file descriptor passed as an argument
   to ioctl(.., BTRFS_IOC_SNAP_CREATE,..) needs CAP_FSTAT to
   retrieve the corresponding inode.

 - For btrfs cloning, the file descriptor passed as an argument to
   ioctl(.., BTRFS_IOC_CLONE,..) needs CAP_FSTAT to retrieve the
   corresponding inode and check the file mode.

 - For ext4 online defragmentation, when transferring file contents
   to a destination donor file with ioctl(.., EXT4_IOC_MOVE_EXT,..),
   need CAP_WRITE|CAP_FSTAT|CAP_SEEK.

 - For XFS defragmentation using ioctl(.., XFS_IOC_SWAPEXT,..), both
   the target and temporary files need CAP_READ|CAP_WRITE|CAP_FSTAT.

 - For converting an XFS file descriptor to a handle with
   ioctl(.., XFS_IOC_FD_TO_HANDLE,..) need CAP_FSTAT right.

 - The heartbeat device for an OCFS2 can be specified using a configfs
   file descriptor value; this file descriptor needs CAP_FSTAT right to
   allow lookup of corresponding device.
capsicum: fill in remaining CAP_TODO entries

Remove CAP_TODO constant now the remaining uses have been replaced:

 - Bluetooth ioctl(.., *CONNADD,..) calls that add a file descriptor
   require CAP_READ|CAP_WRITE.

 - When referencing ATM queuing discipline classes using a file
   descriptor that identifies a VC, that FD requires CAP_GETSOCKNAME
   as the socket is just used to identify the VC.
capsicum: ignore build* for convenience
capsicum: mop up remaining fget() invocations

Find missed fget() invocations and other compilation issues
from a build with allyesconfig.

 - Rename existing (unused) CAP_NONE and CAP_ALL enum values in
   net/wireless/ath/ar5523/ar5523.h.

 - Use CAP_IOCTL for the second file descriptor passed to
   ioctl(.., SYNC_IOC_MERGE,..) for the Android kernel synchronization
   framework.

 - Use CAP_READ|CAP_WRITE|CAP_SEEK|CAP_SHUTDOWN for the socket
   used for a USB/IP attachment.

 - Use CAP_WRITE|CAP_SEEK for the file descriptor passed on a btrfs
   ioctl(.., BTRFS_IOC_SEND,..) invocation.

 - Use CAP_NONE for the file retrieved in processing the Coda filesystem
   CODA_OPEN_BY_FD command (as it doesn't appear to be used).

 - Use CAP_WRITE|CAP_FSTAT for the file descriptor passed to an NCP
   filesystem mount operation.
capsicum: just need CAP_WRITE for eventfd_signal

To notify an event FD with eventfd_signal(), need
CAP_WRITE on the file descriptor.

Another possibility would be to require CAP_POST_EVENT,
analogously to FreeBSD's kevent(2) syscall, but that
would be inconsistent with user-space generation of
event FD notification by calling write(2) on the FD.
capsicum: fix duplicate CAP_* constants
capsicum: propagate rights in path processing

Create internal variants of user_path_create and kern_path_create
that take an additional argument indicating the rights that the
dfd needs to have; map the original versions through with requirement
for CAP_LOOKUP.

Call the new variants for operations that need additional rights
on the dfd over and above CAP_LOOKUP:
 - CAP_RMDIR for do_rmdir(), from unlinkat(dfd, path, AT_REMOVEDIR)
 - CAP_MKDIR for mkdirat
 - CAP_MKFIFIO for mknodat with S_IFIFO

(In future, also expect to add CAP_MKNOD requirement for mknodat
when creating a device entry.)

Further down, the rights argument that was already passed to path_init
is now an in/out parameter:
 - input is required rights on dfd
 - output is the actual rights that the dfd had (so they can be
   propagated to any new FDs generated by openat).

Rename parameters to dfd_rights throughout for clarity/consistency.
capsicum: add fdinfo for process descriptors

The output of 'cat /proc/<pid>/fdinfo/<fd>' for a process descriptor
will now include the pid of the corresponding process (in the namespace
of the invoking process).