[asterisk-bugs] [Asterisk 0014623]: [patch] Race condition between bridge and channel masquerading

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Mar 11 16:55:26 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14623 
====================================================================== 
Reported By:                guillecabeza
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   14623
Category:                   Core/Channels
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 180032 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-03-08 16:07 CDT
Last Modified:              2009-03-11 16:55 CDT
====================================================================== 
Summary:                    [patch] Race condition between bridge and channel
masquerading
Description: 
The bridge checks for zombieness

/* Stop if we're a zombie or need a soft hangup */
		if (ast_test_flag(c0, AST_FLAG_ZOMBIE) || ast_check_hangup_locked(c0)
||
		    ast_test_flag(c1, AST_FLAG_ZOMBIE) || ast_check_hangup_locked(c1))
{

To see if some of the channels is going through a masquerading, but non
atomically, access to channel member variables happens a few lines later

if (!ast_strlen_zero(pbx_builtin_getvar_helper(c0, "BRIDGEPEER")))
     pbx_builtin_setvar_helper(c0, "BRIDGEPEER", c1->name);

Without locking on those acceses. That causes random crashes when the
memory is touched or free'd later.

====================================================================== 

---------------------------------------------------------------------- 
 (0101596) svnbot (reporter) - 2009-03-11 16:55
 http://bugs.digium.com/view.php?id=14623#c101596 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 181425

_U  branches/1.6.0/
U   branches/1.6.0/main/channel.c

------------------------------------------------------------------------
r181425 | russell | 2009-03-11 16:55:25 -0500 (Wed, 11 Mar 2009) | 25
lines

Merged revisions 181424 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r181424 | russell | 2009-03-11 16:49:29 -0500 (Wed, 11 Mar 2009) | 17
lines

Merged revisions 181423 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r181423 | russell | 2009-03-11 16:42:58 -0500 (Wed, 11 Mar 2009) | 9 lines

Make code that updates BRIDGEPEER variable thread-safe.

It is not safe to read the name field of an ast_channel without the
channel
locked.  This patch fixes some places in channel.c where this was being
done,
and lead to crashes related to masquerades.

(closes issue http://bugs.digium.com/view.php?id=14623)
Reported by: guillecabeza

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=181425 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-11 16:55 svnbot         Checkin                                      
2009-03-11 16:55 svnbot         Note Added: 0101596                          
======================================================================




More information about the asterisk-bugs mailing list