Commit 85b0027e authored by Dave Chinner's avatar Dave Chinner Committed by Long Li
Browse files

xfs: fix bounds check in xfs_defer_agfl_block()

mainline inclusion
from mainline-v6.4-rc6
commit 2bed0d82
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=2bed0d82c2f78b91a0a9a5a73da57ee883a0c070



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

Need to happen before we allocate and then leak the xefi. Found by
coverity via an xfsprogs libxfs scan.

[djwong: This also fixes the type of the @agbno argument.]

Fixes: 7dfee17b ("xfs: validate block number being freed before adding to xefi")
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 avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>

Conflicts:
	fs/xfs/libxfs/xfs_alloc.c
parent e9b69fdb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment