All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: "Ahelenia Ziemiańska" <nabijaczleweli@nabijaczleweli.xyz>
Cc: Brian Norris <briannorris@chromium.org>,
	Kalle Valo <kvalo@kernel.org>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: memcpy: detected field-spanning write (size 101) of single field "ext_scan->tlv_buffer" at drivers/net/wireless/marvell/mwifiex/scan.c:2251 (size 1)
Date: Mon, 29 Jan 2024 16:55:26 +0300	[thread overview]
Message-ID: <59378600-8d36-4958-8882-fa693fcad4d6@yandex.ru> (raw)
In-Reply-To: <xebnh5c5rnfequ6khyhieugefrtt5mdftr6rsw522ocpg3yvln@tarta.nabijaczleweli.xyz>

On 1/26/24 22:47, Ahelenia Ziemiańska wrote:

> [   41.314634] memcpy: detected field-spanning write (size 101) of single field "ext_scan->tlv_buffer" at drivers/net/wireless/marvell/mwifiex/scan.c:2251 (size 1)

Short answer: if your device works as expected, most likely you can ignore this.

Long answer: this is caused by using CONFIG_FORTIFY_SOURCE with old style one-element
(in this particular case) or zero-length array members. See "Zero-length and one-element
arrays" at https://www.kernel.org/doc/html/latest/process/deprecated.html. Unfortunately
mwifiex is not completely migrated to C99-style flexible array members; if you're brave
enough, you can help the maintainers by trying this:

--- linux-6.6.11/drivers/net/wireless/marvell/mwifiex/fw.h	2024-01-10 19:17:02.000000000 +0300
+++ linux-6.6.11/drivers/net/wireless/marvell/mwifiex/fw.h	2024-01-29 14:21:55.574280719 +0300
@@ -1586,7 +1586,7 @@

  struct host_cmd_ds_802_11_scan_ext {
  	u32   reserved;
-	u8    tlv_buffer[1];
+	u8    tlv_buffer[];
  } __packed;

  struct mwifiex_ie_types_bss_mode {

Dmitry


  reply	other threads:[~2024-01-29 14:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 19:47 memcpy: detected field-spanning write (size 101) of single field "ext_scan->tlv_buffer" at drivers/net/wireless/marvell/mwifiex/scan.c:2251 (size 1) Ahelenia Ziemiańska
2024-01-29 13:55 ` Dmitry Antipov [this message]
2024-01-30 23:46   ` Ahelenia Ziemiańska

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=59378600-8d36-4958-8882-fa693fcad4d6@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=briannorris@chromium.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nabijaczleweli@nabijaczleweli.xyz \
    /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.