[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202202021307.75435AF9@keescook>
Date: Wed, 2 Feb 2022 13:09:30 -0800
From: Kees Cook <keescook@...omium.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nathan Chancellor <nathan@...nel.org>, llvm@...ts.linux.dev,
George Burgess IV <gbiv@...gle.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-hardening@...r.kernel.org,
linux-security-module <linux-security-module@...r.kernel.org>
Subject: Re: [PATCH 1/4] Compiler Attributes: Add Clang's __pass_object_size
On Wed, Feb 02, 2022 at 02:11:51AM +0100, Miguel Ojeda wrote:
> On Wed, Feb 2, 2022 at 1:30 AM Kees Cook <keescook@...omium.org> wrote:
> >
> > +/*
> > + * clang: https://clang.llvm.org/docs/AttributeReference.html#pass-object-size-pass-dynamic-object-size
>
> For attributes that are not supported under all compilers, we have the
> "Optional" lines in the comment. From a quick look in Godbolt,
> `__pass_object_size__` and `__overloadable__` are supported for all
> Clang >= 11 but not GCC/ICC. Thus, could you please add to the
> comment:
>
> * Optional: not supported by gcc.
> * Optional: not supported by icc.
>
> to those two patches?
>
> For `__diagnose_as_builtin__`, I only see it on Clang trunk, so I
> assume >= 14, thus could you please add:
>
> * Optional: only supported since clang >= 14.
>
> ?
>
> Thanks!
Gotcha, I will adjust these.
> > + * The "type" argument should match the __builtin_object_size(p, type) usage.
>
> This should go above on top of the comment (it is true there is one
> case that does not follow it, but that one has to be cleaned up).
>
> Also, this bit seems to be explained in the Clang documentation (i.e.
> not kernel-specific). Do you think we need it here?
It's the kind of detail I feel like I might forget a month from now, so
I added it as a bit of a hint. If you think it's too redundant, I can
leave it off.
--
Kees Cook
Powered by blists - more mailing lists