gvisor/pkg/sentry/fsimpl
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
..
devtmpfs
ext
gofer
host
kernfs Add plumbing for importing fds in VFS2, along with non-socket, non-TTY impl. 2020-03-06 12:59:49 -08:00
proc Add plumbing for importing fds in VFS2, along with non-socket, non-TTY impl. 2020-03-06 12:59:49 -08:00
sys Inline vfs.VirtualFilesystem in Kernel struct 2020-02-14 13:40:39 -08:00
testutil
tmpfs VFS2: Support memory mapping in tmpfs. 2020-02-20 09:58:10 -08:00