gvisor/pkg/sentry
Dean Deng 960f6a975b Add plumbing for importing fds in VFS2, along with non-socket, non-TTY impl.
In VFS2, imported file descriptors are stored in a kernfs-based filesystem.
Upon calling ImportFD, the host fd can be accessed in two ways:
1. a FileDescription that can be added to the FDTable, and
2. a Dentry in the host.filesystem mount, which we will want to access through
magic symlinks in /proc/[pid]/fd/.

An implementation of the kernfs.Inode interface stores a unique host fd. This
inode can be inserted into file descriptions as well as dentries.

This change also plumbs in three FileDescriptionImpls corresponding to fds for
sockets, TTYs, and other files (only the latter is implemented here).
These implementations will mostly make corresponding syscalls to the host.
Where possible, the logic is ported over from pkg/sentry/fs/host.

Updates #1672

PiperOrigin-RevId: 299417263
2020-03-06 12:59:49 -08:00
..
arch Define CPUIDInstruction for arm64 2020-02-28 17:07:01 -08:00
contexttest Update package locations. 2020-01-27 15:31:32 -08:00
control add profile option 2020-02-26 16:49:51 +09:00
device Standardize on tools directory. 2020-01-27 12:21:00 -08:00
devices/memdev Add //pkg/sentry/devices/memdev. 2020-01-29 10:09:31 -08:00
fs Add plumbing for importing fds in VFS2, along with non-socket, non-TTY impl. 2020-03-06 12:59:49 -08:00
fsbridge Port most syscalls to VFS2. 2020-02-25 13:37:34 -08:00
fsimpl Add plumbing for importing fds in VFS2, along with non-socket, non-TTY impl. 2020-03-06 12:59:49 -08:00
hostcpu Standardize on tools directory. 2020-01-27 12:21:00 -08:00
hostmm Update package locations. 2020-01-27 15:31:32 -08:00
inet Fix S/R on inet.Namespace. 2020-03-05 17:40:18 -08:00
kernel Prevent memory leaks in ilist 2020-03-06 12:31:43 -08:00
limits Update package locations. 2020-01-27 15:31:32 -08:00
loader Plumb VFS2 inside the Sentry 2020-02-14 11:12:47 -08:00
memmap Update package locations. 2020-01-27 15:31:32 -08:00
mm Add option to skip stuck tasks waiting for address space 2020-02-25 13:44:18 -08:00
pgalloc Update package locations. 2020-01-27 15:31:32 -08:00
platform Merge pull request #1963 from xiaobo55x:kvm_common 2020-03-06 12:05:30 -08:00
sighandling Standardize on tools directory. 2020-01-27 12:21:00 -08:00
socket Fix panic caused by invalid address for Bind in packet sockets. 2020-03-02 16:31:52 -08:00
state Standardize on tools directory. 2020-01-27 12:21:00 -08:00
strace Add netlink sockopt logging to strace. 2020-02-25 15:35:24 -08:00
syscalls Fix construct of linux.Stat for arm64. 2020-02-26 19:29:27 -08:00
time Standardize on tools directory. 2020-01-27 12:21:00 -08:00
unimpl Update package locations. 2020-01-27 15:31:32 -08:00
uniqueid Update package locations. 2020-01-27 15:31:32 -08:00
usage Document MinimumTotalMemoryBytes. 2020-02-10 12:08:32 -08:00
vfs Add plumbing for importing fds in VFS2, along with non-socket, non-TTY impl. 2020-03-06 12:59:49 -08:00
watchdog watchdog: print panic error message before other messages 2020-02-28 17:54:36 -08:00
BUILD Cleanup internal package group. 2020-02-10 17:12:59 -08:00