]> 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:14:57 +0000 (17:14 -0600)
commit3e5864bcc87df7424a8d3f5e1098869eb64cd886
treede5b391c4668c5e82fb02f41cd000fb9e40c79cd
parentffb15b2bc79b571b230570a41d971bb98744d712
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