summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/fdpipe
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2019-08-13 13:32:18 -0700
committergVisor bot <gvisor-bot@google.com>2019-08-13 13:33:33 -0700
commit0e907c4298e635d5960b1aeefde2294a6a795cbc (patch)
treee65c95e035a058c83c75b01ebe0a7a2d28ad1216 /pkg/sentry/fs/fdpipe
parent072d941e325686e877395dabb4320c39e5e82a8a (diff)
Fix file mode check in pipeOperations
PiperOrigin-RevId: 263203441
Diffstat (limited to 'pkg/sentry/fs/fdpipe')
-rw-r--r--pkg/sentry/fs/fdpipe/pipe.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/fs/fdpipe/pipe.go b/pkg/sentry/fs/fdpipe/pipe.go
index 5a0a67eab..669ffcb75 100644
--- a/pkg/sentry/fs/fdpipe/pipe.go
+++ b/pkg/sentry/fs/fdpipe/pipe.go
@@ -87,7 +87,7 @@ func (p *pipeOperations) init() error {
log.Warningf("pipe: cannot stat fd %d: %v", p.file.FD(), err)
return syscall.EINVAL
}
- if s.Mode&syscall.S_IFIFO != syscall.S_IFIFO {
+ if (s.Mode & syscall.S_IFMT) != syscall.S_IFIFO {
log.Warningf("pipe: cannot load fd %d as pipe, file type: %o", p.file.FD(), s.Mode)
return syscall.EINVAL
}