Skip to content

Commit

Permalink
Merge pull request ceph#49022 from cyx1231st/wip-seastar-msgr-fix-yie…
Browse files Browse the repository at this point in the history
…lded-closing

crimson/net: fix use-after-free during yielded closing

Reviewed-by: Kefu Chai <tchaikov@gmail.com>
  • Loading branch information
tchaikov committed Nov 23, 2022
2 parents 6f29bb9 + dea4ec6 commit 6257818
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/crimson/net/Protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class Protocol {
// seastar::parallel_for_each(). otherwise, we could erase a connection in
// the container when seastar::parallel_for_each() is still iterating in
// it. that'd lead to a segfault.
return seastar::yield().then([this, dispatch_reset] {
return seastar::yield(
).then([this, dispatch_reset, conn_ref = conn.shared_from_this()] {
close(dispatch_reset);
// it can happen if close_clean() is called inside Dispatcher::ms_handle_reset()
// which will otherwise result in deadlock
Expand Down

0 comments on commit 6257818

Please sign in to comment.