Repository navigation
mi-mctp: reject multiple MPR responses for a single command - #1159
Conversation
|
As I mentioned in #1142, there can only be one MPR response per command; if we want to cap the wait time, we should reject subsequent MPR responses, and so there should be no "cumulative" wait time. Is there a reason to do otherwise? |
|
Thanks for the review, @jk-ozlabs! That makes complete sense — I initially went with the cumulative mprt_max approach based on the earlier discussion in #1142, but since NVMe-MI v2.2 § 4.1.2.3 strictly permits only one MPR response per command (and ep->mprt_max defaults to 0), rejecting subsequent MPR responses directly is much cleaner and avoids any unbounded wait even when mprt_max is unset. I have updated the PR to track mpr_seen and reject any additional MPR response with EPROTO while keeping the existing per-response mprt_max clamp, and will update the corresponding libnvme3 PR (linux-nvme/nvme-cli#4461) accordingly. |
|
OK, looks good overall, but no need to split into the two commits - the second mostly removes stuff added in the first. If you squash these two together, keeping the commit from the second, that should result in a sensible PR. |
Per NVMe-MI v2.2 section 4.1.2.3, a More Processing Required (MPR) response shall only be transmitted once for a Command Message. Track whether an MPR response has already been received for the current command and reject any subsequent MPR response with EPROTO, while keeping the existing per-response clamp to ep->mprt_max. Fixes: linux-nvme#1142 Signed-off-by: niuxiaoch <niuxiaolong893@gmail.com>
|
Squashed into a single commit. Thanks @jk-ozlabs! |
|
Thanks a lot everyone! |
Per NVMe-MI v2.2 section 4.1.2.3, a More Processing Required (MPR) response shall only be transmitted once for a Command Message. Currently,
nvme_mi_mctp_submit()loops unconditionally on every MPR response, allowing a faulty or malicious endpoint sending repeated MPR responses to stall the caller indefinitely while holding the MCTP tag.Track whether an MPR response has already been received for the current command in
mpr_seenand reject any subsequent MPR response withEPROTO, while keeping the existing per-response clamp toep->mprt_max.Fixes #1142