]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: Fix deadlock when sending out-of-dialog requests. 12/1412/1
authorRichard Mudgett <rmudgett@digium.com>
Tue, 6 Oct 2015 23:01:37 +0000 (18:01 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 7 Oct 2015 17:07:58 +0000 (12:07 -0500)
commit3329c714f7c32f0aa0bc923e0b2dd599c0ecc5d5
tree734a60aa11ec5aad7303fc62a928e3f31f8c9200
parenta1435aa3fad5bda73a66dbccf3982787eff55ea2
res_pjsip: Fix deadlock when sending out-of-dialog requests.

The struct send_request_wrapper has a pjsip lock associated with it that
is created non-recursive.  There is a code path for the struct
send_request_wrapper lock that will attempt to lock it recursively.  The
reporter's deadlock showed that the thread calling endpt_send_request()
deadlocked itself right after the wrapper object got created.

Out-of-dialog requests such as MESSAGE, qualify OPTIONS, and unsolicited
MWI NOTIFY messages can hit this deadlock.

* Replaced the struct send_request_wrapper pjsip lock with the mutex lock
that can come with an ao2 object since all of Asterisk's mutexes are
recursive.  Benefits include removal of code maintaining the pjsip
non-recursive lock since ao2 objects already know how to maintain their
own lock and the lock will show up in the CLI "core show locks" output.

ASTERISK-25435 #close
Reported by: Dmitriy Serov

Change-Id: I458e131dd1b9816f9e963f796c54136e9e84322d
res/res_pjsip.c