On October 9, 2026 1:45:54 PM PDT, Nathan Chancellor <[email protected]> wrote:
>On Fri, Oct 09, 2026 at 10:23:14AM -0700, Nick Desaulniers wrote:
>> On Thu, Oct 8, 2026 at 4:49 AM Abel Vesa <[email protected]> wrote:
>> >
>> > On 26-10-07 14:49:28, Nick Desaulniers wrote:
>> > > Would you consider this a bug in clang, or an error in how the
>> > > __counted_by attribute is applied?
>> > >
>> > It turns out Amaan Qureshi has already reported exactly this Landlock
>> > issue and proposed an LLVM fix:
>> >
>> > https://github.com/llvm/llvm-project/pull/228309
>>
>> In that case, I would _not_ work around the compiler bug like this and
>> instead wait for that fix to land in clang, then bump the required
>> version of clang for counted-by.
>>
>> Kees and Nathan are traveling for LPC, so I don't expect quick
>> feedback from them, but they should confirm whether they agree with my
>> proposal.
>
>Bill/Kees/Justin should review that patch upstream but bumping the
>required version for __counted_by to clang-24 (or maybe 23.1.x if it can
>land in release/23.x) kind of sucks :/ but if this is a big enough
>footgun that we don't want to continuously workaround, I guess we have
>no choice.
I'm still catching up from travel, so apologies if this already got checked,
but has this been verified against GCC as well? Is it only a Clang problem?
Regardless, if counted_by is not working for a given compiler version we'll
need to exclude its use by version. :(
-Kees
--
Kees Cook