summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/fuse/init.go
diff options
context:
space:
mode:
authorCraig Chi <craigchi@google.com>2020-08-20 12:31:52 -0700
committerAndrei Vagin <avagin@gmail.com>2020-09-11 13:35:25 -0700
commit3bd85840c8f0364083c88d65c2bc1f968069b04e (patch)
tree44d2cd8c73c85edf2e24e734f35fc7ae85ea7f7b /pkg/sentry/fsimpl/fuse/init.go
parentaad7e25632ee972bd026c83b3881b2166175b4db (diff)
Support multiple FUSE kernel versions of FUSE_INIT response struct
The fuse_init_out struct changes in different FUSE kernel versions. A FUSE server may implement older versions of fuse_init_out, but they share common attributes from the beginning. Implement variable-length marshallable interface to support older versions of ABI. Fixes #3707
Diffstat (limited to 'pkg/sentry/fsimpl/fuse/init.go')
-rw-r--r--pkg/sentry/fsimpl/fuse/init.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/sentry/fsimpl/fuse/init.go b/pkg/sentry/fsimpl/fuse/init.go
index 2ff2542b6..6384cbbdb 100644
--- a/pkg/sentry/fsimpl/fuse/init.go
+++ b/pkg/sentry/fsimpl/fuse/init.go
@@ -76,12 +76,12 @@ func (conn *connection) InitRecv(res *Response, hasSysAdminCap bool) error {
return err
}
- var out linux.FUSEInitOut
- if err := res.UnmarshalPayload(&out); err != nil {
+ initRes := linux.FUSEInitRes{Len: res.DataLen()}
+ if err := res.UnmarshalPayload(&initRes); err != nil {
return err
}
- return conn.initProcessReply(&out, hasSysAdminCap)
+ return conn.initProcessReply(&initRes.InitOut, hasSysAdminCap)
}
// Process the FUSE_INIT reply from the FUSE server.