[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202402280925.5B709A60F@keescook>
Date: Wed, 28 Feb 2024 09:39:30 -0800
From: Kees Cook <keescook@...omium.org>
To: Arnd Bergmann <arnd@...db.de>, Bill Wendling <morbo@...gle.com>,
Nathan Chancellor <nathan@...nel.org>
Cc: Takashi Iwai <tiwai@...e.de>, Arnd Bergmann <arnd@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Clang __bos vs loop unrolling (was Re: [PATCH] ALSA: asihpi: work
around clang-17+ false positive fortify-string warning)
On Wed, Feb 28, 2024 at 04:03:56PM +0100, Arnd Bergmann wrote:
> My first thought was that clang warns about it here because
> the 'u16 adapter' declaration limits the index to something
> smaller than an 'int' or 'long', but changing the type
> did not get rid of the warning.
Our current theory is that Clang has a bug with
__builtin_object_size/__builtin_dynamic_object_size when doing loop
unrolling (or other kinds of execution flow splitting). Some examples:
https://github.com/ClangBuiltLinux/linux/issues?q=label%3A%22loop+unroller%22+
Which is perhaps related to __bos miscalculations:
https://github.com/ClangBuiltLinux/linux/issues?q=label%3A%22%5B__bos%5D+miscalculation%22+
-Kees
--
Kees Cook
Powered by blists - more mailing lists