diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-07-24 01:55:40 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-24 01:55:40 +0000 |
commit | 16194f8fc21e75565404bbe9f832136d62125f01 (patch) | |
tree | 53faee0d1ce8bcf69db894aff49909b900556426 /pkg/sentry/syscalls/linux | |
parent | 02da1e7f79ef4b77e4e789546108e0e90420da72 (diff) | |
parent | d9a3f5d0c7d675b3cb4519eccca341bac33456af (diff) |
Merge release-20200622.1-210-gd9a3f5d0c (automated)
Diffstat (limited to 'pkg/sentry/syscalls/linux')
-rw-r--r-- | pkg/sentry/syscalls/linux/vfs2/setstat.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/syscalls/linux/vfs2/setstat.go b/pkg/sentry/syscalls/linux/vfs2/setstat.go index 09ecfed26..6daedd173 100644 --- a/pkg/sentry/syscalls/linux/vfs2/setstat.go +++ b/pkg/sentry/syscalls/linux/vfs2/setstat.go @@ -178,6 +178,7 @@ func Truncate(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysc Mask: linux.STATX_SIZE, Size: uint64(length), }, + NeedWritePerm: true, }) return 0, nil, handleSetSizeError(t, err) } @@ -197,6 +198,10 @@ func Ftruncate(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sys } defer file.DecRef() + if !file.IsWritable() { + return 0, nil, syserror.EINVAL + } + err := file.SetStat(t, vfs.SetStatOptions{ Stat: linux.Statx{ Mask: linux.STATX_SIZE, |