<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15330">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sgsn: Reject PdpActReq if no GTP pdp ctx exists<br><br>It could happen that SGSN drops GTP side of a pdp ctx (pdp->lib=NULL)<br>while still maintaing the other side (to notify about the entire pdp ctx<br>being torn down). If a PdpActReq arrives during that time, we need to<br>account for that situation, otherwise osmo-sgsn crashes accessing<br>pdp->lib.<br>If no pdp->lib is found at that time, let's reject the request and<br>expect at some point later in time the entire pdp context will be<br>destroyed and reestablished.<br><br>Related: OS#4173<br>Change-Id: I6dd87557ebb26fdbd280504abde10d976acecf64<br>---<br>M src/gprs/gprs_gmm.c<br>1 file changed, 5 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/30/15330/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c</span><br><span>index e44b3ec..5a0f72f 100644</span><br><span>--- a/src/gprs/gprs_gmm.c</span><br><span>+++ b/src/gprs/gprs_gmm.c</span><br><span>@@ -2713,6 +2713,11 @@</span><br><span>       /* Check if NSAPI is already in use */</span><br><span>       pdp = sgsn_pdp_ctx_by_nsapi(mmctx, act_req->req_nsapi);</span><br><span>   if (pdp) {</span><br><span style="color: hsl(120, 100%, 40%);">+            /* Make sure pdp ctx was not already torn down on GTP side */</span><br><span style="color: hsl(120, 100%, 40%);">+         if (!pdp->lib) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   gsm_cause = GSM_CAUSE_REACT_RQD;</span><br><span style="color: hsl(120, 100%, 40%);">+                      goto no_context;</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span>            /* We already have a PDP context for this TLLI + NSAPI tuple */</span><br><span>              if (pdp->sapi == act_req->req_llc_sapi &&</span><br><span>                  pdp->ti == transaction_id) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/15330">change 15330</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-sgsn/+/15330"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sgsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I6dd87557ebb26fdbd280504abde10d976acecf64 </div>
<div style="display:none"> Gerrit-Change-Number: 15330 </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>