Re: [REGRESSION][BISECTED] erroneous buffer overflow detected in bch2_xattr_validate
From: Jan Hendrik Farr
Date: Wed Oct 16 2024 - 20:41:57 EST
> I would be in favor of disabling __bdos on a whole struct pointer if
> it will match the functionality between the compilers. I don't think
> Qing has that on her plate at the moment, but when / if she revisits
> that we can discuss exactly how to perform the calculations then.
That's a good approach from my perspective.
To get this done we would:
Now:
1. Disable the __counted_by attribute calculation in clang for whole
struct __bdos cases like in [1] and get this into the next clang point
release (19.1.3)
2. In the kernel, disable __counted_by for clang versions < 19.1.3. Also
backport that into the stable kernels
In the future:
3. Try and figure out what the correct counted_by calculation for whole
structs should be in conjunction with gcc and clang. Either provide an
option in clang and gcc to follow the kernels expectations or change
struct_size in the kernel to match gcc's and clang's future behavior.
[1] https://github.com/llvm/llvm-project/pull/112636
Best Regards
Jan