Skip to content

Commit

Permalink
crimson/net: fix use-after-free during yielded closing
Browse files Browse the repository at this point in the history
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
  • Loading branch information
cyx1231st authored and aaSharma14 committed Feb 15, 2023
1 parent 285440a commit 87bdf7a
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 87bdf7a

Please sign in to comment.