]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
msgr/async: fix unsafe access in unregister_conn() 43548/head
authorSage Weil <sage@newdream.net>
Mon, 19 Apr 2021 14:26:30 +0000 (09:26 -0500)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 14 Oct 2021 16:46:51 +0000 (18:46 +0200)
commit45882632a172f3800360740af1dc3ff0b94030a0
tree1c500a7b72a536729df3bbfeb6abf682805cc853
parentc84f167a8bf604319b93c3226e189ba87c88cd7b
msgr/async: fix unsafe access in unregister_conn()

We were looking at anon_conns and accepting_conns without holding
the lock (deleted_lock is not sufficient).

Drop this test, and move the decrements:

- inc when we add to conns or anon_conns (no changes there)
- dec when we remove from deleted_conns (several different paths!)

Fixes: https://tracker.ceph.com/issues/49237
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit d51d80b3234e17690061f65dc7e1515f4244a5a3)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/msg/async/AsyncMessenger.cc
src/msg/async/AsyncMessenger.h