<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20078">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">abis_rsl: fix memleak in rach dos reduction function<br><br>The function reduce_rach_dos() only removes the tossed channel requests<br>from the list, but does not free them.<br><br>Change-Id: I0a62fc897c07e118dd637b156b6f2822c44db731<br>Related: OS#4549<br>---<br>M src/osmo-bsc/abis_rsl.c<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/20078/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c</span><br><span>index 347be12..2af01d9 100644</span><br><span>--- a/src/osmo-bsc/abis_rsl.c</span><br><span>+++ b/src/osmo-bsc/abis_rsl.c</span><br><span>@@ -1389,6 +1389,7 @@</span><br><span>                                 "(ra=0x%02x, neci=0x%02x, chreq_reason=0x%02x)\n",</span><br><span>                                 rqd->ref.ra, bts->network->neci, rqd->reason);</span><br><span>                   llist_del(&rqd->entry);</span><br><span style="color: hsl(120, 100%, 40%);">+                        talloc_free(rqd);</span><br><span>            } else {</span><br><span>                     rqd_count++;</span><br><span>                 }</span><br><span>@@ -1398,7 +1399,9 @@</span><br><span>     * problem with RACH dos on this BTS. We drop the first entry in the list to clip the growth of the list. */</span><br><span>         if (rqd_count > 255) {</span><br><span>            LOG_BTS(bts, DRSL, LOGL_INFO, "CHAN RQD: more than 255 queued RACH requests -- RACH DoS attack?\n");</span><br><span style="color: hsl(0, 100%, 40%);">-          llist_del(&llist_first_entry(&bts->chan_rqd_queue, struct chan_rqd, entry)->entry);</span><br><span style="color: hsl(120, 100%, 40%);">+             rqd = llist_first_entry(&bts->chan_rqd_queue, struct chan_rqd, entry);</span><br><span style="color: hsl(120, 100%, 40%);">+         llist_del(&rqd->entry);</span><br><span style="color: hsl(120, 100%, 40%);">+                talloc_free(rqd);</span><br><span>    }</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20078">change 20078</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-bsc/+/20078"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I0a62fc897c07e118dd637b156b6f2822c44db731 </div>
<div style="display:none"> Gerrit-Change-Number: 20078 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>