]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: distinguish between bnobt and cntbt magic values
authorBrian Foster <bfoster@redhat.com>
Mon, 6 May 2019 22:00:28 +0000 (18:00 -0400)
committerEric Sandeen <sandeen@redhat.com>
Mon, 6 May 2019 22:00:28 +0000 (18:00 -0400)
commit1d8220ba66913e61f23b362c82966d313d2d0232
tree1307ca8b60aebaed0989e01c653ee2edb2c96c12
parentfce74e98639a779327998695fcae1abe163ba96e
xfs: distinguish between bnobt and cntbt magic values

Source kernel commit: b8f89801664f8413a88cf2c7539d1aeae07dd3c5

The allocation btree verifiers share code that is unable to detect
cross-tree magic value corruptions such as a bnobt block with a
cntbt magic value. Populate the b_ops->magic field of the associated
verifier structures such that the structure verifier can check the
magic value against the expected value based on tree type.

The btree level check requires knowledge of the tree type to
determine the appropriate maximum value. This was previously part of
the hardcoded magic value checks. With that code removed, peek at
the first magic value in the verifier to determine the expected tree
type of the current block.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_alloc_btree.c