]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: More robust inode extent count validation
authorDave Chinner <dchinner@redhat.com>
Thu, 5 Jul 2018 20:16:04 +0000 (15:16 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 5 Jul 2018 20:16:04 +0000 (15:16 -0500)
commit8ac50bafe965954ed35f08418b625964150c2851
tree22d4ba07d603d4e2cab58eb2705c644374ef64bc
parenta3204ee74600ed275a1f322e30f15734b8a3c52b
xfs: More robust inode extent count validation

Source kernel commit: 23fcb3340d033d9f081e21e6c12c2db7eaa541d3

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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_format.h
libxfs/xfs_inode_buf.c