Re: [REGRESSION][BISECTED] erroneous buffer overflow detected in bch2_xattr_validate

From: Miguel Ojeda
Date: Fri Oct 18 2024 - 07:52:30 EST


On Thu, Oct 17, 2024 at 8:55 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> The most "correct" Fixes tag would appear to be the one that first
> introduced __counted_by itself (dd06e72e68bc) but __counted_by can never
> be used at that original change because the test used __element_count__
> as the attribute name, which never shipped in any compiler. So I would
> argue that this change really does fix c8248faf3ca2 because that is the
> point in time that needs this fix.

That is fair, you are right.

> This is a good point, as technically to allow use of __counted_by with
> GCC with a version check, it would need to be 150000, which would
> potentially break GCC versions between the 15 version bump and landing
> __counted_by support without the feature check. We could also just do
> 150100 to be simple about it but I am not sure that is worth doing,
> since I believe it is important that we support using __counted_by with
> prerelease GCC. We want to make sure that this attribute gets decent
> testing coverage while in development.
>
> We could ship this with a comment to simplify the check when GCC 15.1.0
> is released, since this is a feature very unlikely to be backported to
> earlier GCC releases?

Thanks for the clear explanation! Yeah, if older not-yet-released GCC
15s are important for some people, then I think it is fair to have the
build test for the time being.

Cheers,
Miguel