gvisor/pkg
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
..
abi Port most syscalls to VFS2. 2020-02-25 13:37:34 -08:00
amutex Standardize on tools directory. 2020-01-27 12:21:00 -08:00
atomicbitops Re-add atomicbitops_arm64.s to BUILD. 2020-02-20 11:16:08 -08:00
binary Move Align{Up,Down} into binary package. 2020-02-11 11:09:31 -08:00
bits Standardize on tools directory. 2020-01-27 12:21:00 -08:00
bpf Standardize on tools directory. 2020-01-27 12:21:00 -08:00
buffer Make pipe buffer implementation standard. 2020-02-28 12:29:23 -08:00
compressio Standardize on tools directory. 2020-01-27 12:21:00 -08:00
context Update package locations. 2020-01-27 15:31:32 -08:00
control Standardize on tools directory. 2020-01-27 12:21:00 -08:00
cpuid cpuid: cache the maximum size of xsave state 2020-02-18 13:50:07 -08:00
eventchannel Standardize on tools directory. 2020-01-27 12:21:00 -08:00
fd Standardize on tools directory. 2020-01-27 12:21:00 -08:00
fdchannel Standardize on tools directory. 2020-01-27 12:21:00 -08:00
fdnotifier Standardize on tools directory. 2020-01-27 12:21:00 -08:00
flipcall Standardize on tools directory. 2020-01-27 12:21:00 -08:00
fspath Port most syscalls to VFS2. 2020-02-25 13:37:34 -08:00
gate Standardize on tools directory. 2020-01-27 12:21:00 -08:00
gohacks Port most syscalls to VFS2. 2020-02-25 13:37:34 -08:00
goid Standardize on tools directory. 2020-01-27 12:21:00 -08:00
ilist Prevent memory leaks in ilist 2020-03-06 12:31:43 -08:00
linewriter Standardize on tools directory. 2020-01-27 12:21:00 -08:00
log Fix nested logging. 2020-02-25 12:25:38 -08:00
memutil Standardize on tools directory. 2020-01-27 12:21:00 -08:00
metric Add notes to relevant tests. 2020-02-05 22:46:35 -08:00
p9 Un-export p9 message encode/decode functions. 2020-02-14 12:23:10 -08:00
pool Move p9.pool to a separate package 2020-02-06 10:07:45 -08:00
procid Standardize on tools directory. 2020-01-27 12:21:00 -08:00
rand Standardize on tools directory. 2020-01-27 12:21:00 -08:00
refs Standardize on tools directory. 2020-01-27 12:21:00 -08:00
safecopy Fix safecopy test. 2020-02-04 12:47:06 -08:00
safemem Ensure that safemem.BlockSeqOf(safemem.Block{}) produces an empty BlockSeq. 2020-03-04 14:30:27 -08:00
seccomp tests: Don't print log messages on stdout 2020-03-04 16:16:35 -08:00
secio Standardize on tools directory. 2020-01-27 12:21:00 -08:00
segment Standardize on tools directory. 2020-01-27 12:21:00 -08:00
sentry Add plumbing for importing fds in VFS2, along with non-socket, non-TTY impl. 2020-03-06 12:59:49 -08:00
sleep Simplify atomic operations 2020-02-11 20:37:01 -08:00
state Standardize on tools directory. 2020-01-27 12:21:00 -08:00
sync Standardize on tools directory. 2020-01-27 12:21:00 -08:00
syncevent Add //pkg/syncevent. 2020-02-18 15:18:48 -08:00
syserr Standardize on tools directory. 2020-01-27 12:21:00 -08:00
syserror Implement tap/tun device in vfs. 2020-02-21 15:42:56 -08:00
tcpip Prevent memory leaks in ilist 2020-03-06 12:31:43 -08:00
tmutex Standardize on tools directory. 2020-01-27 12:21:00 -08:00
unet Standardize on tools directory. 2020-01-27 12:21:00 -08:00
urpc Standardize on tools directory. 2020-01-27 12:21:00 -08:00
usermem Port most syscalls to VFS2. 2020-02-25 13:37:34 -08:00
waiter Standardize on tools directory. 2020-01-27 12:21:00 -08:00