<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmocom-bb/+/24627">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">host/layer23/ccch_scan: skip CCCH frames with wrong length<br><br>It's not clear why do we get frames with unexpected length, but<br>we definitely should not crash.  Just ignore them.<br><br>Change-Id: I85392becbffdb3ba7365decfd8f3769abe3c02c7<br>Related: OS#5171<br>---<br>M src/host/layer23/src/misc/app_ccch_scan.c<br>1 file changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/27/24627/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/host/layer23/src/misc/app_ccch_scan.c b/src/host/layer23/src/misc/app_ccch_scan.c</span><br><span>index be2d9ae..c5017be 100644</span><br><span>--- a/src/host/layer23/src/misc/app_ccch_scan.c</span><br><span>+++ b/src/host/layer23/src/misc/app_ccch_scan.c</span><br><span>@@ -409,6 +409,13 @@</span><br><span>    struct gsm48_system_information_type_header *sih = msgb_l3(msg);</span><br><span>     int rc = 0;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+       /* Skip frames with wrong length */</span><br><span style="color: hsl(120, 100%, 40%);">+   if (msgb_l3len(msg) != GSM_MACBLOCK_LEN) {</span><br><span style="color: hsl(120, 100%, 40%);">+            LOGP(DRR, LOGL_ERROR, "Rx CCCH message with odd length=%u",</span><br><span style="color: hsl(120, 100%, 40%);">+              msgb_l3len(msg));</span><br><span style="color: hsl(120, 100%, 40%);">+                return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  /* Skip dummy (fill) frames */</span><br><span>       if (is_fill_frame(msg))</span><br><span>              return 0;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmocom-bb/+/24627">change 24627</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/osmocom-bb/+/24627"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmocom-bb </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I85392becbffdb3ba7365decfd8f3769abe3c02c7 </div>
<div style="display:none"> Gerrit-Change-Number: 24627 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>