summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux/vfs2
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-06-19 14:39:31 -0700
committergVisor bot <gvisor-bot@google.com>2020-06-19 14:41:14 -0700
commitad9f4691741cfada0ae09f73053d6195d43465ae (patch)
tree6591214168e98f41fc1b8e76004fce0b96c41cd6 /pkg/sentry/syscalls/linux/vfs2
parentf0feada89c3a2c01870e5ab6d18caae8b6a8848a (diff)
Fix bugs in vfs2 to make symlink tests pass.
- Return ENOENT if target path is empty. - Make sure open(2) with O_CREAT|O_EXCL returns EEXIST when necessary. - Correctly update atime in tmpfs using touchATime(). Updates #2923. PiperOrigin-RevId: 317382655
Diffstat (limited to 'pkg/sentry/syscalls/linux/vfs2')
-rw-r--r--pkg/sentry/syscalls/linux/vfs2/filesystem.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/syscalls/linux/vfs2/filesystem.go b/pkg/sentry/syscalls/linux/vfs2/filesystem.go
index 46d3e189c..5dac77e4d 100644
--- a/pkg/sentry/syscalls/linux/vfs2/filesystem.go
+++ b/pkg/sentry/syscalls/linux/vfs2/filesystem.go
@@ -313,6 +313,9 @@ func symlinkat(t *kernel.Task, targetAddr usermem.Addr, newdirfd int32, linkpath
if err != nil {
return err
}
+ if len(target) == 0 {
+ return syserror.ENOENT
+ }
linkpath, err := copyInPath(t, linkpathAddr)
if err != nil {
return err