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
File Mode Size
ext
Kconfig -rw-r--r-- 697 bytes
Makefile -rw-r--r-- 385 bytes
array.c -rw-r--r-- 1.2 KB
hda_bus_type.c -rw-r--r-- 2.1 KB
hdac_bus.c -rw-r--r-- 5.4 KB
hdac_controller.c -rw-r--r-- 15.3 KB
hdac_device.c -rw-r--r-- 26.9 KB
hdac_i915.c -rw-r--r-- 11.8 KB
hdac_regmap.c -rw-r--r-- 13.1 KB
hdac_stream.c -rw-r--r-- 19.3 KB
hdac_sysfs.c -rw-r--r-- 9.9 KB
hdmi_chmap.c -rw-r--r-- 24.2 KB
local.h -rw-r--r-- 791 bytes
trace.c -rw-r--r-- 107 bytes
trace.h -rw-r--r-- 2.1 KB

back to top