Re: [GIT PULL] hardening updates for v6.5-rc1

From: Christoph Hellwig
Date: Wed Jun 28 2023 - 05:27:40 EST


On Tue, Jun 27, 2023 at 05:34:57PM -0700, Kees Cook wrote:
> - The under-development compiler attribute __counted_by has been added
> so that we can start annotating flexible array members with their
> associated structure member that tracks the count of flexible array
> elements at run-time. It is possible (likely?) that the exact syntax
> of the attribute will change before it is finalized, but GCC and Clang
> are working together to sort it out. Any changes can be made to the
> macro while we continue to add annotations. As an example, I have a
> treewide commit waiting with such annotations found via Coccinelle:
> https://git.kernel.org/linus/adc5b3cb48a049563dc673f348eab7b6beba8a9b
> See commit dd06e72e68bcb4070ef211be100d2896e236c8fb for more details.

So I've been following the discussion of that feature for clang and
I can't wait to actually be able to use it.

But this feels a bit premature to me, not only due to the ongoing
discussions on the syntax, but more importantly because I fear it
will be completely misued before we have a compiler actually supporting
available widely enough that we have it in the usual test bots.