From: Johannes Berg <johannes@sipsolutions.net>
To: Stanislaw Gruszka <stf_xl@wp.pl>, Kees Cook <keescook@chromium.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
Xose Vazquez Perez <xose.vazquez@gmail.com>,
linux-wireless@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [WARNING] memcpy: detected field-spanning write (size 1005) of single field "&out_cmd->cmd.payload" at drivers/net/wireless/intel/iwlegacy/common.c:3173 (size 320)
Date: Mon, 20 May 2024 13:45:37 +0200 [thread overview]
Message-ID: <95f3e147de837b4833e6cf6eb67108f96640af4e.camel@sipsolutions.net> (raw)
In-Reply-To: <20240520073210.GA693073@wp.pl>
> +++ b/drivers/net/wireless/intel/iwlegacy/commands.h
> @@ -201,9 +201,6 @@ struct il_cmd_header {
> * 15 unsolicited RX or uCode-originated notification
> */
> __le16 sequence;
> -
> - /* command or response/notification data follows immediately */
> - u8 data[];
> } __packed;
[...]
> - memcpy(&out_cmd->cmd.payload, cmd->data, cmd->len);
> + memcpy(&out_cmd->cmd.raw, cmd->data, cmd->len);
[...]
> +++ b/drivers/net/wireless/intel/iwlegacy/common.h
> @@ -555,6 +555,7 @@ struct il_device_cmd {
> u32 val32;
> struct il_tx_cmd tx;
> u8 payload[DEF_CMD_PAYLOAD_SIZE];
> + DECLARE_FLEX_ARRAY(u8, raw);
>
I don't think this is right, now the raw comes after
DEF_CMD_PAYLOAD_SIZE? You want it to be a union with payload, I'd think.
johannes
next prev parent reply other threads:[~2024-05-20 11:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 17:48 [WARNING] memcpy: detected field-spanning write (size 1005) of single field "&out_cmd->cmd.payload" at drivers/net/wireless/intel/iwlegacy/common.c:3173 (size 320) Xose Vazquez Perez
2024-05-18 9:29 ` Stanislaw Gruszka
2024-05-18 17:48 ` Kees Cook
2024-05-20 7:32 ` Stanislaw Gruszka
2024-05-20 11:45 ` Johannes Berg [this message]
2024-05-20 15:08 ` Stanislaw Gruszka
2024-05-20 15:10 ` Johannes Berg
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=95f3e147de837b4833e6cf6eb67108f96640af4e.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=stf_xl@wp.pl \
--cc=xose.vazquez@gmail.com \
/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