summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl
AgeCommit message (Collapse)Author
2020-07-07Merge release-20200622.1-74-g10930189c (automated)gVisor bot
2020-07-07Fix mknod and inotify syscall testAyush Ranjan
This change fixes a few things: - creating sockets using mknod(2) is supported via vfs2 - fsgofer can create regular files via mknod(2) - mode = 0 for mknod(2) will be interpreted as regular file in vfs2 as well Updates #2923 PiperOrigin-RevId: 320074267
2020-07-07Merge release-20200622.1-71-ge227450dc (automated)gVisor bot
2020-07-06Call fdnotifier.UpdateFD() from fsimpl/gofer.specialFileFD.Jamie Liu
The fdnotifier package provides an API to a thread that continually epolls arbitrary host FDs. The set of events polled for each host FD is (intended to be) all events for which a waiter.Entry has expressed interest, as returned by waiter.Queue.Events() for the waiter.Queue registered to the given host FD. When the set of events changes (due to a change in the set of registered waiter.Entries), the mutator must call fdnotifier.UpdateFD() to recalculate the new event set and propagate it to the epoll FD. PiperOrigin-RevId: 319924719
2020-07-07Merge release-20200622.1-70-g937912a48 (automated)gVisor bot
2020-07-06Ensure sync is called for readonly fileFabricio Voznika
Calling sync on a readonly file flushes metadata that may have been modified, like last access time. Updates #1198 PiperOrigin-RevId: 319888290
2020-07-06Merge release-20200622.1-67-gbd43368f4 (automated)gVisor bot
2020-07-06Add inode number to synthetic dentriesFabricio Voznika
Reserve the MSB from ino for synthetic dentries to prevent conflict with regular dentries. Log warning in case MSB is set for regular dentries. Updates #1487 PiperOrigin-RevId: 319869858
2020-07-02Merge release-20200622.1-59-g6c099d830 (automated)gVisor bot
2020-07-01Update preadv2/pwritev2 flag handling in vfs2.Dean Deng
We do not support RWF_SYNC/RWF_DSYNC and probably shouldn't silently accept them, since the user may incorrectly believe that we are synchronizing I/O. Remove the pwritev2 test verifying that we support these flags. gvisor.dev/issue/2601 is the tracking bug for deciding which RWF_.* flags we need and supporting them. Updates #2923, #2601. PiperOrigin-RevId: 319351286
2020-07-02Merge release-20200622.1-58-g514955c1a (automated)gVisor bot
2020-07-01[vfs2][gofer] Fix mmap syscall test.Ayush Ranjan
We were not invalidating mappings when the file size changed in shared mode. Enabled the syscall test for vfs2. Updates #2923 PiperOrigin-RevId: 319346569
2020-07-02Merge release-20200622.1-57-g52b44719d (automated)gVisor bot
2020-07-01[vfs2][gofer] Update file size to 0 on O_TRUNCAyush Ranjan
Some Open:TruncateXxx syscall tests were failing because the file size was not being updated when the file was opened with O_TRUNC. Fixes Truncate tests in test/syscalls:open_test_runsc_ptrace_vfs2. Updates #2923 PiperOrigin-RevId: 319340127
2020-07-02Merge release-20200622.1-56-g3b26d2121 (automated)gVisor bot
2020-07-01Remove maxSendBufferSize from vfs2.Dean Deng
Complements cl/315991648. PiperOrigin-RevId: 319327853
2020-07-02Merge release-20200622.1-55-g65d998555 (automated)gVisor bot
2020-07-01Port vfs1 implementation of sync_file_range to vfs2.Dean Deng
Currently, we always perform a full-file sync which could be extremely expensive for some applications. Although vfs1 did not fully support sync_file_range, there were some optimizations that allowed us skip some unnecessary write-outs. Updates #2923, #1897. PiperOrigin-RevId: 319324213
2020-07-01Merge release-20200622.1-52-g6a90c88b9 (automated)gVisor bot
2020-07-01Port fallocate to VFS2.Zach Koopmans
PiperOrigin-RevId: 319283715
2020-07-01Merge release-20200622.1-46-g43f5dd95a (automated)gVisor bot
2020-06-30Fix index calculation for /proc/[pid]/cmdline.Dean Deng
We were truncating buf using a index relative to the middle of the slice (i.e. where envv begins), but we need to calculate the index relative to the entire slice. Updates #2923. PiperOrigin-RevId: 319154950
2020-07-01Merge release-20200622.1-45-g20d571b0c (automated)gVisor bot
2020-06-30Allow O_DIRECT on vfs2 tmpfs files.Dean Deng
Updates #2923. PiperOrigin-RevId: 319153792
2020-07-01Merge release-20200622.1-44-gc4bdd0118 (automated)gVisor bot
2020-06-30Add missing newline in /sys/devices/systen/cpu/onineBhasker Hariharan
PiperOrigin-RevId: 319143410
2020-06-27Merge release-20200622.1-38-g02d552d07 (automated)gVisor bot
2020-06-27Support sticky bit in vfs2.Dean Deng
Updates #2923. PiperOrigin-RevId: 318648128
2020-06-26Merge release-20200622.1-29-g54a31e219 (automated)gVisor bot
2020-06-26Support inotify IN_ONESHOT.Dean Deng
Also, while we're here, make sure that gofer inotify events are generated when files are created in remote revalidating mode. Updates #1479. PiperOrigin-RevId: 318536354
2020-06-26Merge release-20200622.1-28-gcfd049da8 (automated)gVisor bot
2020-06-25Moved FUSE device under the fuse directoryRidwan Sharif
2020-06-25Merge release-20200608.0-124-gb5e814445 (automated)gVisor bot
2020-06-24Fix procfs bugs in vfs2.Dean Deng
- Support writing on proc/[pid]/{uid,gid}map - Return EIO for writing to static files. Updates #2923. PiperOrigin-RevId: 318188503
2020-06-24Merge release-20200608.0-122-g58880bf55 (automated)gVisor bot
2020-06-24Port /dev/net/tun device to VFS2.Nicolas Lacasse
Updates #2912 #1035 PiperOrigin-RevId: 318162565
2020-06-24Merge release-20200608.0-119-g364ac92ba (automated)gVisor bot
2020-06-24Merge release-20200608.0-118-g399c52888 (automated)gVisor bot
2020-06-23Resolve remaining inotify TODOs.Dean Deng
Also refactor HandleDeletion(). Updates #1479. PiperOrigin-RevId: 317989000
2020-06-24Merge release-20200608.0-117-g2189e0a66 (automated)gVisor bot
2020-06-23Clean up hostfs TODOs.Dean Deng
This CL does a handful of things: - Support O_DSYNC, O_SYNC - Support O_APPEND and document an unavoidable race condition - Ignore O_DIRECT; we probably don't want to allow applications to set O_DIRECT on the host fd itself. - Leave a TODO for supporting O_NONBLOCK, which is a simple fix once RWF_NOWAIT is supported. - Get rid of caching TODO; force_page_cache is not configurable for host fs in vfs1 or vfs2 after whitelist fs was removed. - For the remaining TODOs, link to more specific bugs. Fixes #1672. PiperOrigin-RevId: 317985269
2020-06-24Merge release-20200608.0-114-g65a587ded (automated)gVisor bot
2020-06-23Complete inotify IN_EXCL_UNLINK implementation in VFS2.Dean Deng
Events were only skipped on parent directories after their children were unlinked; events on the unlinked file itself need to be skipped as well. As a result, all Watches.Notify() calls need to know whether the dentry where the call came from was unlinked. Updates #1479. PiperOrigin-RevId: 317979476
2020-06-23Merge release-20200608.0-112-g0c628c315 (automated)gVisor bot
2020-06-23Support inotify in vfs2 gofer fs.Dean Deng
Because there is no inode structure stored in the sandbox, inotify watches must be held on the dentry. This would be an issue in the presence of hard links, where multiple dentries would need to share the same set of watches, but in VFS2, we do not support the internal creation of hard links on gofer fs. As a result, we make the assumption that every dentry corresponds to a unique inode. Furthermore, dentries can be cached and then evicted, even if the underlying file has not be deleted. We must prevent this from occurring if there are any watches that would be lost. Note that if the dentry was deleted or invalidated (d.vfsd.IsDead()), we should still destroy it along with its watches. Additionally, when a dentry’s last watch is removed, we cache it if it also has zero references. This way, the dentry can eventually be evicted from memory if it is no longer needed. This is accomplished with a new dentry method, OnZeroWatches(), which is called by Inotify.RmWatch and Inotify.Release. Note that it must be called after all inotify locks are released to avoid violating lock order. Stress tests are added to make sure that inotify operations don't deadlock with gofer.OnZeroWatches. Updates #1479. PiperOrigin-RevId: 317958034
2020-06-23Merge release-20200608.0-106-g38d7b2fe5 (automated)gVisor bot
2020-06-22Only allow regular files, sockets, pipes, and char devices to be imported.Dean Deng
PiperOrigin-RevId: 317796028
2020-06-22Merge release-20200608.0-104-g4573e7d86 (automated)gVisor bot
2020-06-22Check for invalid trailing / when traversing path in gofer OpenAt.Dean Deng
Updates #2923. PiperOrigin-RevId: 317700049
2020-06-22Merge release-20200608.0-101-g00928d142 (automated)gVisor bot