prov/efa: Fix the use-after-free bugs for all protocols#12162
Open
shijin-aws wants to merge 3 commits intoofiwg:mainfrom
Open
prov/efa: Fix the use-after-free bugs for all protocols#12162shijin-aws wants to merge 3 commits intoofiwg:mainfrom
shijin-aws wants to merge 3 commits intoofiwg:mainfrom
Conversation
Contributor
Author
|
bot:aws:retest |
69bbdf8 to
e3630ad
Compare
Contributor
Author
|
bot:aws:retest |
084238c to
c493ece
Compare
Contributor
Author
|
bot:aws:retest |
c1cafce to
8bb6f56
Compare
If a CTSDATA is used by a DC protocol, the tx entry should be released when both TX ops are done and the receipt has been received. Signed-off-by: Shi Jin <sjina@amazon.com>
Fix use-after-free in ope lifecycle by deferring release until all outstanding TX ops complete. Multiple protocols (CTS, SHORT_RTR, FETCH_RTA, COMPARE_RTA, DC eager/longcts, EOR, RECEIPT) could release the ope before all associated packet send completions arrived, allowing the buffer pool slot to be reused and stale completions to corrupt the new ope's tx ops counter. Introduce three flags -- EFA_RDM_TXE_REMOTE_ACK_RECEIVED, EFA_RDM_OPE_RECV_COMPLETED, and EFA_RDM_RXE_ACK_IN_FLIGHT -- with per-protocol ready-for-release helpers that gate release on both the response/ack condition and efa_outstanding_tx_ops == 0. Add a CTS send completion handler and an assertion in efa_rdm_ep_record_tx_op_completed to catch counter underflow. Signed-off-by: Shi Jin <sjina@amazon.com>
Signed-off-by: Shi Jin <sjina@amazon.com>
32f3a72 to
c7c9d0f
Compare
Contributor
Author
|
bot:aws:retest |
1 similar comment
Contributor
Author
|
bot:aws:retest |
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.
Fix use-after-free in ope lifecycle by deferring release
until all outstanding TX ops complete. Multiple protocols
(CTS, SHORT_RTR, FETCH_RTA, COMPARE_RTA, DC eager/longcts,
EOR, RECEIPT) could release the ope before all associated
packet send completions arrived, allowing the buffer pool
slot to be reused and stale completions to corrupt the new
ope's tx ops counter. Introduce three flags --
EFA_RDM_TXE_REMOTE_ACK_RECEIVED, EFA_RDM_OPE_RECV_COMPLETED,
and EFA_RDM_RXE_ACK_IN_FLIGHT -- with per-protocol
ready-for-release helpers that gate release on both the
response/ack condition and efa_outstanding_tx_ops == 0. Add
a CTS send completion handler and an assertion in
efa_rdm_ep_record_tx_op_completed to catch counter underflow.