diff options
author | Michael Pratt <mpratt@google.com> | 2018-10-08 11:38:02 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-08 11:39:54 -0700 |
commit | 569c2b06c47d269d961405fa652d45e51860d005 (patch) | |
tree | aabbf7fc7e786d0699d9ea1d34f7048fb4339761 /pkg/sentry/syscalls/linux/sys_file.go | |
parent | e9e8be661328661b5527f1643727b9a13bbeab48 (diff) |
Statfs Namelen should be NAME_MAX not PATH_MAX
We accidentally set the wrong maximum. I've also added PATH_MAX and
NAME_MAX to the linux abi package.
PiperOrigin-RevId: 216221311
Change-Id: I44805fcf21508831809692184a0eba4cee469633
Diffstat (limited to 'pkg/sentry/syscalls/linux/sys_file.go')
-rw-r--r-- | pkg/sentry/syscalls/linux/sys_file.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_file.go b/pkg/sentry/syscalls/linux/sys_file.go index 97881a1f5..015afda9b 100644 --- a/pkg/sentry/syscalls/linux/sys_file.go +++ b/pkg/sentry/syscalls/linux/sys_file.go @@ -115,7 +115,7 @@ func fileOpOn(t *kernel.Task, dirFD kdefs.FD, path string, resolve bool, fn func // copyInPath copies a path in. func copyInPath(t *kernel.Task, addr usermem.Addr, allowEmpty bool) (path string, dirPath bool, err error) { - path, err = t.CopyInString(addr, syscall.PathMax) + path, err = t.CopyInString(addr, linux.PATH_MAX) if err != nil { return "", false, err } @@ -1080,7 +1080,7 @@ func symlinkAt(t *kernel.Task, dirFD kdefs.FD, newAddr usermem.Addr, oldAddr use // The oldPath is copied in verbatim. This is because the symlink // will include all details, including trailing slashes. - oldPath, err := t.CopyInString(oldAddr, syscall.PathMax) + oldPath, err := t.CopyInString(oldAddr, linux.PATH_MAX) if err != nil { return err } |