]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: fix bounds check in xfs_defer_agfl_block()
authorDave Chinner <dchinner@redhat.com>
Wed, 6 Sep 2023 11:52:48 +0000 (13:52 +0200)
committerCarlos Maiolino <cem@kernel.org>
Thu, 7 Sep 2023 09:55:50 +0000 (11:55 +0200)
commitd096b26c33a858ad88db98306057da67e6d18611
treea71c4e83d90646f86ed6fc7cc0c71c54dc28523e
parent6ac452dcdd3ebefa34b0601ab5d231339afec8ad
xfs: fix bounds check in xfs_defer_agfl_block()

Source kernel commit: 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: 7dfee17b13e5 ("xfs: validate block number being freed before adding to xefi")
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_alloc.c