mirror of https://gitee.com/openkylin/linux.git
xfs: check owner of dir3 free blocks
Check the owner field of dir3 free block headers and reject the metadata if there's something wrong with it. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Allison Collins <allison.henderson@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
parent
1cb5deb5bc
commit
6fb5aac733
|
@ -194,6 +194,8 @@ xfs_dir3_free_header_check(
|
|||
return __this_address;
|
||||
if (be32_to_cpu(hdr3->nvalid) < be32_to_cpu(hdr3->nused))
|
||||
return __this_address;
|
||||
if (be64_to_cpu(hdr3->hdr.owner) != dp->i_ino)
|
||||
return __this_address;
|
||||
} else {
|
||||
struct xfs_dir2_free_hdr *hdr = bp->b_addr;
|
||||
|
||||
|
|
Loading…
Reference in New Issue