Re: [PATCH v2 2/2] VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host()

From: Dan Carpenter
Date: Thu Jan 11 2024 - 02:15:56 EST


On Wed, Jan 10, 2024 at 04:03:28PM -0800, Kees Cook wrote:
>
> Oops, yes, thanks for fixing my confusion. Right, this is a direct write
> across members into the flex array, not a composite destination. Yay
> all the corner cases. :P

Is there a document somewhere which explains what will trigger a runtime
warning? For example, if you write across members but it's not into a
flex array does that cause an issue? Or if you read across members?

For example, this line reads from bulletin->vlan and
bulletin->vlan_padding. This causes a compiler warning in Clang and
GCC depending on the options but does it also trigger a runtime warning?
https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c#L2655

(I wrote a patch for this a few months back but didn't send it because
of the merge window. I forgot about it until now that we're in a merge
window again... :P)

regards,
dan carpenter