diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-06-19 17:22:13 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-06-19 17:22:13 +0000 |
commit | bb211be090312bb40f80c192379447727a470463 (patch) | |
tree | cfd8dcc2c782a5efe6b928d92de909c68c5e876a /pkg/sentry/fsimpl/tmpfs | |
parent | 8f2d48b38b4a07edcd8b126e74da39f1f5eb672d (diff) | |
parent | a609fff9d1516a095341c2016ec36f952550a46f (diff) |
Merge release-20200608.0-94-ga609fff9d (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/tmpfs')
-rw-r--r-- | pkg/sentry/fsimpl/tmpfs/regular_file.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/tmpfs/regular_file.go b/pkg/sentry/fsimpl/tmpfs/regular_file.go index bfd9c5995..b805aadd0 100644 --- a/pkg/sentry/fsimpl/tmpfs/regular_file.go +++ b/pkg/sentry/fsimpl/tmpfs/regular_file.go @@ -279,6 +279,12 @@ func (fd *regularFileFD) PRead(ctx context.Context, dst usermem.IOSequence, offs if offset < 0 { return 0, syserror.EINVAL } + + // Check that flags are supported. Silently ignore RWF_HIPRI. + if opts.Flags&^linux.RWF_HIPRI != 0 { + return 0, syserror.EOPNOTSUPP + } + if dst.NumBytes() == 0 { return 0, nil } @@ -304,6 +310,12 @@ func (fd *regularFileFD) PWrite(ctx context.Context, src usermem.IOSequence, off if offset < 0 { return 0, syserror.EINVAL } + + // Check that flags are supported. Silently ignore RWF_HIPRI. + if opts.Flags&^linux.RWF_HIPRI != 0 { + return 0, syserror.EOPNOTSUPP + } + srclen := src.NumBytes() if srclen == 0 { return 0, nil |