From: Darrick J. Wong Date: Thu, 7 Sep 2023 09:41:01 +0000 (+0200) Subject: xfs: convert flex-array declarations in xfs attr shortform objects X-Git-Tag: v6.5.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e17ccef351b424b11ddccc9d228d02a025f9639a;p=thirdparty%2Fxfsprogs-dev.git xfs: convert flex-array declarations in xfs attr shortform objects Source kernel commit: f6250e205691a58c81be041b1809a2e706852641 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 Reviewed-by: Christoph Hellwig Reviewed-by: Kees Cook Signed-off-by: Carlos Maiolino --- diff --git a/libxfs/xfs_da_format.h b/libxfs/xfs_da_format.h index b2362717c..f9015f88e 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 */