Describe the bug
FuseDecoder::parse<T> casts an arbitrary byte pointer to *const T and creates &T after checking only byte length. Byte slices do not guarantee the alignment required by ABI structures containing u64 fields. Constructing an unaligned Rust reference is undefined behavior.
To Reproduce
- Place a valid FUSE ABI structure in a byte buffer starting at offset 1, 2, or 4.
- Pass that slice to
FuseDecoder::parse.
- The implementation creates a reference that does not meet
T alignment requirements.
Expected behavior
ABI values must be decoded into owned, alignment-safe values using a controlled set of POD-like types and unaligned-safe reads or explicit byte decoding.
OS Version (please complete the following information):
- Linux
- Curvine branch: current
main
- Component:
curvine-fuse request decoder/operator API
Additional context
Goal:
- Change structure decoding to return owned values.
- Restrict generic decoding to explicitly safe ABI types.
- Migrate request/operator arguments without changing protocol semantics.
- Cover all supported opcodes and deliberately unaligned buffers.
Not goal:
- Request dispatch or filesystem operation refactoring.
Dependency: #1091 request-frame boundary validation.
Describe the bug
FuseDecoder::parse<T>casts an arbitrary byte pointer to*const Tand creates&Tafter checking only byte length. Byte slices do not guarantee the alignment required by ABI structures containingu64fields. Constructing an unaligned Rust reference is undefined behavior.To Reproduce
FuseDecoder::parse.Talignment requirements.Expected behavior
ABI values must be decoded into owned, alignment-safe values using a controlled set of POD-like types and unaligned-safe reads or explicit byte decoding.
OS Version (please complete the following information):
maincurvine-fuserequest decoder/operator APIAdditional context
Goal:
Not goal:
Dependency: #1091 request-frame boundary validation.