]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix a UAF problem in xattr repair
authorDarrick J. Wong <djwong@kernel.org>
Thu, 4 Dec 2025 21:43:50 +0000 (13:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:23 +0000 (10:14 +0100)
commit1e2d3aa19c7962b9474b22893160cb460494c45f
tree5783a55d5db2e1c76e1b542a2cb74b8e51409bb5
parent561e0756f1bfe2c30e2f2fff482e14763c809ae3
xfs: fix a UAF problem in xattr repair

commit 5990fd756943836978ad184aac980e2b36ab7e01 upstream.

The xchk_setup_xattr_buf function can allocate a new value buffer, which
means that any reference to ab->value before the call could become a
dangling pointer.  Fix this by moving an assignment to after the buffer
setup.

Cc: stable@vger.kernel.org # v6.10
Fixes: e47dcf113ae348 ("xfs: repair extended attributes")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/scrub/attr_repair.c