Skip to content

Commit f011b31

Browse files
Youssef SamirPaolo Abeni
authored andcommitted
net: qrtr: Update packets cloning when broadcasting
When broadcasting data to multiple nodes via MHI, using skb_clone() causes all nodes to receive the same header data. This can result in packets being discarded by endpoints, leading to lost data. This issue occurs when a socket is closed, and a QRTR_TYPE_DEL_CLIENT packet is broadcasted. All nodes receive the same destination node ID, causing the node connected to the client to discard the packet and remain unaware of the client's deletion. Replace skb_clone() with pskb_copy(), to create a separate copy of the header for each sk_buff. Fixes: bdabad3 ("net: Add Qualcomm IPC router") Signed-off-by: Youssef Samir <[email protected]> Reviewed-by: Jeffery Hugo <[email protected]> Reviewed-by: Carl Vanderlip <[email protected]> Reviewed-by: Chris Lew <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent c8770db commit f011b31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/qrtr/af_qrtr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ static int qrtr_bcast_enqueue(struct qrtr_node *node, struct sk_buff *skb,
884884

885885
mutex_lock(&qrtr_node_lock);
886886
list_for_each_entry(node, &qrtr_all_nodes, item) {
887-
skbn = skb_clone(skb, GFP_KERNEL);
887+
skbn = pskb_copy(skb, GFP_KERNEL);
888888
if (!skbn)
889889
break;
890890
skb_set_owner_w(skbn, skb->sk);

0 commit comments

Comments
 (0)