From 42ce4b11e72ab53ccc8f98841639a8979cafe3f5 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Fri, 4 Oct 2024 14:06:26 -0400 Subject: [PATCH] ZAP: Align za_name in zap_attribute_t to 8 bytes Our code reading/writing there may not handle misaligned accesses on a platforms that may care about it. I don't see a point to complicate it to satisfy UBSan in CI. This alignment costs nothing. Reviewed-by: Brian Behlendorf Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #15921 Closes #16606 --- include/sys/zap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sys/zap.h b/include/sys/zap.h index 43e8bbea1991..53166e094a72 100644 --- a/include/sys/zap.h +++ b/include/sys/zap.h @@ -377,6 +377,7 @@ typedef struct { uint64_t za_num_integers; uint64_t za_first_integer; /* no sign extension for <8byte ints */ uint32_t za_name_len; + uint32_t za_pad; /* We want za_name aligned to uint64_t. */ char za_name[]; } zap_attribute_t;