OrangePi_CM5/fs/xfs/libxfs
Dave Chinner dce4662869 xfs: validate inode fork size against fork format
commit 1eb70f54c445fcbb25817841e774adb3d912f3e8 upstream.

[backport for 5.10.y]

xfs_repair catches fork size/format mismatches, but the in-kernel
verifier doesn't, leading to null pointer failures when attempting
to perform operations on the fork. This can occur in the
xfs_dir_is_empty() where the in-memory fork format does not match
the size and so the fork data pointer is accessed incorrectly.

Note: this causes new failures in xfs/348 which is testing mode vs
ftype mismatches. We now detect a regular file that has been changed
to a directory or symlink mode as being corrupt because the data
fork is for a symlink or directory should be in local form when
there are only 3 bytes of data in the data fork. Hence the inode
verify for the regular file now fires w/ -EFSCORRUPTED because
the inode fork format does not match the format the corrupted mode
says it should be in.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-28 11:10:29 +02:00
..
xfs_ag.c xfs: store inode btree block counts in AGI header 2020-09-15 20:52:39 -07:00
xfs_ag.h
…
xfs_ag_resv.c
…
xfs_ag_resv.h
…
xfs_alloc.c xfs: set xefi_discard when creating a deferred agfl free log intent item 2020-10-29 08:19:18 -07:00
xfs_alloc.h
…
xfs_alloc_btree.c
…
xfs_alloc_btree.h
…
xfs_attr.c xfs: Fix the free logic of state in xfs_attr_node_hasname 2022-07-02 16:39:24 +02:00
xfs_attr.h
…
xfs_attr_leaf.c xfs: fix forkoff miscalculation related to XFS_LITINO(mp) 2020-11-18 09:23:51 -08:00
xfs_attr_leaf.h
…
xfs_attr_remote.c xfs: remove the redundant crc feature check in xfs_attr3_rmt_verify 2020-09-25 11:34:07 -07:00
xfs_attr_remote.h
…
xfs_attr_sf.h xfs: Convert xfs_attr_sf macros to inline functions 2020-09-15 20:52:42 -07:00
xfs_bit.c
…
xfs_bit.h
…
xfs_bmap.c xfs: detect overflows in bmbt records 2022-06-06 08:42:41 +02:00
xfs_bmap.h xfs: set xefi_discard when creating a deferred agfl free log intent item 2020-10-29 08:19:18 -07:00
xfs_bmap_btree.c
…
xfs_bmap_btree.h
…
xfs_btree.c xfs: use current->journal_info for detecting transaction recursion 2022-07-07 17:52:19 +02:00
xfs_btree.h
…
xfs_btree_staging.c
…
xfs_btree_staging.h
…
xfs_cksum.h
…
xfs_da_btree.c
…
xfs_da_btree.h
…
xfs_da_format.h xfs: code cleanup in xfs_attr_leaf_entsize_{remote,local} 2020-09-25 11:34:08 -07:00
xfs_defer.c xfs: only relog deferred intent items if free space in the log gets low 2020-10-07 08:40:29 -07:00
xfs_defer.h xfs: fix an incore inode UAF in xfs_bui_recover 2020-10-07 08:40:28 -07:00
xfs_dir2.c
…
xfs_dir2.h xfs: fix an ABBA deadlock in xfs_rename 2022-06-06 08:42:42 +02:00
xfs_dir2_block.c
…
xfs_dir2_data.c
…
xfs_dir2_leaf.c
…
xfs_dir2_node.c
…
xfs_dir2_priv.h
…
xfs_dir2_sf.c xfs: fix an ABBA deadlock in xfs_rename 2022-06-06 08:42:42 +02:00
xfs_dquot_buf.c xfs: widen ondisk quota expiration timestamps to handle y2038+ 2020-09-15 20:52:41 -07:00
xfs_errortag.h
…
xfs_format.h xfs: enable big timestamps 2020-09-15 20:52:41 -07:00
xfs_fs.h xfs: widen ondisk inode timestamps to deal with y2038+ 2020-09-15 20:52:41 -07:00
xfs_health.h
…
xfs_ialloc.c xfs: widen ondisk inode timestamps to deal with y2038+ 2020-09-15 20:52:41 -07:00
xfs_ialloc.h
…
xfs_ialloc_btree.c xfs: support inode btree blockcounts in online repair 2020-09-15 20:52:40 -07:00
xfs_ialloc_btree.h
…
xfs_iext_tree.c xfs: remove kmem_realloc() 2020-09-06 18:05:51 -07:00
xfs_inode_buf.c xfs: validate inode fork size against fork format 2022-09-28 11:10:29 +02:00
xfs_inode_buf.h xfs: use the existing type definition for di_projid 2020-09-25 11:34:07 -07:00
xfs_inode_fork.c xfs: remove kmem_realloc() 2020-09-06 18:05:51 -07:00
xfs_inode_fork.h
…
xfs_log_format.h xfs: logging the on disk inode LSN can make it go backwards 2022-08-03 12:00:51 +02:00
xfs_log_recover.h xfs: remove xlog_recover_iodone 2020-09-15 20:52:39 -07:00
xfs_log_rlimit.c
…
xfs_quota_defs.h xfs: widen ondisk quota expiration timestamps to handle y2038+ 2020-09-15 20:52:41 -07:00
xfs_refcount.c
…
xfs_refcount.h
…
xfs_refcount_btree.c
…
xfs_refcount_btree.h
…
xfs_rmap.c xfs: fix flags argument to rmap lookup when converting shared file rmaps 2020-11-10 16:47:34 -08:00
xfs_rmap.h
…
xfs_rmap_btree.c xfs: revert "xfs: fix rmap key and record comparison functions" 2020-11-19 15:17:50 -08:00
xfs_rmap_btree.h
…
xfs_rtbitmap.c xfs: fix high key handling in the rt allocator's query_range function 2020-10-16 15:34:28 -07:00
xfs_sb.c xfs: update superblock counters correctly for !lazysbcount 2022-07-07 17:52:20 +02:00
xfs_sb.h
…
xfs_shared.h xfs: widen ondisk inode timestamps to deal with y2038+ 2020-09-15 20:52:41 -07:00
xfs_symlink_remote.c
…
xfs_trans_inode.c xfs: widen ondisk inode timestamps to deal with y2038+ 2020-09-15 20:52:41 -07:00
xfs_trans_resv.c
…
xfs_trans_resv.h
…
xfs_trans_space.h
…
xfs_types.c
…
xfs_types.h xfs: xfs_log_force_lsn isn't passed a LSN 2022-08-03 12:00:50 +02:00