diff options
author | Jinmou Li <jinmli@google.com> | 2020-09-03 19:22:24 +0000 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-11 13:35:25 -0700 |
commit | 5a28bc6121c2cb076e24036386241e32a5745b40 (patch) | |
tree | 1822d67b0aab509500e588eb6768a63d65c42566 /pkg/sentry/fsimpl/fuse/file.go | |
parent | 84acc461cda70348a70992aac984c0e6e2b1621f (diff) |
Fix FUSE_RELEASE protocol reply processing
This commit fixes the potential unexpected errors
of original handling of FUSE_RELEASE responses while
keep the same behavior (ignoring any reply).
Diffstat (limited to 'pkg/sentry/fsimpl/fuse/file.go')
-rw-r--r-- | pkg/sentry/fsimpl/fuse/file.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/fuse/file.go b/pkg/sentry/fsimpl/fuse/file.go index 15c0e3f41..b98145ba2 100644 --- a/pkg/sentry/fsimpl/fuse/file.go +++ b/pkg/sentry/fsimpl/fuse/file.go @@ -84,7 +84,12 @@ func (fd *fileDescription) Release(ctx context.Context) { } kernelTask := kernel.TaskFromContext(ctx) // ignoring errors and FUSE server reply is analogous to Linux's behavior. - req, _ := conn.NewRequest(auth.CredentialsFromContext(ctx), uint32(kernelTask.ThreadID()), fd.inode().NodeID, opcode, &in) + req, err := conn.NewRequest(auth.CredentialsFromContext(ctx), uint32(kernelTask.ThreadID()), fd.inode().NodeID, opcode, &in) + if err != nil { + // No way to invoke Call() with an errored request. + return + } + req.noReply = true conn.CallAsync(kernelTask, req) } |