Change in osmocom-bb[master]: mobile/gsm48_rr.h: mark gsm48_rr_hdr struct as packed

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu May 2 23:48:26 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13856 )

Change subject: mobile/gsm48_rr.h: mark gsm48_rr_hdr struct as packed
......................................................................

mobile/gsm48_rr.h: mark gsm48_rr_hdr struct as packed

In both gsm48_mm.c and gsm48_rr.c we put / push 'gsm48_rr_hdr'
structure into the message buffers, so then it's retrieved by
the message receivers. The AddressSanitizer complains about
unaligned pointer access and potentially unexpected behaviour.

Change-Id: I8aa2c0074b405afd0e76044ef076b6819fe1083b
---
M src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
index 6235bfd..6996ff3 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
@@ -61,7 +61,7 @@
 	uint32_t		msg_type; /* RR-* primitive */
 	uint8_t			sapi;
 	uint8_t			cause;
-};
+} __attribute__((packed));
 
 /* GSM 04.07 9.1.1 */
 #define GSM48_RR_ST_IDLE		0

-- 
To view, visit https://gerrit.osmocom.org/13856
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8aa2c0074b405afd0e76044ef076b6819fe1083b
Gerrit-Change-Number: 13856
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190502/b5d6462d/attachment.html>


More information about the gerrit-log mailing list