[PATCHSET v24.0 00/11] xfs: clean up memory management in xattr scrub

Darrick J. Wong
2022-12-30T22:27:50Z

Hi all,

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.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything. Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=scrub-fix-xattr-memory-mgmt
---
fs/xfs/scrub/attr.c | 298 +++++++++++++++++++++++++++++++++++---------------
fs/xfs/scrub/attr.h | 60 +---------
fs/xfs/scrub/scrub.c | 3 +
fs/xfs/scrub/scrub.h | 10 ++
4 files changed, 231 insertions(+), 140 deletions(-)