mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
fuse: use safe go_marshal API for FUSE
Until #3698 is resolved, this change is needed to ensure we're not corrupting memory anywhere.
This commit is contained in:
committed by
Andrei Vagin
parent
4a5857d644
commit
d51ddcefdc
@@ -271,8 +271,10 @@ func (conn *connection) NewRequest(creds *auth.Credentials, pid uint32, ino uint
|
||||
}
|
||||
|
||||
buf := make([]byte, hdr.Len)
|
||||
hdr.MarshalUnsafe(buf[:hdrLen])
|
||||
payload.MarshalUnsafe(buf[hdrLen:])
|
||||
|
||||
// TODO(gVisor.dev/3698): Use the unsafe version once go_marshal is safe to use again.
|
||||
hdr.MarshalBytes(buf[:hdrLen])
|
||||
payload.MarshalBytes(buf[hdrLen:])
|
||||
|
||||
return &Request{
|
||||
id: hdr.Unique,
|
||||
@@ -360,7 +362,8 @@ func (r *Response) UnmarshalPayload(m marshal.Marshallable) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
m.UnmarshalUnsafe(r.data[hdrLen:])
|
||||
// TODO(gVisor.dev/3698): Use the unsafe version once go_marshal is safe to use again.
|
||||
m.UnmarshalBytes(r.data[hdrLen:])
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user