On Wed, Jul 23, 2025 at 06:40:07PM +0200, Martin Uecker wrote: > Am Mittwoch, dem 23.07.2025 um 00:30 -0700 schrieb Kees Cook: > > On Wed, Jul 23, 2025 at 07:47:11AM +0200, Martin Uecker wrote: > ... > > > > > How would GCC want to define the syntax for expressions here? I still > > think it should be possible to wire up something that matches it in > > Clang, even if it is a "redundant" syntax within Clang (i.e. Clang can > > support 2 way to handle expressions, GCC has 1, and Linux will use the > > common way). > > From the kernel side, what would be the use cases for the main > expression syntax (do you really need arbitrary expressions?), > and how often will you need it compared to the single identifier case?
Aaron's reply looks a lot like what I would expect from Linux. I can't answer this question with exact numbers as Linux hasn't done the implementation, but my own manual reviews of where Linux could apply the attribute looks much like what Aaron sent. I clarified Linux's needs a bit more around the "special cases" in a reply to that email. But, roughly, I expect "special cases" to be less than 10%. In that 10% the expressions end up having effectively arbitrary expression needs due to potentially performing bit operations, returning global variable values, etc. (This is why I like the idea of the callback, since it would basically just be an inline expression that gets dropped into the size calculation.) -- Kees Cook