[asterisk-dev] [Code Review] 3055: pbx.c: retain lock around ast_exten use to prevent memory corruption

Scott Griepentrog reviewboard at asterisk.org
Fri Dec 6 14:45:51 CST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3055/
-----------------------------------------------------------

Review request for Asterisk Developers and Matt Jordan.


Bugs: AST-1179 and AST-1246
    https://issues.asterisk.org/jira/browse/AST-1179
    https://issues.asterisk.org/jira/browse/AST-1246


Repository: Asterisk


Description
-------

During dialplan execution in pbx_extension_helper(), the context global read lock is used prevent changes to the dialplan.  This patch moves the release of the lock to a point after the extension previously found is no longer being referenced -- after variable substitution, but before app execution.  This prevents the extension's allocation from being released by module reload when it is still being used in an expression evaluation.

A possible side effect of this change is that dialplan reload could be significantly delayed during evaluation of an expression containing a function such as SHELL().


Diffs
-----

  /certified/branches/1.8.15/main/pbx.c 403287 

Diff: https://reviewboard.asterisk.org/r/3055/diff/


Testing
-------

Testsuite test 'dialplan_stress' (https://reviewboard.asterisk.org/r/3056/) created to isolate this problem and test this fix.


Thanks,

Scott Griepentrog

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131206/217bf8ac/attachment.html>


More information about the asterisk-dev mailing list