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.

Fixes:		#15921
Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
  • Loading branch information
amotin committed Oct 4, 2024
1 parent 3d0175d commit f5d723e
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 f5d723e

Please sign in to comment.