Hi me, Please pull the final versions of the log item recovery bugfixes into for-next. --D ------ The following changes since commit 47ba8cc7b4f82c927cec3ad7c7392e4c45c81c56: xfs: fix incorrect return type for fsdax fault handlers (2022-10-31 08:51:45 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git tags/fix-log-recovery-misuse-6.1_2022-10-31 for you to fetch changes up to 950f0d50ee7138d7e631aefea8528d485426eda6: xfs: dump corrupt recovered log intent items to dmesg consistently (2022-10-31 08:58:20 -0700) ---------------------------------------------------------------- xfs: fix various problems with log intent item recovery Starting with 6.1-rc1, CONFIG_FORTIFY_SOURCE checks became smart enough to detect memcpy() callers that copy beyond what seems to be the end of a struct. Unfortunately, gcc has a bug wherein it cannot reliably compute the size of a struct containing another struct containing a flex array at the end. This is the case with the xfs log item format structures, which means that -rc1 starts complaining all over the place. Fix these problems by memcpying the struct head and the flex arrays separately. Although it's tempting to use the FLEX_ARRAY macros, the structs involved are part of the ondisk log format. Some day we're going to want to make the ondisk log contents endian-safe, which means that we will have to stop using memcpy entirely. While we're at it, fix some deficiencies in the validation of recovered log intent items -- if the size of the recovery buffer is not even large enough to cover the flex array record count in the head, we should abort the recovery of that item immediately. The last patch of this series changes the EFI/EFD sizeof functions names and behaviors to be consistent with the similarly named sizeof helpers for other log intent items. v2: fix more inadequate log intent done recovery validation and dump corrupt recovered items Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> ---------------------------------------------------------------- Darrick J. Wong (8): xfs: fix validation in attr log item recovery xfs: fix memcpy fortify errors in BUI log format copying xfs: fix memcpy fortify errors in CUI log format copying xfs: fix memcpy fortify errors in RUI log format copying xfs: fix memcpy fortify errors in EFI log format copying xfs: refactor all the EFI/EFD log item sizeof logic xfs: actually abort log recovery on corrupt intent-done log items xfs: dump corrupt recovered log intent items to dmesg consistently fs/xfs/libxfs/xfs_log_format.h | 60 ++++++++++++++++++++++++--- fs/xfs/xfs_attr_item.c | 67 +++++++++++++++--------------- fs/xfs/xfs_bmap_item.c | 54 ++++++++++++------------ fs/xfs/xfs_extfree_item.c | 94 ++++++++++++++++++++---------------------- fs/xfs/xfs_extfree_item.h | 16 +++++++ fs/xfs/xfs_ondisk.h | 23 +++++++++-- fs/xfs/xfs_refcount_item.c | 57 +++++++++++++------------ fs/xfs/xfs_rmap_item.c | 70 ++++++++++++++++--------------- fs/xfs/xfs_super.c | 12 ++---- 9 files changed, 266 insertions(+), 187 deletions(-)