LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: linux-next: build warning after merge of the kspp tree
Date: Mon, 6 Sep 2021 10:06:09 -0700	[thread overview]
Message-ID: <202109061000.79CF310@keescook> (raw)
In-Reply-To: <20210906154151.0aa41a7a@canb.auug.org.au>

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@canb.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

  reply	other threads:[~2021-09-06 17:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30  8:44 Stephen Rothwell
2021-08-30 23:50 ` Kees Cook
2021-08-31  0:49   ` Stephen Rothwell
2021-09-06  5:41 ` Stephen Rothwell
2021-09-06 17:06   ` Kees Cook [this message]
2021-09-06 17:12     ` Linus Torvalds

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=202109061000.79CF310@keescook \
    --to=keescook@chromium.org \
    --cc=anitha.chrisanthus@intel.com \
    --cc=gustavoars@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: linux-next: build warning after merge of the kspp tree' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).