gvisor/pkg/sentry
Jamie Liu dbc507dc5c Add equivalents to FMODE_PREAD/PWRITE to VFS2.
This is mostly required for PipeTest_OffsetCalls.

The options are DenyPRead/PWrite rather than AllowPRead/PWrite since, in Linux
terms, fs/open.c:do_dentry_open sets FMODE_PREAD|FMODE_PWRITE unconditionally
(although it allows filesystem implementations of open to unset these flags),
so they're set for most FDs; it's usually FDs created outside of open(2) that
don't get them, e.g.:

- Syscall-created pipes (fs/pipe.c:create_pipe_files =>
  fs/file_table.c:alloc_file_pseudo)

- Epoll instances (fs/eventpoll.c:do_epoll_create =>
  fs/anon_inodes.c:anon_inode_getfile => alloc_file_pseudo)

- Sockets (net/socket.c:sock_alloc_file => alloc_file_pseudo)

This CL adds the flags to epoll instances; a subsequent CL reworks the VFS2
implementation of pipe FDs to be filesystem-independent and adds the flags
there, and sockets aren't implemented yet.

Updates #1035

PiperOrigin-RevId: 304506434
2020-04-02 16:58:24 -07:00
..
arch Fix 386 build tags 2020-04-01 10:00:03 -07:00
contexttest Update package locations. 2020-01-27 15:31:32 -08:00
control Use host-defined file owner and mode, when possible, for imported fds. 2020-03-26 16:47:20 -07: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 Include original copyUp error in panic if cleanupUpper fails. 2020-03-31 15:11:11 -07:00
fsbridge Add support for mount flags 2020-03-13 08:58:04 -07:00
fsimpl Pass configurable FilesystemType to tmpfs. 2020-04-01 12:06:37 -07: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 Implement automated marshalling for slices of Marshallable types. 2020-03-31 22:56:09 -07: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 Automated rollback of changelist 303799678 2020-04-01 11:06:26 -07:00
sighandling Fix "application exiting with {Code:0 Signo:27}" during boot. 2020-03-13 11:26:45 -07:00
socket Add FileDescription interface for socket files. 2020-04-01 07:57:12 -07: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 Implement automated marshalling for slices of Marshallable types. 2020-03-31 22:56:09 -07: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 equivalents to FMODE_PREAD/PWRITE to VFS2. 2020-04-02 16:58:24 -07: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