diff mbox series

[3/3] xfs: convert flex-array declarations in xfs attr shortform objects

Message ID 168934592239.3368057.13821438121542148084.stgit@frogsfrogsfrogs (mailing list archive)
State Accepted, archived
Headers show
Series xfsprogs: ubsan fixes for 6.5-rc2 | expand

Commit Message

Darrick J. Wong July 14, 2023, 2:45 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Source kernel commit: 980f90c04e1b0fcbc4ccfb1009a724f38adced7d

As of 6.5-rc1, UBSAN trips over the ondisk extended attribute shortform
definitions using an array length of 1 to pretend to be a flex array.
Kernel compilers have to support unbounded array declarations, so let's
correct this.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 libxfs/xfs_da_format.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig July 14, 2023, 2:50 p.m. UTC | #1
No one ever does a sizeof here, so this looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/libxfs/xfs_da_format.h b/libxfs/xfs_da_format.h
index b2362717..f9015f88 100644
--- a/libxfs/xfs_da_format.h
+++ b/libxfs/xfs_da_format.h
@@ -591,7 +591,7 @@  struct xfs_attr_shortform {
 		uint8_t valuelen;	/* actual length of value (no NULL) */
 		uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
 		uint8_t nameval[];	/* name & value bytes concatenated */
-	} list[1];			/* variable sized array */
+	} list[];			/* variable sized array */
 };
 
 typedef struct xfs_attr_leaf_map {	/* RLE map of free bytes */