diff options
author | Andrei Vagin <avagin@google.com> | 2020-01-28 13:36:16 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-28 13:37:19 -0800 |
commit | f263801a74d4ccac042b068d0928c8738e40af5b (patch) | |
tree | 3e4fa2cf7a20ed4a38efb9b582262bfc8dfa12ab /pkg/sentry/fs/attr.go | |
parent | 34fbd8446c386fb0136dad31ab6b173f17049a58 (diff) |
fs/splice: don't report partial errors for special files
Special files can have additional requirements for granularity.
For example, read from eventfd returns EINVAL if a size is less 8 bytes.
Reported-by: syzbot+3905f5493bec08eb7b02@syzkaller.appspotmail.com
PiperOrigin-RevId: 292002926
Diffstat (limited to 'pkg/sentry/fs/attr.go')
-rw-r--r-- | pkg/sentry/fs/attr.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/fs/attr.go b/pkg/sentry/fs/attr.go index fa9e7d517..f60bd423d 100644 --- a/pkg/sentry/fs/attr.go +++ b/pkg/sentry/fs/attr.go @@ -206,6 +206,11 @@ func IsPipe(s StableAttr) bool { return s.Type == Pipe } +// IsAnonymous returns true if StableAttr.Type matches any type of anonymous. +func IsAnonymous(s StableAttr) bool { + return s.Type == Anonymous +} + // IsSocket returns true if StableAttr.Type matches any type of socket. func IsSocket(s StableAttr) bool { return s.Type == Socket |