diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-04-15 14:54:38 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-04-15 14:58:51 -0700 |
commit | d44bea9b41ca25f91fd9f25ed2cc3bb2f6dab4bc (patch) | |
tree | b44649d6b42f5e9c305bd1f5d52a62406eeddf68 /fs/xfs/xfs_attr_list.c | |
parent | 8c25dc728bd1ca9344001aa6ef4556885572baa4 (diff) | |
download | linux-d44bea9b41ca25f91fd9f25ed2cc3bb2f6dab4bc.tar.gz linux-d44bea9b41ca25f91fd9f25ed2cc3bb2f6dab4bc.tar.bz2 linux-d44bea9b41ca25f91fd9f25ed2cc3bb2f6dab4bc.zip |
xfs: validate dabtree node buffer owners
Check the owner field of dabtree node blocks.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_attr_list.c')
-rw-r--r-- | fs/xfs/xfs_attr_list.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c index f6496e33ff91..6a621f016f04 100644 --- a/fs/xfs/xfs_attr_list.c +++ b/fs/xfs/xfs_attr_list.c @@ -239,6 +239,10 @@ xfs_attr_node_list_lookup( goto out_corruptbuf; } + fa = xfs_da3_node_header_check(bp, dp->i_ino); + if (fa) + goto out_corruptbuf; + xfs_da3_node_hdr_from_disk(mp, &nodehdr, node); /* Tree taller than we can handle; bail out! */ @@ -335,6 +339,11 @@ xfs_attr_node_list( case XFS_DA_NODE_MAGIC: case XFS_DA3_NODE_MAGIC: trace_xfs_attr_list_wrong_blk(context); + fa = xfs_da3_node_header_check(bp, dp->i_ino); + if (fa) { + __xfs_buf_mark_corrupt(bp, fa); + xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK); + } xfs_trans_brelse(context->tp, bp); bp = NULL; break; |