[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9339419-7abf-48ca-9c1a-bf84bb9a8ff1@nvidia.com>
Date: Sun, 18 Aug 2024 18:15:49 +0300
From: Gal Pressman <gal@...dia.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski
<kuba@...nel.org>, netdev@...r.kernel.org, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Cosmin Ratiu <cratiu@...dia.com>, Tariq Toukan <tariqt@...dia.com>
Subject: Re: [PATCH net-next] net: Silence false field-spanning write warning
in metadata_dst memcpy
On 18/08/2024 18:09, Stephen Hemminger wrote:
> On Sun, 18 Aug 2024 14:43:51 +0300
> Gal Pressman <gal@...dia.com> wrote:
>> diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h
>> index 4160731dcb6e..84c15402931c 100644
>> --- a/include/net/dst_metadata.h
>> +++ b/include/net/dst_metadata.h
>> @@ -163,8 +163,11 @@ static inline struct metadata_dst *tun_dst_unclone(struct sk_buff *skb)
>> if (!new_md)
>> return ERR_PTR(-ENOMEM);
>>
>> - memcpy(&new_md->u.tun_info, &md_dst->u.tun_info,
>> - sizeof(struct ip_tunnel_info) + md_size);
>> + unsafe_memcpy(&new_md->u.tun_info, &md_dst->u.tun_info,
>> + sizeof(struct ip_tunnel_info) + md_size,
>> + /* metadata_dst_alloc() reserves room (md_size bytes) for
>> + * options right after the ip_tunnel_info struct.
>> + */);
>
> This is an awkward /* midsentence */ place to put a comment.
I do not disagree, but it is quite common for unsafe_memcpy() callers.
Powered by blists - more mailing lists