diff options
author | Jinmou Li <jinmli@google.com> | 2020-09-03 19:22:24 +0000 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-16 12:19:30 -0700 |
commit | 4edc56d3e99b161f2f3311bc22a51012bf0a90ee (patch) | |
tree | ac050d771792c8b9f6364b0a3139d2701561a52b /pkg/sentry/fsimpl/fuse/file.go | |
parent | 826a685a95bec32286688035922a56faf622e87e (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) } |