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
Kconfig -rw-r--r-- 1.3 KB
Makefile -rw-r--r-- 285 bytes
awacs.c -rw-r--r-- 31.8 KB
awacs.h -rw-r--r-- 8.0 KB
beep.c -rw-r--r-- 7.7 KB
burgundy.c -rw-r--r-- 24.3 KB
burgundy.h -rw-r--r-- 4.0 KB
daca.c -rw-r--r-- 6.9 KB
keywest.c -rw-r--r-- 4.3 KB
pmac.c -rw-r--r-- 37.2 KB
pmac.h -rw-r--r-- 5.1 KB
powermac.c -rw-r--r-- 5.1 KB
snd_ps3.c -rw-r--r-- 28.6 KB
snd_ps3.h -rw-r--r-- 3.5 KB
snd_ps3_reg.h -rw-r--r-- 33.2 KB
tumbler.c -rw-r--r-- 38.3 KB
tumbler_volume.h -rw-r--r-- 6.5 KB

back to top