Re: [PATCH 0/6] lib/crypto: More at_least decorations

From: Eric Biggers

Date: Sun Nov 23 2025 - 15:56:17 EST


On Sun, Nov 23, 2025 at 09:38:49PM +0100, Jason A. Donenfeld wrote:
> On Sun, Nov 23, 2025 at 9:37 PM Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
> >
> > On Sun, Nov 23, 2025 at 09:31:19AM +0100, Ard Biesheuvel wrote:
> > > On Sat, 22 Nov 2025 at 20:42, Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
> > > >
> > > > This series depends on the 'at_least' macro added by
> > > > https://lore.kernel.org/r/20251122025510.1625066-4-Jason@xxxxxxxxx
> > > > It can also be retrieved from
> > > >
> > > > git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git more-at-least-decorations-v1
> > > >
> > > > Add the at_least (i.e. 'static') decoration to the fixed-size array
> > > > parameters of more of the crypto library functions. This causes clang
> > > > to generate a warning if a too-small array of known size is passed.
> > > >
> > >
> > > FTR GCC does so too.
> >
> > See https://lore.kernel.org/linux-crypto/20251115021430.GA2148@sol/
> > Unfortunately gcc puts these warnings under -Wstringop-overflow which
> > the kernel disables, so we don't see them. clang works, though.
>
> Is that disabling new?

No.

> Look at the commit message in my chapoly patch... The warning shown
> there happened from a real live kernel build.

Oh, there's actually a difference between const and non-const
parameters. A const parameter gives -Wstringop-overread, while a
non-const one gives -Wstringop-overflow. Only the latter is disabled.

- Eric