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 <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15921
Closes #16606
This commit is contained in:
Alexander Motin 2024-10-04 14:06:26 -04:00 committed by GitHub
parent 4ebe674d91
commit 42ce4b11e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;