All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: kvalo@kernel.org, johannes@sipsolutions.net
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	Jakub Kicinski <kuba@kernel.org>,
	libertas-dev@lists.infradead.org
Subject: [PATCH net-next 7/8] wifi: libertas: silence a GCC 12 -Warray-bounds warning
Date: Fri, 20 May 2022 12:43:19 -0700	[thread overview]
Message-ID: <20220520194320.2356236-8-kuba@kernel.org> (raw)
In-Reply-To: <20220520194320.2356236-1-kuba@kernel.org>

This driver does a lot of casting of smaller buffers to
a larger command response struct, GCC 12 does not like that:

drivers/net/wireless/marvell/libertas/cfg.c:1198:63: warning: array subscript ‘struct cmd_ds_802_11_associate_response[0]’ is partly outside array bounds of ‘unsigned char[203]’ [-Warray-bounds]
 1198 |                       "aid 0x%04x\n", status, le16_to_cpu(resp->statuscode),
      |                                                               ^~

Annoyingly it's not clever enough to recognize which fields
are safe to access, so move this warning to W=1 for now.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: kvalo@kernel.org
CC: libertas-dev@lists.infradead.org
CC: linux-wireless@vger.kernel.org
---
 drivers/net/wireless/marvell/libertas/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/marvell/libertas/Makefile b/drivers/net/wireless/marvell/libertas/Makefile
index 41b9b440a542..da4ea5a0812c 100644
--- a/drivers/net/wireless/marvell/libertas/Makefile
+++ b/drivers/net/wireless/marvell/libertas/Makefile
@@ -10,6 +10,11 @@ libertas-y += tx.o
 libertas-y += firmware.o
 libertas-$(CONFIG_LIBERTAS_MESH) += mesh.o
 
+# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
+ifndef KBUILD_EXTRA_WARN
+CFLAGS_cfg.o += -Wno-array-bounds
+endif
+
 usb8xxx-objs += if_usb.o
 libertas_cs-objs += if_cs.o
 libertas_sdio-objs += if_sdio.o
-- 
2.34.3


  parent reply	other threads:[~2022-05-20 19:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 19:43 [PATCH net-next 0/8] Fix/silence GCC 12 warnings in drivers/net/wireless/ Jakub Kicinski
2022-05-20 19:43 ` [PATCH net-next 1/8] wifi: plfxlc: remove redundant NULL-check for GCC 12 Jakub Kicinski
2022-05-20 19:43 ` [PATCH net-next 2/8] wifi: ath9k: silence array-bounds warning on " Jakub Kicinski
2022-05-21  6:58   ` Kalle Valo
2022-05-21 17:53     ` Jakub Kicinski
2022-05-22 12:06       ` Kalle Valo
2022-05-23 19:31     ` Kees Cook
2022-05-20 19:43 ` [PATCH net-next 3/8] wifi: rtlwifi: remove always-true condition pointed out by " Jakub Kicinski
2022-05-23  2:35   ` Ping-Ke Shih
2022-05-23 15:57     ` Jakub Kicinski
2022-05-24  0:41       ` Ping-Ke Shih
2022-05-20 19:43 ` [PATCH net-next 4/8] wifi: ath6k: silence false positive -Wno-dangling-pointer warning on " Jakub Kicinski
2022-05-20 19:43 ` [PATCH net-next 5/8] wifi: iwlwifi: use unsigned to silence a GCC 12 warning Jakub Kicinski
2022-05-20 19:43 ` [PATCH net-next 6/8] wifi: brcmfmac: work around a GCC 12 -Warray-bounds warning Jakub Kicinski
2022-05-20 19:43 ` Jakub Kicinski [this message]
2022-05-21 22:03   ` [PATCH net-next 7/8] wifi: libertas: silence " Johannes Berg
2022-05-22 16:56     ` Jakub Kicinski
2022-05-20 19:43 ` [PATCH net-next 8/8] wifi: carl9170: " Jakub Kicinski
2022-05-20 19:58   ` Christian Lamparter
2022-05-22 12:19 ` [PATCH net-next 0/8] Fix/silence GCC 12 warnings in drivers/net/wireless/ Kalle Valo

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=20220520194320.2356236-8-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@kernel.org \
    --cc=libertas-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.