lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 31 May 2023 09:31:18 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Herbert Xu <herbert@...dor.apana.org.au>
Cc:     arno@...isbad.org, arnd@...nel.org, schalla@...vell.com,
        bbrezillon@...nel.org, davem@...emloft.net,
        linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
        linux-crypto@...r.kernel.org
Subject: Re: [PATCH] crypto: marvell/cesa - Fix type mismatch warning

On Wed, May 31, 2023 at 06:58:10PM +0800, Herbert Xu wrote:
> On Tue, May 30, 2023 at 03:48:49PM -0700, Kees Cook wrote:
> > On Tue, 23 May 2023 10:33:04 +0200, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@...db.de>
> > > 
> > > Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") uncovered
> > > a type mismatch in cesa 3des support that leads to a memcpy beyond the
> > > end of a structure:
> > > 
> > > In function 'fortify_memcpy_chk',
> > >     inlined from 'mv_cesa_des3_ede_setkey' at drivers/crypto/marvell/cesa/cipher.c:307:2:
> > > include/linux/fortify-string.h:583:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
> > >   583 |                         __write_overflow_field(p_size_field, size);
> > >       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > 
> > > [...]
> > 
> > Applied to for-next/hardening, thanks!
> > 
> > [1/1] crypto: marvell/cesa - Fix type mismatch warning
> >       https://git.kernel.org/kees/c/37f3abddda8d
> 
> Why did you apply it to your tree? This patch makes sense on its
> own regardless of the fortify changes.

I snagged it since a week had gone by with no additional discussion and
it fixed an issue exposed by work in the hardening tree. Let me know if
you'd prefer I drop it for you to carry instead.

-Kees

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ