<p>pespin <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17548">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">rlcmac: Reproduce and fix stack smashing bug receiving RA cap<br><br>RA cap struct placed in unit test is taken from a real android phone<br>sending the value when attaching to the network. Then SGSN sends it back<br>and osmo-pcu would crash similar to unit test:<br>*** stack smashing detected ***: terminated<br> Process terminating with default action of signal 6 (SIGABRT): dumping core<br>    at 0x4C62CE5: raise (in /usr/lib/libc-2.31.so)<br>    by 0x4C4C856: abort (in /usr/lib/libc-2.31.so)<br>    by 0x4CA62AF: __libc_message (in /usr/lib/libc-2.31.so)<br>    by 0x4D36069: __fortify_fail (in /usr/lib/libc-2.31.so)<br>    by 0x4D36033: __stack_chk_fail (in /usr/lib/libc-2.31.so)<br>    by 0x124706: testRAcap2(void*) (RLCMACTest.cpp:468)<br><br>So it seems the assumptions regarding maximum number of RA capabilitites<br>in one message were wrong. Doing some rough calculations, each RA<br>capabilitiy value (without extensions) can take around 20ish bits, which<br>means for a message containing up to 52 bytes that quite a lot of<br>different values could be theoretically fed in. Let's be safe and<br>increase the array size to be able to handle all different access<br>technologies listed in See TS 24.008 table 10.5.146 following<br>restrictions:<br>* "The MS Radio Access capability is a type 4 information element, with a maximum length of 52 octets."<br>* "Among the three Access Type Technologies GSM 900-P, GSM 900-E and GSM 900-R only one shall be present."<br>* "the mobile station should provide the relevant radio access<br>  capability for either GSM 1800 band OR GSM 1900 band, not both".<br><br>Wireshark requires similar fix (it's not important though because it<br>currently uses another ad-hoc decoder for RAcap).<br><br>Related: OS#4463<br>Change-Id: I5334eaacfbc238fae8bea50c9e9667c2117f81ff<br>---<br>M src/gsm_rlcmac.h<br>M tests/rlcmac/RLCMACTest.cpp<br>M tests/rlcmac/RLCMACTest.err<br>M tests/rlcmac/RLCMACTest.ok<br>4 files changed, 153 insertions(+), 15 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/48/17548/4</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/17548">change 17548</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/+/17548"/><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: I5334eaacfbc238fae8bea50c9e9667c2117f81ff </div>
<div style="display:none"> Gerrit-Change-Number: 17548 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>