https://github.com/torvalds/linux
Revision 3c6f46eacd876bd723a9bad3c6882714c052fd8e authored by Amir Goldstein on 17 January 2017, 19:41:41 UTC, committed by Darrick J. Wong on 17 January 2017, 19:41:41 UTC
This changes fixes an assertion hit when fuzzing on-disk
i_mode values.

The easy case to fix is when changing an empty file
i_mode to S_IFDIR. In this case, xfs_dinode_verify()
detects an illegal zero size for directory and fails
to load the inode structure from disk.

For the case of non empty file whose i_mode is changed
to S_IFDIR, the ASSERT() statement in xfs_dir2_isblock()
is replaced with return -EFSCORRUPTED, to avoid interacting
with corrupted jusk also when XFS_DEBUG is disabled.

Suggested-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 parent bf46ecc
History
Tip revision: 3c6f46eacd876bd723a9bad3c6882714c052fd8e authored by Amir Goldstein on 17 January 2017, 19:41:41 UTC
xfs: sanity check directory inode di_size
Tip revision: 3c6f46e

back to top