From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD5A1405FB; Wed, 2 Oct 2024 14:43:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727880190; cv=none; b=fjjAZjY4pPITMaeb20AYqatJBSF2Y8ThM68tbcUXb/z+ybXsNiMPozt3L4j0gueXSsbHIqRitWJqAhmGuzktwoNEHi7tjPW8YRs4AdriwBKVf2tF5v9c2Nuf3DKD1lNNXjz7udBqvLUovVhEoNusDCP3Qy50ss9CnOtagkGMl0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727880190; c=relaxed/simple; bh=T1LS6C7meFnU40TyU6c2pBg3OStmIxCQyUIxmbYjjkg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pMxYn0h6bmMHqWlkUi8B8oGYagA4k7IyTuGwcvXwmWeTIwb2yIZ/YZ6hnVthaEXd80hy4Ufzd6sX6iwkhEcMSQOQZT598ItEdWqjc/+rknBYME5S54GMuN7eTbInO7/YJqKYnc6g4ZbKc7++ZUP7JSwY8efA/jJ4UFwmtqwmN3Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PC2uAFq6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PC2uAFq6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07464C4CEC2; Wed, 2 Oct 2024 14:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727880190; bh=T1LS6C7meFnU40TyU6c2pBg3OStmIxCQyUIxmbYjjkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PC2uAFq66Xw8q/J0uy4EACpryQofhEagR1zS/gzQkoF/tQS3r9QKw5U9XNXKAo7o1 mAQ8zuiQKpfdmxclbywRL0DaHbSkgn3oGlsH/TcJ2A+uuETYXtt7rlOgLo4PBywacr vniG6+qOGn42HNtn+LbLPCw5ymTj0JyJ4OUOQteQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Youssef Samir , Jeffery Hugo , Carl Vanderlip , Chris Lew , Paolo Abeni , Sasha Levin Subject: [PATCH 6.6 375/538] net: qrtr: Update packets cloning when broadcasting Date: Wed, 2 Oct 2024 15:00:14 +0200 Message-ID: <20241002125807.233811677@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241002125751.964700919@linuxfoundation.org> References: <20241002125751.964700919@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Youssef Samir [ Upstream commit f011b313e8ebd5b7abd8521b5119aecef403de45 ] 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: bdabad3e363d ("net: Add Qualcomm IPC router") Signed-off-by: Youssef Samir Reviewed-by: Jeffery Hugo Reviewed-by: Carl Vanderlip Reviewed-by: Chris Lew Link: https://patch.msgid.link/20240916170858.2382247-1-quic_yabdulra@quicinc.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/qrtr/af_qrtr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c index 41ece61eb57ab..00c51cf693f3d 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -884,7 +884,7 @@ static int qrtr_bcast_enqueue(struct qrtr_node *node, struct sk_buff *skb, mutex_lock(&qrtr_node_lock); list_for_each_entry(node, &qrtr_all_nodes, item) { - skbn = skb_clone(skb, GFP_KERNEL); + skbn = pskb_copy(skb, GFP_KERNEL); if (!skbn) break; skb_set_owner_w(skbn, skb->sk); -- 2.43.0