[asterisk-bugs] [Asterisk 0009379]: [patch] zt_specchan_open race because ZT_FLAG_OPEN testing and setting is not atomic

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Jan 11 14:09:35 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=9379 
====================================================================== 
Reported By:                Matti
Assigned To:                mattf
====================================================================== 
Project:                    Asterisk
Issue ID:                   9379
Category:                   Core/General
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.17 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        No 
Request Review:              
====================================================================== 
Date Submitted:             03-26-2007 07:55 CDT
Last Modified:              01-11-2008 14:09 CST
====================================================================== 
Summary:                    [patch] zt_specchan_open race because ZT_FLAG_OPEN
testing and setting is not atomic
Description: 
Function zt_specchan_open in file zaptel.c can have a race condition
because ZT_FLAG_OPEN testing and setting is not atomic. The function should
check and set the flag holding the spin lock continuously in and between
the following lines:
if (chans[unit]->flags & ZT_FLAG_OPEN)
chans[unit]->flags |= ZT_FLAG_OPEN;
====================================================================== 

---------------------------------------------------------------------- 
 markster - 01-11-08 14:09  
---------------------------------------------------------------------- 
Why don't we just use a test_and_set function here...  I think requiring
GFP_ATOMIC on resizing buffers is a really bad idea because it happens
frequently and potentially with many channels at the same time. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-11-08 14:09  markster       Note Added: 0076738                          
======================================================================




More information about the asterisk-bugs mailing list