<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmocom-bb/+/16088">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mobile/gsm48_mm.h: mark some structures as 'packed'<br><br>In several code paths we put / push structures from 'gsm48_mm.h' into<br>the message buffers, so then they're unpacked by the message receivers.<br><br>The AddressSanitizer complains about unaligned pointer access and<br>potentially unexpected behaviour. Let's fix this by explicitly<br>marking those structures as 'packed'.<br><br>Change-Id: I6af7475c609b3293af708540d569fe1616fab43f<br>---<br>M src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h<br>1 file changed, 3 insertions(+), 3 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/88/16088/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h</span><br><span>index 93e7c4c..09d18ed 100644</span><br><span>--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h</span><br><span>+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h</span><br><span>@@ -61,7 +61,7 @@</span><br><span>         uint8_t         sapi; /* sapi */</span><br><span>     uint8_t         emergency; /* emergency type of call */</span><br><span>      uint8_t         cause; /* cause used for release */</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(120, 100%, 40%);">+} __attribute__((packed));</span><br><span> </span><br><span> /* GSM 6.1.2 */</span><br><span> #define     GSM48_MMR_REG_REQ               0x01</span><br><span>@@ -74,7 +74,7 @@</span><br><span>     int             msg_type;</span><br><span> </span><br><span>        uint8_t         cause;</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(120, 100%, 40%);">+} __attribute__((packed));</span><br><span> </span><br><span> /* GSM 04.07 9.2.1 */</span><br><span> #define GSM48_MMXX_ST_IDLE         0</span><br><span>@@ -140,7 +140,7 @@</span><br><span>      uint32_t        msg_type;</span><br><span> </span><br><span>        uint8_t         sres[4];</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(120, 100%, 40%);">+} __attribute__((packed));</span><br><span> </span><br><span> /* GSM 04.08 MM timers */</span><br><span> #define GSM_T3210_MS    20, 0</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmocom-bb/+/16088">change 16088</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/+/16088"/><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: I6af7475c609b3293af708540d569fe1616fab43f </div>
<div style="display:none"> Gerrit-Change-Number: 16088 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>