linux/fs/xfs/libxfs
Darrick J. Wong 46c59736d8 xfs: harden directory integrity checks some more
If a malicious filesystem image contains a block+ format directory
wherein the directory inode's core.mode is set such that
S_ISDIR(core.mode) == 0, and if there are subdirectories of the
corrupted directory, an attempt to traverse up the directory tree will
crash the kernel in __xfs_dir3_data_check.  Running the online scrub's
parent checks will tend to do this.

The crash occurs because the directory inode's d_ops get set to
xfs_dir[23]_nondir_ops (it's not a directory) but the parent pointer
scrubber's indiscriminate call to xfs_readdir proceeds past the ASSERT
if we have non fatal asserts configured.

Fix the null pointer dereference crash in __xfs_dir3_data_check by
looking for S_ISDIR or wrong d_ops; and teach the parent scrubber
to bail out if it is fed a non-directory "parent".

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
2018-01-09 11:11:42 -08:00
..
xfs_ag_resv.c xfs: move error injection tags into their own file 2017-11-01 15:03:16 -07:00
xfs_ag_resv.h
xfs_alloc_btree.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_alloc_btree.h
xfs_alloc.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_alloc.h xfs: create block pointer check functions 2017-10-26 15:38:23 -07:00
xfs_attr_leaf.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_attr_leaf.h xfs: create structure verifier function for shortform xattrs 2018-01-08 10:54:46 -08:00
xfs_attr_remote.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_attr_remote.h
xfs_attr_sf.h
xfs_attr.c xfs: hold xfs_buf locked between shortform->leaf conversion and the addition of an attribute 2017-12-14 09:18:12 -08:00
xfs_bit.c
xfs_bit.h
xfs_bmap_btree.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_bmap_btree.h xfs: pass struct xfs_bmbt_irec to xfs_bmbt_validate_extent 2017-11-06 11:53:41 -08:00
xfs_bmap.c xfs: remove XFS_FSB_SANITY_CHECK 2018-01-08 10:54:45 -08:00
xfs_bmap.h xfs: simplify xfs_reflink_convert_cow 2017-11-06 11:53:40 -08:00
xfs_btree.c xfs: have buffer verifier functions report failing address 2018-01-08 10:54:46 -08:00
xfs_btree.h xfs: have buffer verifier functions report failing address 2018-01-08 10:54:46 -08:00
xfs_cksum.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xfs_da_btree.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_da_btree.h
xfs_da_format.c
xfs_da_format.h xfs: refactor the geometry structure filling function 2018-01-08 10:54:48 -08:00
xfs_defer.c xfs: add the ability to join a held buffer to a defer_ops 2017-12-14 09:17:35 -08:00
xfs_defer.h xfs: add the ability to join a held buffer to a defer_ops 2017-12-14 09:17:35 -08:00
xfs_dir2_block.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_dir2_data.c xfs: harden directory integrity checks some more 2018-01-09 11:11:42 -08:00
xfs_dir2_leaf.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_dir2_node.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_dir2_priv.h xfs: refactor short form directory structure verifier function 2018-01-08 10:54:46 -08:00
xfs_dir2_sf.c xfs: refactor short form directory structure verifier function 2018-01-08 10:54:46 -08:00
xfs_dir2.c xfs: refactor the geometry structure filling function 2018-01-08 10:54:48 -08:00
xfs_dir2.h xfs: scrub directory metadata 2017-10-26 15:38:25 -07:00
xfs_dquot_buf.c xfs: standardize quota verification function outputs 2018-01-08 10:54:47 -08:00
xfs_errortag.h xfs: move error injection tags into their own file 2017-11-01 15:03:16 -07:00
xfs_format.h xfs: remove u_int* type usage 2017-11-09 15:50:29 -08:00
xfs_fs.h xfs: scrub quota information 2017-10-26 15:38:26 -07:00
xfs_ialloc_btree.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_ialloc_btree.h
xfs_ialloc.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_ialloc.h xfs: remove "no-allocation" reservations for file creations 2017-12-08 17:51:05 -08:00
xfs_iext_tree.c xfs: move xfs_iext_insert tracepoint to report useful information 2017-12-14 09:20:11 -08:00
xfs_inode_buf.c xfs: move inode fork verifiers to xfs_dinode_verify 2018-01-08 10:54:46 -08:00
xfs_inode_buf.h xfs: have buffer verifier functions report failing address 2018-01-08 10:54:46 -08:00
xfs_inode_fork.c xfs: provide a centralized method for verifying inline fork data 2018-01-08 10:54:47 -08:00
xfs_inode_fork.h xfs: provide a centralized method for verifying inline fork data 2018-01-08 10:54:47 -08:00
xfs_log_format.h xfs: fix type usage 2017-11-16 12:06:45 -08:00
xfs_log_recover.h
xfs_log_rlimit.c xfs: trace log reservations at mount time 2018-01-08 10:54:47 -08:00
xfs_quota_defs.h xfs: standardize quota verification function outputs 2018-01-08 10:54:47 -08:00
xfs_refcount_btree.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_refcount_btree.h
xfs_refcount.c xfs: queue deferred rmap ops for cow staging extent alloc/free in the right order 2017-12-21 08:48:38 -08:00
xfs_refcount.h
xfs_rmap_btree.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_rmap_btree.h
xfs_rmap.c xfs: only skip rmap owner checks for unknown-owner rmap removal 2017-12-21 08:48:38 -08:00
xfs_rmap.h xfs: always honor OWN_UNKNOWN rmap removal requests 2017-12-21 08:48:38 -08:00
xfs_rtbitmap.c xfs: remove redundant assignment to variable bit 2017-10-31 12:03:35 -07:00
xfs_sb.c xfs: refactor the geometry structure filling function 2018-01-08 10:54:48 -08:00
xfs_sb.h xfs: refactor the geometry structure filling function 2018-01-08 10:54:48 -08:00
xfs_shared.h xfs: trace log reservations at mount time 2018-01-08 10:54:47 -08:00
xfs_symlink_remote.c xfs: create a new buf_ops pointer to verify structure metadata 2018-01-08 10:54:47 -08:00
xfs_trans_resv.c xfs: eliminate duplicate icreate tx reservation functions 2018-01-08 10:41:38 -08:00
xfs_trans_resv.h
xfs_trans_space.h
xfs_types.h xfs: move xfs_bmbt_irec and xfs_exntst_t to xfs_types.h 2017-11-06 11:53:41 -08:00