[Skiboot] [PATCH 06/13] hdata: Reduce 'struct HDIF_array_hdr' alignment to 4 bytes
Stewart Smith
stewart at linux.vnet.ibm.com
Wed Aug 23 17:21:16 AEST 2017
UBSan threw up the following:
hdata/test/../hdif.c:96:9: runtime error: member access within misaligned address 0x7f9ad8b02c18 for type 'const struct HDIF_array_hdr', which requires 16 byte alignment
0x7f9ad8b02c18: note: pointer points here
00 00 00 00 00 00 00 10 00 00 00 08 00 00 00 14 00 00 00 14 00 00 00 20 00 00 00 00 80 03 ff ff
^
Real data we're parsing doesn't enforce that alignment requirement,
so we shouldn't rely on it.
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
hdata/hdif.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hdata/hdif.h b/hdata/hdif.h
index ef03522aca8b..22345b368eca 100644
--- a/hdata/hdif.h
+++ b/hdata/hdif.h
@@ -44,7 +44,7 @@ struct HDIF_array_hdr {
__be32 ecnt;
__be32 esize;
__be32 eactsz;
-} __packed __align(0x10);
+} __packed __align(0x4);
struct HDIF_child_ptr {
__be32 offset;
--
2.13.5
More information about the Skiboot
mailing list