Commit Graph

11 Commits

Author SHA1 Message Date
Jamie Liu 471b15b212 Port most syscalls to VFS2.
pipe and pipe2 aren't ported, pending a slight rework of pipe FDs for VFS2.
mount and umount2 aren't ported out of temporary laziness. access and faccessat
need additional FSImpl methods to implement properly, but are stubbed to
prevent googletest from CHECK-failing. Other syscalls require additional
plumbing.

Updates #1623

PiperOrigin-RevId: 297188448
2020-02-25 13:37:34 -08:00
gVisor bot 3557b26651 Allow vfs.IterDirentsCallback.Handle() to return an error.
This is easier than storing errors from e.g. CopyOut in the callback.

PiperOrigin-RevId: 295230021
2020-02-14 14:40:35 -08:00
gVisor bot a6024f7f5f Add FileExec flag to OpenOptions
This allow callers to say whether the file is being
opened to be executed, so that the proper checks can
be done from FilesystemImpl.OpenAt()

Updates #1623

PiperOrigin-RevId: 295042595
2020-02-13 17:57:36 -08:00
Fabricio Voznika 396c574db2 Add support for WritableSource in DynamicBytesFileDescriptionImpl
WritableSource is a convenience interface used for files that can
be written to, e.g. /proc/net/ipv4/tpc_sack. It reads max of 4KB
and only from offset 0 which should cover most cases. It can be
extended as neeed.

Updates #1195

PiperOrigin-RevId: 292056924
2020-01-28 18:31:28 -08:00
Adin Scannell 0e2f1b7abd Update package locations.
Because the abi will depend on the core types for marshalling (usermem,
context, safemem, safecopy), these need to be flattened from the sentry
directory. These packages contain no sentry-specific details.

PiperOrigin-RevId: 291811289
2020-01-27 15:31:32 -08:00
Fabricio Voznika 8e8d0f96f6 Add /proc/[pid]/cgroups file
Updates #1195

PiperOrigin-RevId: 290298266
2020-01-17 10:41:44 -08:00
Fabricio Voznika ff99609858 Add /proc/net/* files
Updates #1195

PiperOrigin-RevId: 290285420
2020-01-17 10:21:46 -08:00
Fabricio Voznika 3dd3275da7 Add more files to /proc/[pid]/*
Files not implemented require VFSv2 plumbing into the kernel.
Also, cgroup is not implemented yet.

Updates #1195

PiperOrigin-RevId: 290129176
2020-01-16 14:10:05 -08:00
Fabricio Voznika 7b7c31820b Add remaining /proc/* and /proc/sys/* files
Except for one under /proc/sys/net/ipv4/tcp_sack.
/proc/pid/* is still incomplete.

Updates #1195

PiperOrigin-RevId: 290120438
2020-01-16 12:30:21 -08:00
Fabricio Voznika db376e1392 Make /proc/[pid] offset start at TGID_OFFSET
Updates #1195

PiperOrigin-RevId: 288725745
2020-01-08 10:45:12 -08:00
Fabricio Voznika 3c125eb219 Initial procfs implementation in VFSv2
Updates #1195

PiperOrigin-RevId: 287227722
2019-12-26 14:45:35 -08:00