This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
fix(security): fix bug in negotiation_service::on_negotiation_request when rpc_session is closed #652
Merged
Conversation
This file contains 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
neverchanje
reviewed
Oct 28, 2020
…to fix-negotiation-service
…to fix-negotiation-service
neverchanje
reviewed
Nov 2, 2020
neverchanje
reviewed
Nov 2, 2020
neverchanje
reviewed
Nov 2, 2020
hycdong
reviewed
Nov 3, 2020
neverchanje
reviewed
Nov 3, 2020
neverchanje
approved these changes
Nov 3, 2020
hycdong
approved these changes
Nov 4, 2020
levy5307
added a commit
to levy5307/rdsn
that referenced
this pull request
Dec 21, 2020
… when rpc_session is closed (XiaoMi#652)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
negotiation
innegotiation_service
.In multi-thread environment, if thread A receive a negotiation message, and pass this message to
negotiation_service::on_negotiation_request
, which will find the correspoingnegotiation
to deal with this negotiation message.And before this message is passed to
negotiation_service::on_negotiation_reques
, thread B receive a message which is illegal to process(for example: get operation), which will produce the rpc_session disconnected. In the meanwhile, the negotiation is removed.So in
negotiation_service::on_negotiation_request
of thead A, the correspondingnegotiation
will benullptr
, this will produce a coredump.Here is the process progress:
Same situation with client_negotiation processing response.
The ownership of the
negotiation
instance is held byrpc_session
, because I refactor it before. security is on the upper level of network now. Sonegotiation
is better to have the ownership ofrpc_session
.change the name from
negotiaiton_service
tonegotiation_manager