]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_refer.c: Fix attended transfer race condition crash.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 22 Feb 2018 19:53:20 +0000 (13:53 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 22 Feb 2018 23:15:25 +0000 (17:15 -0600)
commitbb9c1938a019744ffa02dcd2779b97cd9240e182
treed02549a0f4cb07d6e11ee1d3f53e523966edc827
parentd4fc1bdad67c26eb340624e06e81f86ab55aaa20
res_pjsip_refer.c: Fix attended transfer race condition crash.

The transferrer's session channel was destroyed by the transferrer's
serializer thread in a race condition with the transfer target's
serializer thread during an attended transfer.  The transfer target's
serializer was attempting to clean up a deferred end status on behalf of
the transferrer's channel when it should have passed the action to the
transferrer's serializer.  When the transfer target's serializer lost the
race then both threads wind up trying to end the transferrer's session.

* Push the ast_sip_session_end_if_deferred() call onto the transferrer's
serializer to avoid a race condition that results in a crash.  The
session_end() function that could be called by
ast_sip_session_end_if_deferred() really must be executed by the
transferrer's serializer to avoid this kind of crash.

ASTERISK-27568

Change-Id: Iacda724e7cb24d7520e49b2fd7e504aa398d7238
res/res_pjsip_refer.c