Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
6c03786b
Unverified
Commit
6c03786b
authored
Sep 13, 2022
by
Madelyn Olson
Committed by
GitHub
Sep 13, 2022
Browse files
Prevent use after free for inbound cluster link (#11255)
parent
36abc0fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
6c03786b
...
...
@@ -845,10 +845,15 @@ void setClusterNodeToInboundClusterLink(clusterNode *node, clusterLink *link) {
/* A peer may disconnect and then reconnect with us, and it's not guaranteed that
* we would always process the disconnection of the existing inbound link before
* accepting a new existing inbound link. Therefore, it's possible to have more than
* one inbound link from the same node at the same time. */
* one inbound link from the same node at the same time. Our cleanup logic assumes
* a one to one relationship between nodes and inbound links, so we need to kill
* one of the links. The existing link is more likely the outdated one, but it's
* possible the the other node may need to open another link. */
serverLog
(
LL_DEBUG
,
"Replacing inbound link fd %d from node %.40s with fd %d"
,
node
->
inbound_link
->
conn
->
fd
,
node
->
name
,
link
->
conn
->
fd
);
freeClusterLink
(
node
->
inbound_link
);
}
serverAssert
(
!
node
->
inbound_link
);
node
->
inbound_link
=
link
;
link
->
node
=
node
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment