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 8D7061E3DE8; Tue, 15 Oct 2024 11:50:45 +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=1728993045; cv=none; b=HrJlF235lfb91eBBc1666Ct4phaL3ILkOnHfQVE4YJVSx6f3vyf2I9dLltaFC8ELFPZrnJ37Grj3UBxJSg4TDLZJIcUxaSifPhow8n25VW78X4Kta48qoyZcxwoxihUQRpw0FimConfveqt5FJK9iPgIFemo20nnNyOaWWVtvTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728993045; c=relaxed/simple; bh=Xq7GdGGeeF73nTVLLjcVIN6pk6/6EJgZtA+Ih6wxDUc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GQUU7BdHou5iz0s36qOCHfQ9gDs8TsryQTbwAtB4vxpTDaswq+bo6Skee8SmqKhgbKgePORxj6uECr/t7HPcE70AKMES3F5GpW6qgSuTngWY9tG95il6ZHr9tyAL7ClMfg6FXz6LXgt+IVTSNpS4CD3xUueuXndRD2MS3CsaSCs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=irs90vFQ; 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="irs90vFQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9076C4CEC6; Tue, 15 Oct 2024 11:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728993045; bh=Xq7GdGGeeF73nTVLLjcVIN6pk6/6EJgZtA+Ih6wxDUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=irs90vFQADG5boH0XHrQSHkazCNx56ZJHtdLTj9U5EFbox+jEBCkwqsXB3zX+Ooiq 6pZiMWCJ5jyXnonrGX7TJthR/Yp0YXWmwgb7PG2LeHULCsUZQBbkgsTTpCb5+NMo+7 i2ymQtZ/zAFYMYOwMb2isgm4s75TXycb2AYil+2o= 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 5.15 295/691] net: qrtr: Update packets cloning when broadcasting Date: Tue, 15 Oct 2024 13:24:03 +0200 Message-ID: <20241015112452.054014422@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015112440.309539031@linuxfoundation.org> References: <20241015112440.309539031@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 5.15-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 e0a27a404404f..c7a8260fa6ddb 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -879,7 +879,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