<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/22451">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">NACC: Send only Pkt Cell Chg Continue if SI retrieve fails<br><br>If fore some reason we fail to fetch SI of target cell, we move<br>directly to NACC_ST_TX_CELL_CHG_CONTINUE in order to submit a Cell<br>Change Continue against the MS without providing any Packet Neighbor<br>Cell Data beforehand, as per spec that's probably the best we can do<br>in this scenario (TS 44.060):<br>"""<br>1)  The network responds with a PACKET CELL CHANGE CONTINUE message.<br>If a mobile station as response to a PACKET CELL CHANGE NOTIFICATION<br>message receives a PACKET CELL CHANGE CONTINUE message without receiving<br>any neighbour cell system information, the mobile station shall stop timer<br>T3208, stop timer T3210 if still running, leave CCN mode and continue cell<br>reselection in NC0/NC1 mode.<br>"""<br><br>This commit also fixes a use-after-free triggered by TTCN3 test<br>TC_nacc_outbound_rac_ci-resolve_fail_parse_response, where the "cmd"<br>pointer passed to nacc_fsm_ctrl_reply_cb() was freed during FSM<br>termination (its talloc ctx was under ctx->neigh_ctrl_conn) and the<br>libosmocore code calling that callback was later on accessing<br>cmd->defer.<br>Since due to this change the FSM is no longer syncrhonously freed, the<br>issue is gone.<br><br>Related: SYS#4909<br>Change-Id: Ie3f12a08ad611b1086d3f4ab7c3d34af43c07961<br>---<br>M src/nacc_fsm.c<br>1 file changed, 5 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/51/22451/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/nacc_fsm.c b/src/nacc_fsm.c</span><br><span>index a86a57d..c3464c8 100644</span><br><span>--- a/src/nacc_fsm.c</span><br><span>+++ b/src/nacc_fsm.c</span><br><span>@@ -324,7 +324,7 @@</span><br><span> </span><br><span> err_term:</span><br><span>     talloc_free(cmd);</span><br><span style="color: hsl(0, 100%, 40%);">-       osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+    nacc_fsm_state_chg(fi, NACC_ST_TX_CELL_CHG_CONTINUE);</span><br><span> }</span><br><span> </span><br><span> </span><br><span>@@ -365,14 +365,14 @@</span><br><span> </span><br><span>       /* SI info not in cache, resolve it using RIM procedure against SGSN */</span><br><span>      if (fill_rim_ran_info_req(ctx, &pdu) < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-              osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+            nacc_fsm_state_chg(fi, NACC_ST_TX_CELL_CHG_CONTINUE);</span><br><span>                return;</span><br><span>      }</span><br><span> </span><br><span>        rc = bssgp_tx_rim(&pdu, gprs_ns2_nse_nsei(ctx->ms->bts->nse));</span><br><span>  if (rc < 0) {</span><br><span>             LOGPFSML(fi, LOGL_ERROR, "Failed transmitting RIM PDU: %d\n", rc);</span><br><span style="color: hsl(0, 100%, 40%);">-            osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+            nacc_fsm_state_chg(fi, NACC_ST_TX_CELL_CHG_CONTINUE);</span><br><span>                return;</span><br><span>      }</span><br><span> }</span><br><span>@@ -559,7 +559,7 @@</span><br><span>                  cmd->type, cmd->variable, osmo_escape_str(cmd->reply, -1));</span><br><span> </span><br><span>    if (cmd->type != CTRL_TYPE_GET_REPLY || !cmd->reply) {</span><br><span style="color: hsl(0, 100%, 40%);">-            osmo_fsm_inst_term(ctx->fi, OSMO_FSM_TERM_ERROR, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+            nacc_fsm_state_chg(ctx->fi, NACC_ST_TX_CELL_CHG_CONTINUE);</span><br><span>                return;</span><br><span>      }</span><br><span> </span><br><span>@@ -599,7 +599,7 @@</span><br><span> </span><br><span> free_ret:</span><br><span>         talloc_free(tmp);</span><br><span style="color: hsl(0, 100%, 40%);">-       osmo_fsm_inst_term(ctx->fi, OSMO_FSM_TERM_ERROR, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+    nacc_fsm_state_chg(ctx->fi, NACC_ST_TX_CELL_CHG_CONTINUE);</span><br><span>        return;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/22451">change 22451</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/c/osmo-pcu/+/22451"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie3f12a08ad611b1086d3f4ab7c3d34af43c07961 </div>
<div style="display:none"> Gerrit-Change-Number: 22451 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>