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] [day] [month] [year] [list]
Date:   Thu, 1 Jun 2023 13:09:48 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Mustafa Ismail <mustafa.ismail@...el.com>,
        Shiraz Saleem <shiraz.saleem@...el.com>,
        Leon Romanovsky <leon@...nel.org>,
        Arnd Bergmann <arnd@...db.de>,
        Sindhu-Devale <sindhu.devale@...el.com>,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RDMA/irdma: avoid fortify-string warning in
 irdma_clr_wqes

On Tue, May 23, 2023 at 01:18:45PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> 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 beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
>   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")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Acked-by: Shiraz Saleem <shiraz.saleem@...el.com>
> ---
>  drivers/infiniband/hw/irdma/uk.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Applied to for-next, thanks

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ