<p>Neels Hofmeyr <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12397">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">release RTP stream only for matching CC transaction<br><br>Do not break the currently ongoing call when rejecting a second incoming<br>caller.<br><br>There may be multiple (up to seven) simultaneous CC transactions, and there is<br>one mgcp_ctx for the currently active RTP stream.<br><br>Release the MGCP context only when the active CC transaction is releasing.<br>Before this patch, any CC transaction release would destroy the single MGCP<br>context, possibly breaking the currently ongoing call (another CC trans).<br><br>This also fixes a possible use-after-free if there were pending MGCP message<br>responses for the MGCP context; they are canceled properly for a released<br>transaction, but since one transaction would free the other transaction's MGCP<br>state, the clean up did not take place and possibly caused an mgcp client<br>response handling to access a freed mgcp_ctx.<br><br>Related: OS#3735<br>Change-Id: I1f8746e7babfcd3028a4d2c0ba260c608c686c76<br>---<br>M src/libmsc/msc_mgcp.c<br>1 file changed, 6 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c</span><br><span>index 6170c10..23e68e7 100644</span><br><span>--- a/src/libmsc/msc_mgcp.c</span><br><span>+++ b/src/libmsc/msc_mgcp.c</span><br><span>@@ -1164,6 +1164,12 @@</span><br><span>             return -EINVAL;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (mgcp_ctx->trans != trans) {</span><br><span style="color: hsl(120, 100%, 40%);">+            LOGP(DMGCP, LOGL_DEBUG, "(ti %02x %s) call release for background CC transaction\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                     trans->transaction_id, vlr_subscr_name(trans->vsub));</span><br><span style="color: hsl(120, 100%, 40%);">+              return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  LOGP(DMGCP, LOGL_DEBUG, "(ti %02x %s) Call release: tearing down MGW endpoint\n",</span><br><span>       trans->transaction_id, vlr_subscr_name(trans->vsub));</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12397">change 12397</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12397"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I1f8746e7babfcd3028a4d2c0ba260c608c686c76 </div>
<div style="display:none"> Gerrit-Change-Number: 12397 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>