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:   Tue, 27 Apr 2021 14:41:44 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Dan Carpenter <dan.carpenter@...cle.com>,
        Fabio Aiuto <fabioaiuto83@...il.com>,
        Ross Schmidt <ross.schm.dev@...il.com>,
        Marco Cesati <marcocesati@...il.com>,
        Johannes Berg <johannes.berg@...el.com>,
        Ivan Safonov <insafonov@...il.com>,
        linux-staging@...ts.linux.dev,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] [v2] staging: rtl8723bs: avoid bogus gcc warning

On Tue, Apr 27, 2021 at 01:59:32PM +0200, Arnd Bergmann wrote:
> On Tue, Apr 27, 2021 at 11:33 AM Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> wrote:
> >
> > On Thu, Apr 22, 2021 at 05:26:19PM +0200, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@...db.de>
> > >
> > > gcc gets confused by some of the type casts and produces an
> > > apparently senseless warning about an out-of-bound memcpy to
> > > an unrelated array in the same structure:
> > >
> > > drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c: In function 'rtw_cfg80211_ap_set_encryption':
> > > cc1: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
> > > In file included from drivers/staging/rtl8723bs/include/drv_types.h:32,
> > >                  from drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:10:
> > > drivers/staging/rtl8723bs/include/rtw_security.h:98:15: note: at offset [184, 4264] into destination object 'dot11AuthAlgrthm' of size 4
> > >    98 |         u32   dot11AuthAlgrthm;         /*  802.11 auth, could be open, shared, 8021x and authswitch */
> > >       |               ^~~~~~~~~~~~~~~~
> > > cc1: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
> > > drivers/staging/rtl8723bs/include/rtw_security.h:98:15: note: at offset [264, 4344] into destination object 'dot11AuthAlgrthm' of size 4
> > >
> > > This is a known gcc bug, and the patch here is only a workaround,
> > > but the approach of using a temporary variable to hold a pointer
> > > to the key also improves readability in addition to avoiding the
> > > warning, so overall this should still help.
> >
> > What version of gcc causes this?  Should this go into 5.13-final and be
> > backported?  Or is this only showing up on "unreleased" versions of gcc
> > and it is safe to wait until 5.14?
> 
> As I understand, this is related to
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99673
> 
> gcc-11.1.0 has now been released and it produces this warning.

What's the odds we can get gcc to fix their bug, as it's not a kernel
issue?  :)

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ