Skip to content

Commit

Permalink
ZAP: Align za_name in zap_attribute_t to 8 bytes
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
Closes #15921
Closes #16606
  • Loading branch information
amotin authored Oct 4, 2024
1 parent 4ebe674 commit 42ce4b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/sys/zap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 42ce4b1

Please sign in to comment.