netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: netdev@vger.kernel.org
Subject: Re: GCC 12 warnings
Date: Fri, 20 May 2022 10:23:55 -0700	[thread overview]
Message-ID: <20220520102355.273cae07@kernel.org> (raw)
In-Reply-To: <202205200938.1EE1FD1@keescook>

On Fri, 20 May 2022 09:46:36 -0700 Kees Cook wrote:
> > Since -Warray-bounds is included by default now this is making our
> > lives a little hard [1]. Is there a wider effort to address this?
> > If not do you have a recommendation on how to deal with it?  
> 
> Looks like the issue was this?
> https://lore.kernel.org/all/20220520145957.1ec50e44@canb.auug.org.au/
> 
> Ah, from cf2df74e202d ("net: fix dev_fill_forward_path with pppoe + bridge")
> 
> You mean you missed this particular warning because of the other GCC
> 12 warnings?

Yup :(

> > My best idea is to try to isolate the bad files and punt -Warray-bounds
> > to W=1 for those, so we can prevent more of them getting in but not
> > break WERROR builds on GCC 12. That said, I'm not sure how to achieve
> > that.. This for example did not work:
> > 
> > --- a/drivers/net/ethernet/mediatek/Makefile
> > +++ b/drivers/net/ethernet/mediatek/Makefile
> > @@ -9,5 +9,9 @@ mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed.o
> >  ifdef CONFIG_DEBUG_FS
> >  mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_debugfs.o
> >  endif
> >  obj-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_ops.o
> >  obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o
> > +
> > +ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),)
> > +CFLAGS_mtk_ppe.o += -Wno-array-bounds
> > +endif  
> 
> This worked for me:
> 
> diff --git a/drivers/net/can/usb/kvaser_usb/Makefile b/drivers/net/can/usb/kvaser_usb/Makefile
> index cf260044f0b9..43eb921f9102 100644
> --- a/drivers/net/can/usb/kvaser_usb/Makefile
> +++ b/drivers/net/can/usb/kvaser_usb/Makefile
> @@ -1,3 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb.o
>  kvaser_usb-y = kvaser_usb_core.o kvaser_usb_leaf.o kvaser_usb_hydra.o
> +
> +ifeq ($(KBUILD_EXTRA_WARN),)
> +CFLAGS_kvaser_usb_hydra.o += -Wno-array-bounds
> +endif

Ah, thanks, I must have tried -Wno-array-bounds before I figured out
the condition and reverted back to full $(call cc-disable-warning, ..)
Let me redo the patches.

Thanks!

  reply	other threads:[~2022-05-20 17:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  2:36 GCC 12 warnings Jakub Kicinski
2022-05-20 16:46 ` Kees Cook
2022-05-20 17:23   ` Jakub Kicinski [this message]
2022-05-20 21:43     ` David Laight
2022-05-20 23:30       ` Kees Cook

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=20220520102355.273cae07@kernel.org \
    --to=kuba@kernel.org \
    --cc=keescook@chromium.org \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).