We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cbece6 commit 13cfd6aCopy full SHA for 13cfd6a
include/net/dst_metadata.h
@@ -163,8 +163,11 @@ static inline struct metadata_dst *tun_dst_unclone(struct sk_buff *skb)
163
if (!new_md)
164
return ERR_PTR(-ENOMEM);
165
166
- memcpy(&new_md->u.tun_info, &md_dst->u.tun_info,
167
- 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,
168
+ /* metadata_dst_alloc() reserves room (md_size bytes) for
169
+ * options right after the ip_tunnel_info struct.
170
+ */);
171
#ifdef CONFIG_DST_CACHE
172
/* Unclone the dst cache if there is one */
173
if (new_md->u.tun_info.dst_cache.cache) {
0 commit comments