Merge tag 'scrub-fix-xattr-memory-mgmt-6.4_2023-04-11' of git://git.kernel.org/pub...
authorDave Chinner <david@fromorbit.com>
Thu, 13 Apr 2023 21:11:10 +0000 (07:11 +1000)
committerDave Chinner <dchinner@redhat.com>
Thu, 13 Apr 2023 21:11:10 +0000 (07:11 +1000)
commitbb09d76599ededce8c08ef7c446b28f22ff730a8
tree47275dcfc168a9e3e752e43b58e2974290691796
parentb9fcf89f6b9a2f83d46469469b18f926d327733c
parent44af6c7e59b12d740809cf25a60c9f90f03e6d20
Merge tag 'scrub-fix-xattr-memory-mgmt-6.4_2023-04-11' of git://git./linux/kernel/git/djwong/xfs-linux into guilt/xfs-for-next

xfs: clean up memory management in xattr scrub [v24.5]

Currently, the extended attribute scrubber uses a single VLA to store
all the context information needed in various parts of the scrubber
code.  This includes xattr leaf block space usage bitmaps, and the value
buffer used to check the correctness of remote xattr value block
headers.  We try to minimize the insanity through the use of helper
functions, but this is a memory management nightmare.  Clean this up by
making the bitmap and value pointers explicit members of struct
xchk_xattr_buf.

Second, strengthen the xattr checking by teaching it to look for overlapping
data structures in the shortform attr data.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>