On cow we can free the old extension: we must avoid dereferencing
such extension after skb_ext_maybe_cow(). Since 'new' contents
are always equal to 'old' after the copy, we can fix the above
accessing the relevant data using 'new'.
Fixes: df5042f4c5b9 ("sk_buff: add skb extension infrastructure")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
if (!new)
return NULL;
- if (__skb_ext_exist(old, id)) {
+ if (__skb_ext_exist(new, id)) {
if (old != new)
skb->extensions = new;
goto set_active;
}
- newoff = old->chunks;
+ newoff = new->chunks;
} else {
newoff = SKB_EXT_CHUNKSIZEOF(*new);