<p>Pau Espin Pedrol <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/10578">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Fix heap-use-after-free due to OML link destruction<br><br>ipaccess_drop_oml was being called inside an osmo_fd cb context, were<br>-EBADF must be returned if the structure holding the osmo_fd is freed.<br>In the middle of the path (see OS#3495 for path tree) it goes through a<br>signal dispatch, so it's impossible to make sure we return some value to<br>the osmo_fd cb. As a result, it is required to defer dropping the OML<br>Link from current code path and do it through a timer.<br><br>Fixes following ASan report:<br>20180822124927913  <0004> abis_nm.c:787 OC=RADIO-CARRIER(02) INST=(00,00,ff): CHANGE ADMINISTRATIVE STATE NACK CAUSE=Message cannot be performed<br>20180822124927913  <0004> osmo_bsc_main.c:186 Got CHANGE ADMINISTRATIVE STATE NACK going to drop the OML links.<br>20180822124927913  <0015> bts_ipaccess_nanobts.c:406 (bts=0) Dropping OML link.<br>...<br>=================================================================<br>==17607==ERROR: AddressSanitizer: heap-use-after-free on address 0x62e000060a68 at pc 0x7f5ea8e27086 bp 0x7ffde92b6d80 sp 0x7ffde92b6d78<br>READ of size 8 at 0x62e000060a68 thread T0<br>    #0 0x7f5ea8e27085 in handle_ts1_write input/ipaccess.c:371<br>    #1 0x7f5ea8e27085 in ipaccess_fd_cb input/ipaccess.c:391<br>    #2 0x7f5ea9147ca8 in osmo_fd_disp_fds libosmocore/src/select.c:217<br>    #3 0x7f5ea9147ca8 in osmo_select_main libosmocore/src/select.c:257<br>    #4 0x555813ab79d6 in main osmo-bsc/osmo_bsc_main.c:922<br>    #5 0x7f5ea76d02e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)<br>    #6 0x555813ab84e9 in _start (/bin/osmo-bsc+0x34d4e9)<br><br>Fixes: OS#3495<br>Change-Id: I7c794c763481c28e8c35dc9b11d27969e16feb3c<br>---<br>M include/osmocom/bsc/gsm_data.h<br>M include/osmocom/bsc/ipaccess.h<br>M src/osmo-bsc/bts_ipaccess_nanobts.c<br>M src/osmo-bsc/osmo_bsc_main.c<br>4 files changed, 31 insertions(+), 2 deletions(-)<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/10578/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/10578">change 10578</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/10578"/><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-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I7c794c763481c28e8c35dc9b11d27969e16feb3c </div>
<div style="display:none"> Gerrit-Change-Number: 10578 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Jenkins Builder (1000002) </div>