gvisor/pkg/sentry/fs/gofer
Jamie Liu f005350c93 Clean up gofer handle caching.
- Document fsutil.CachedFileObject.FD() requirements on access
permissions, and change gofer.inodeFileState.FD() to honor them.
Fixes #147.

- Combine gofer.inodeFileState.readonly and
gofer.inodeFileState.readthrough, and simplify handle caching logic.

- Inline gofer.cachePolicy.cacheHandles into
gofer.inodeFileState.setSharedHandles, because users with access to
gofer.inodeFileState don't necessarily have access to the fs.Inode
(predictably, this is a save/restore problem).

Before this CL:

$ docker run --runtime=runsc-d -v $(pwd)/gvisor/repro:/root/repro -it ubuntu bash
root@34d51017ed67:/# /root/repro/runsc-b147
mmap: 0x7f3c01e45000
Segmentation fault

After this CL:

$ docker run --runtime=runsc-d -v $(pwd)/gvisor/repro:/root/repro -it ubuntu bash
root@d3c3cb56bbf9:/# /root/repro/runsc-b147
mmap: 0x7f78987ec000
o
PiperOrigin-RevId: 240818413
Change-Id: I49e1d4a81a0cb9177832b0a9f31a10da722a896b
2019-03-28 11:43:51 -07:00
..
BUILD Remove license comments 2019-01-31 11:12:53 -08:00
attr.go Use correct company name in copyright header 2018-10-19 16:35:11 -07:00
cache_policy.go Clean up gofer handle caching. 2019-03-28 11:43:51 -07:00
context_file.go Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
device.go Use correct company name in copyright header 2018-10-19 16:35:11 -07:00
file.go Internal change. 2019-02-21 13:08:34 -08:00
file_state.go Clean up gofer handle caching. 2019-03-28 11:43:51 -07:00
fs.go Allow filesystem.Mount to take an optional interface argument. 2019-03-13 19:24:03 -07:00
gofer_test.go Deflake gofer_test. 2018-12-20 17:23:26 -08:00
handles.go Use correct company name in copyright header 2018-10-19 16:35:11 -07:00
inode.go Clean up gofer handle caching. 2019-03-28 11:43:51 -07:00
inode_state.go Use correct company name in copyright header 2018-10-19 16:35:11 -07:00
path.go Clean up gofer handle caching. 2019-03-28 11:43:51 -07:00
session.go Invalidate COW mappings when file is truncated 2019-01-31 12:54:00 -08:00
session_state.go Allow filesystem.Mount to take an optional interface argument. 2019-03-13 19:24:03 -07:00
socket.go Convert Unix transport to syserr 2018-10-24 11:05:08 -07:00
util.go Use correct company name in copyright header 2018-10-19 16:35:11 -07:00