]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Prevent deadlock in chan_iax2 when attempting to set caller ID
authorMatthew Jordan <mjordan@digium.com>
Thu, 28 Feb 2013 17:16:31 +0000 (17:16 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 28 Feb 2013 17:16:31 +0000 (17:16 +0000)
commitb056a88e0839cd5e2729a1de046f2f7741df5bd9
tree2978210eadf5d4ea585f222944c25daa5200c137
parent47bd918dadd8a4fb12c86dfa36b82281226c203c
Prevent deadlock in chan_iax2 when attempting to set caller ID

A deadlock can occur in chan_iax2 when it attempts to set the caller ID, as it
already holds the iax2 private lock and improperly fails to obtain the channel
lock before calling ast_set_callerid. By not safely obtaining the channel lock,
a locking inversion can take place, causing a deadlock.

This patch solves this by calling the required deadlock avoidance functions
that obtain the channel lock before setting the caller ID.

Thanks to Pavel for fixing my syntax errors and testing this patch out.

(closes issue ASTERISK-21128)
Reported by: Pavel Troller
Tested by: Pavel Troller
patches:
  ASTERISK-21128-1.8.diff uploaded by mjordan (license 6283)
  ASTERISK-21128-modified-1.8.diff uploaded by Pavel Troller (license 6302)
........

Merged revisions 382233 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@382234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_iax2.c