]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: More robust inode extent count validation
authorDave Chinner <dchinner@redhat.com>
Fri, 22 Jun 2018 06:25:57 +0000 (23:25 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 22 Jun 2018 06:25:57 +0000 (23:25 -0700)
commit0895b73d2797b5044a2c04c2f6b85696dac5abe6
tree169cc8eaec84806931df8382491cad85d57de876
parentef741e2fc99f1ebe6d05b871f62e0b07797aa1a9
xfs: More robust inode extent count validation

When the inode is in extent format, it can't have more extents that
fit in the inode fork. We don't currenty check this, and so this
corruption goes unnoticed by the inode verifiers. This can lead to
crashes operating on invalid in-memory structures.

Attempts to access such a inode will now error out in the verifier
rather than allowing modification operations to proceed.

Reported-by: Wen Xu <wen.xu@gatech.edu>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: fix a typedef, add some braces and breaks to shut up compiler warnings]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_format.h
fs/xfs/libxfs/xfs_inode_buf.c