public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kees Cook <keescook@chromium.org>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Arnaud Ebalard <arno@natisbad.org>,
	Srujana Challa <schalla@marvell.com>,
	Mustafa Ismail <mustafa.ismail@intel.com>,
	Shiraz Saleem <shiraz.saleem@intel.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Leon Romanovsky <leon@kernel.org>
Subject: Re: Build error in crypto/marvell/cesa/cipher.c
Date: Thu, 29 Jun 2023 11:36:34 -0300	[thread overview]
Message-ID: <ZJ2W8vQjljJej1tw@ziepe.ca> (raw)
In-Reply-To: <CAHk-=whXn0YTojV=+J8B-r8KLvNtqc2JtCa4a_bdhf+=GN5OOw@mail.gmail.com>

On Wed, Jun 28, 2023 at 08:13:25PM -0700, Linus Torvalds wrote:

> I get a similar error in 'irdma_clr_wqes()' at
> drivers/infiniband/hw/irdma/uk.c:103 (and same thing on line 105). I
> don't see what the right solution there is, but it looks like we have
> 
>         IRDMA_CQP_WQE_SIZE = 8
>         __le64 elem[IRDMA_CQP_WQE_SIZE];
> 
> and it's doing a 4kB memset to that element. The mistake is not as
> obvious as in the cesa driver.

I think this fix is in the RDMA PR i just sent you:

commit b002760f877c0d91ecd3c78565b52f4bbac379dd
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue May 23 13:18:45 2023 +0200

    RDMA/irdma: avoid fortify-string warning in irdma_clr_wqes
    
    Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") triggers a
    warning for fortified memset():
    
    In function 'fortify_memset_chk',
        inlined from 'irdma_clr_wqes' at drivers/infiniband/hw/irdma/uk.c:103:4:
    include/linux/fortify-string.h:493:25: error: call to '__write_overflow_field' declared with attribute warning: detected write b>
      493 |                         __write_overflow_field(p_size_field, size);
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    The problem here isthat the inner array only has four 8-byte elements, so
    clearing 4096 bytes overflows that. As this structure is part of an outer
    array, change the code to pass a pointer to the irdma_qp_quanta instead,
    and change the size argument for readability, matching the comment above
    it.
    
    Fixes: 551c46edc769 ("RDMA/irdma: Add user/kernel shared libraries")
    Link: https://lore.kernel.org/r/20230523111859.2197825-1-arnd@kernel.org
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

      parent reply	other threads:[~2023-06-29 14:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29  3:13 Build error in crypto/marvell/cesa/cipher.c Linus Torvalds
2023-06-29  3:48 ` Kees Cook
2023-06-29  4:06   ` Herbert Xu
2023-06-29  4:35   ` Linus Torvalds
2023-06-29  3:53 ` Kees Cook
2023-06-29  7:28   ` Leon Romanovsky
2023-06-29 14:36 ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZJ2W8vQjljJej1tw@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=arno@natisbad.org \
    --cc=bbrezillon@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=keescook@chromium.org \
    --cc=leon@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mustafa.ismail@intel.com \
    --cc=schalla@marvell.com \
    --cc=shiraz.saleem@intel.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox