[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d136130c-6895-4394-88c2-2911123afce5@linux.microsoft.com>
Date: Thu, 16 Jan 2025 12:45:53 -0800
From: Roman Kisel <romank@...ux.microsoft.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>,
Dexuan Cui <decui@...rosoft.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: linux-hardening@...r.kernel.org, linux-hyperv@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hv_netvsc: Replace one-element array with flexible array
member
On 1/16/2025 12:16 PM, Thorsten Blum wrote:
> Replace the deprecated one-element array with a modern flexible array
> member in the struct nvsp_1_message_send_receive_buffer_complete.
>
> Link: https://github.com/KSPP/linux/issues/79
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
> drivers/net/hyperv/hyperv_net.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
> index e690b95b1bbb..234db693cefa 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -464,7 +464,7 @@ struct nvsp_1_message_send_receive_buffer_complete {
> * LargeOffset SmallOffset
> */
>
> - struct nvsp_1_receive_buffer_section sections[1];
> + struct nvsp_1_receive_buffer_section sections[];
> } __packed;
>
> /*
1. How have you tested the change?
2. There is an instance of
`sizeof(struct nvsp_1_message_send_receive_buffer_complete))`
and your change decreases the size of the struct. Why do you think
that is fine?
--
Thank you,
Roman
Powered by blists - more mailing lists