Repository navigation
libnvme: mi-mctp: reject multiple MPR responses for a single command - #4461
Merged
Merged
Conversation
igaw
reviewed
Nov 21, 2026
| "MPR maximum wait time exceeded\n"); | ||
| errno = ETIMEDOUT; | ||
| rc = -1; | ||
| goto out; |
Collaborator
There was a problem hiding this comment.
The error code should be directly returned. we stopped using errno.
Author
|
Updated to return |
Author
|
Following @jk-ozlabs's review on linux-nvme/libnvme#1159, I have reworked this patch to reject subsequent MPR responses per command directly with -EPROTO (without using errno) while keeping the existing per-response mprt_max clamp. Please take another look when you have time! |
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/libnvme#1142 Signed-off-by: niuxiaoch <niuxiaolong893@gmail.com>
Collaborator
|
thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,
libnvme_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 with-EPROTO, while keeping the existing per-response clamp toep->mprt_max.Fixes: linux-nvme/libnvme#1142