Repository navigation
libmctp: missing reassembly timeout and TO bit in the reassembly key #27
YuvalYeruham2
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We're implementing MCTP over SMBus with libmctp, and found two issues in message reassembly in core.c on master (ab58506):
No reassembly timeout. Once a SOM packet arrives, its reassembly context is released only by an EOM, a sequence or size error, or a new SOM with the same src/dest/tag. If the sender stops partway through a message, the context stays reserved forever. Eventually new multi-packet messages fail with "Context buffers exhausted", and a stray packet that arrives later can be appended to the stale data. DSP0236 §8.9 requires dropping the partial message on "Timeout waiting for a packet", with the value left to each transport binding. For example, DSP0237 (SMBus/I2C) limits the sender's gap between packets to 100 ms (MT3a).
The TO bit isn't part of the reassembly key. mctp_msg_ctx_lookup() matches only on src, dest and tag. DSP0236 §8.6 also includes the TO bit, so a request and a response that share a tag and source end up in the same context.
Proposed fix:
@amboar @mkj @edersondisouza
All reactions