<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/15799">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Fix assertion hit upon CCCH Paging Request<br><br>Recent commit added an assertion to check for buffer boundaries and it<br>actually gets hit.<br>One of the 2 code paths calling pcu_l1if_tx_pch() was passing a buffer<br>of 23 bytes while one of maximum 22 is expected (because plen is not set<br>in the buffer but set inside pcu_l1if_tx_pch()).<br>So it seems before the assert, that code path was actually writing 1<br>byte outside the boundaries of data buffer, since bitvec_pack() uses<br>data_len field of bitvec.<br><br>Related: OS#4228<br>Fixes: 8dc09e73d0b361b27232526ebcd5f25cd8c7edfd<br>Change-Id: I84c5dfd4d5580e9d4c00ed21887cb51bd9abbd2e<br>---<br>M src/gprs_rlcmac.cpp<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/99/15799/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp</span><br><span>index 4d93f8f..7a98a25 100644</span><br><span>--- a/src/gprs_rlcmac.cpp</span><br><span>+++ b/src/gprs_rlcmac.cpp</span><br><span>@@ -32,7 +32,7 @@</span><br><span>     const char *imsi)</span><br><span> {</span><br><span>       LOGP(DRLCMAC, LOGL_NOTICE, "TX: [PCU -> BTS] Paging Request (CCCH)\n");</span><br><span style="color: hsl(0, 100%, 40%);">-    bitvec *paging_request = bitvec_alloc(23, tall_pcu_ctx);</span><br><span style="color: hsl(120, 100%, 40%);">+      bitvec *paging_request = bitvec_alloc(22, tall_pcu_ctx);</span><br><span>     bitvec_unhex(paging_request, DUMMY_VEC);</span><br><span>     int plen = Encoding::write_paging_request(paging_request, ptmsi, ptmsi_len);</span><br><span>         pcu_l1if_tx_pch(paging_request, plen, (char *)imsi);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/15799">change 15799</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/+/15799"/><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: I84c5dfd4d5580e9d4c00ed21887cb51bd9abbd2e </div>
<div style="display:none"> Gerrit-Change-Number: 15799 </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>