summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2024-02-19 12:51:54 +0300
committerPaolo Abeni <pabeni@redhat.com>2024-02-22 15:32:55 +0300
commit1394c1dec1c619a46867ed32791a29695372bff8 (patch)
tree8158ab99710caf5a19bad1acc578a0b9901d0805 /net/core
parent9acdc089c08884c1f1b4567efcd7290781ee8e3a (diff)
downloadlinux-1394c1dec1c619a46867ed32791a29695372bff8.tar.xz
net: mctp: copy skb ext data when fragmenting
If we're fragmenting on local output, the original packet may contain ext data for the MCTP flows. We'll want this in the resulting fragment skbs too. So, do a skb_ext_copy() in the fragmentation path, and implement the MCTP-specific parts of an ext copy operation. Fixes: 67737c457281 ("mctp: Pass flow data & flow release events to drivers") Reported-by: Jian Zhang <zhangjian.3032@bytedance.com> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b9de3ee65ae6..1f918e602bc4 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6850,6 +6850,14 @@ static struct skb_ext *skb_ext_maybe_cow(struct skb_ext *old,
xfrm_state_hold(sp->xvec[i]);
}
#endif
+#ifdef CONFIG_MCTP_FLOWS
+ if (old_active & (1 << SKB_EXT_MCTP)) {
+ struct mctp_flow *flow = skb_ext_get_ptr(old, SKB_EXT_MCTP);
+
+ if (flow->key)
+ refcount_inc(&flow->key->refs);
+ }
+#endif
__skb_ext_put(old);
return new;
}