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:   Mon, 6 Sep 2021 10:06:09 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Stephen Rothwell <sfr@...b.auug.org.au>
Cc:     "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Anitha Chrisanthus <anitha.chrisanthus@...el.com>,
        Sam Ravnborg <sam@...nborg.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: linux-next: build warning after merge of the kspp tree

On Mon, Sep 06, 2021 at 03:41:51PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> On Mon, 30 Aug 2021 18:44:29 +1000 Stephen Rothwell <sfr@...b.auug.org.au> wrote:
> >
> > After merging the kspp tree, today's linux-next build (powerpc
> > allyesconfig) produced this warning:
> > 
> > drivers/gpu/drm/kmb/kmb_plane.c:135:20: warning: array subscript 3 is above array bounds of 'struct layer_status[1]' [-Warray-bounds]
> >   135 |   kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE;
> >       |   ~~~~~~~~~~~~~~~~~^~~~~~~~~~
> > In file included from drivers/gpu/drm/kmb/kmb_plane.c:17:
> > drivers/gpu/drm/kmb/kmb_drv.h:48:23: note: while referencing 'plane_status'
> >    48 |  struct layer_status  plane_status[KMB_MAX_PLANES];
> >       |                       ^~~~~~~~~~~~
> > drivers/gpu/drm/kmb/kmb_plane.c:132:20: warning: array subscript 2 is above array bounds of 'struct layer_status[1]' [-Warray-bounds]
> >   132 |   kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE;
> >       |   ~~~~~~~~~~~~~~~~~^~~~~~~~~~
> > In file included from drivers/gpu/drm/kmb/kmb_plane.c:17:
> > drivers/gpu/drm/kmb/kmb_drv.h:48:23: note: while referencing 'plane_status'
> >    48 |  struct layer_status  plane_status[KMB_MAX_PLANES];
> >       |                       ^~~~~~~~~~~~
> > drivers/gpu/drm/kmb/kmb_plane.c:129:20: warning: array subscript 1 is above array bounds of 'struct layer_status[1]' [-Warray-bounds]
> >   129 |   kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE;
> >       |   ~~~~~~~~~~~~~~~~~^~~~~~~~~~
> > In file included from drivers/gpu/drm/kmb/kmb_plane.c:17:
> > drivers/gpu/drm/kmb/kmb_drv.h:48:23: note: while referencing 'plane_status'
> >    48 |  struct layer_status  plane_status[KMB_MAX_PLANES];
> >       |                       ^~~~~~~~~~~~
> > 
> > Exposed by commit
> > 
> >   656256c0d67c ("Makefile: Enable -Warray-bounds")
> > 
> > Introduced by commit
> > 
> >   7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")
> > 
> > from v5.11-rc1.
> 
> Due to Linus -Werror, these are now errors :-(
> 
> I have reverted commit 656256c0d67c for now.

I'm still surprised Linus added -Werror (it seems to go against years of
his earlier mandates on not breaking the build). Seems like
3fe617ccafd6 should be reverted instead. ;)

Linus, warnings are being reported (as above), are you sure -Werror is
the right way to go? (I can't believe I'm saying this, given my past
desire to make various hardening failures break the build -- you
convinced me to always warn instead, and it made good sense: a developer
still gets binary results as well as any new warnings...)

-Kees

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ