Commit 8426b7c6 authored by Dave Chinner's avatar Dave Chinner Committed by Long Li
Browse files

xfs: validate block number being freed before adding to xefi

mainline inclusion
from mainline-v6.4-rc5
commit 7dfee17b
category: bugfix
bugzilla: 188883, https://gitee.com/openeuler/kernel/issues/I76JSK
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7dfee17b13e5024c5c0ab1911859ded4182de3e5



--------------------------------

Bad things happen in defered extent freeing operations if it is
passed a bad block number in the xefi. This can come from a bogus
agno/agbno pair from deferred agfl freeing, or just a bad fsbno
being passed to __xfs_free_extent_later(). Either way, it's very
difficult to diagnose where a null perag oops in EFI creation
is coming from when the operation that queued the xefi has already
been completed and there's no longer any trace of it around....

Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>

Conflicts: fs/xfs/libxfs/xfs_ag.c
      fs/xfs/libxfs/xfs_alloc.c
      fs/xfs/libxfs/xfs_bmap.c
      fs/xfs/libxfs/xfs_bmap_btree.c
      fs/xfs/libxfs/xfs_ialloc.c
Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
parent 5772afa3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment