public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roman Kisel <romank@linux.microsoft.com>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-hardening@vger.kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hv_netvsc: Replace one-element array with flexible array member
Date: Fri, 17 Jan 2025 11:14:04 -0800	[thread overview]
Message-ID: <0f400bb9-03a7-431a-95c3-340bb3e10614@linux.microsoft.com> (raw)
In-Reply-To: <4f1e37f0-d72d-4748-a5e4-0ee28d33ca38@intel.com>



On 1/17/2025 3:10 AM, Przemek Kitszel wrote:
> On 1/17/25 01:17, Jakub Kicinski wrote:
>> On Thu, 16 Jan 2025 13:39:52 -0800 Roman Kisel wrote:
>>> On 1/16/2025 1:19 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.
>>>>
>>>> Use struct_size_t(,,1) instead of sizeof() to maintain the same size.
> 
> I would add a struct-specific macro or at least put the info into this
> struct' doc, that "there is legacy API requirement to allocate at least
> one element for the flex array member".
> 
Perhaps add "No functional changes", too.

Worked for me.

Tested-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Roman Kisel <romank@linux.microsoft.com>

>>>
>>> Thanks!
>>>
>>>>
>>>> Compile-tested only.
>>>
>>> The code change looks good to me now. I'll build a VM with this change
>>> to clear my conscience (maybe the change triggers a compiler bug,
>>> however unlikely that sounds) before replying with any tags. Likely next
>>> Monday, but feel free to beat me to it, or perhaps, someone else will
>>> tag this as reviewed by them and/or tested by them.
>>
>> Doesn't look like a real bug fix, so would be good to get some signal
> 
> If the actual usage would be with more than 1 element UBSAN will
> complain.
Great point!

> 
>> soon. The merge window is soon so we'll likely close the trees very
>> very soon ..
>>
> 

-- 
Thank you,
Roman


  reply	other threads:[~2025-01-17 19:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 21:19 [PATCH v2] hv_netvsc: Replace one-element array with flexible array member Thorsten Blum
2025-01-16 21:39 ` Roman Kisel
2025-01-17  0:17   ` Jakub Kicinski
2025-01-17 11:10     ` Przemek Kitszel
2025-01-17 19:14       ` Roman Kisel [this message]
2025-01-18  3:50 ` patchwork-bot+netdevbpf

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=0f400bb9-03a7-431a-95c3-340bb3e10614@linux.microsoft.com \
    --to=romank@linux.microsoft.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=haiyangz@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=thorsten.blum@linux.dev \
    --cc=wei.liu@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