Re: [PATCH] [RFC] xfrm: work around a clang-19 fortifiy-string false-positive

From: Nathan Chancellor
Date: Fri Apr 12 2024 - 17:21:47 EST


On Thu, Apr 11, 2024 at 01:35:05PM +0200, Arnd Bergmann wrote:
> On Wed, Apr 10, 2024, at 19:45, Nathan Chancellor wrote:
>
> > Unfortunately, I have no idea why it is complaining nor why your patch
> > resolves it but the combination of FORTIFY_SOURCE and KASAN certainly
> > seems like a reasonable place to start looking. I will see if I can come
> > up with a smaller reproducer to see if it becomes more obvious why this
> > code triggers this warning.
>
> I know at least why my patch avoids the warning -- it removes the
> call to memset() that contains the check.

Yeah duh... :/ I should have realized that before I sent that message
heh.

> Unfortunately that still doesn't explain what caused it.

Right, I'll see if I can cvise something out now that we have a more
isolated set of conditions. I guess the only question will be if I can
build a file preprocessed with CONFIG_KASAN=y will build with and
without '-fsanitize=kernel-address'...

Cheers,
Nathan