]> git.ipfire.org Git - thirdparty/linux.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)
committerCarlos Maiolino <cem@kernel.org>
Tue, 16 Dec 2025 07:50:00 +0000 (08:50 +0100)
commit5990fd756943836978ad184aac980e2b36ab7e01
tree2451e2e7f7e722254e7123696489c37badb56e9d
parent2145f447b79ab522667cbdbdab4525c903759f7c
xfs: fix a UAF problem in xattr repair

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>
fs/xfs/scrub/attr_repair.c