Message ID | 20221119072832.7896-1-yuehaibing@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp601755wrr; Fri, 18 Nov 2022 23:52:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf4KkzBaa272HtsbIhA4cBpYJbRMifC3jcwVheP7HzFPpE/P8KQi5eP3LvwIsrun4DIwSlRK X-Received: by 2002:a17:903:2609:b0:187:265a:9ef6 with SMTP id jd9-20020a170903260900b00187265a9ef6mr2987668plb.68.1668844359196; Fri, 18 Nov 2022 23:52:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668844359; cv=none; d=google.com; s=arc-20160816; b=GxyxKoQtczBkTTrF1vB/2zcljfsJsexsEr0Oi12FC63lDxSLioqTpOW16yV++JxMc8 FSgKyHQ3DB4M0hDHSCSHMunj8/PuxR7CLes7sfQ0u4+ct15qdSuXDhe2yLapbXFXQkQJ lKP/l+xCNPvpplTOX5DkZrnv/ktnepMvPePcOFNH+BwtK+MdL0ZAN0IsuzM46u0jPsPY Q1m0u7Tq5suOeMjptlW43WqaO79U4Ym6hCtQYpkd4fxgBo078A8pcn5LlzMUvlamI9z1 GdbTlZD5KMGWBoFDI2QY25jNoxwkfWlMJYgNIO+QF9liU2CDP88rPTZxum++i5bd5Jgr LLfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=/4ADE0xB1u0siuFUqTV1pEfgjl34zOb9+00F2UDCE/4=; b=0PZRgrOEHQ64h9jTCZSh+vcrkwz4KGGWL2bzoUxkt920stoZeeq4riudm03Kv7Suh1 dkzmCYpban5TFFMiazf0/meJNSemu6e2kyd9aFEQG3+liV6brcuBWDn7mYkebsq7PJPz BvWrPrdAaKj4cvexLoYvhvxegfIzbj/q9b1Sei9XZGrqv1G1kjiKp/wt1dTd+u1Fx6Vm e352vmKMpe3BpTaAO3Xk8/ZBsoSPfDkEN+uVgxuK8n1rt3wbgIaB7FWXSmEKNY0qM4hp LQ6zMAomXr4JowCm1MDuwHvI8r5wAi5StIvA5kQZaHvnCObZh48scXZLP6TA1HiLsYsA Be0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a170902cf0900b00186c3afe179si5636991plg.422.2022.11.18.23.52.26; Fri, 18 Nov 2022 23:52:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231660AbiKSH33 (ORCPT <rfc822;kkmonlee@gmail.com> + 99 others); Sat, 19 Nov 2022 02:29:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiKSH31 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 19 Nov 2022 02:29:27 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD3DB78186; Fri, 18 Nov 2022 23:29:25 -0800 (PST) Received: from canpemm500007.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NDldG4QwxzHw0V; Sat, 19 Nov 2022 15:28:50 +0800 (CST) Received: from localhost (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 19 Nov 2022 15:29:23 +0800 From: YueHaibing <yuehaibing@huawei.com> To: <jmaloy@redhat.com>, <ying.xue@windriver.com>, <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com> CC: <netdev@vger.kernel.org>, <tipc-discussion@lists.sourceforge.net>, <linux-kernel@vger.kernel.org>, YueHaibing <yuehaibing@huawei.com> Subject: [PATCH net] tipc: check skb_linearize() return value in tipc_disc_rcv() Date: Sat, 19 Nov 2022 15:28:32 +0800 Message-ID: <20221119072832.7896-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500007.china.huawei.com (7.192.104.62) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749910142872869383?= X-GMAIL-MSGID: =?utf-8?q?1749910142872869383?= |
Series |
[net] tipc: check skb_linearize() return value in tipc_disc_rcv()
|
|
Commit Message
Yue Haibing
Nov. 19, 2022, 7:28 a.m. UTC
If skb_linearize() fails in tipc_disc_rcv(), we need to free the skb instead of
handle it.
Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
net/tipc/discover.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
On 11/19/22 02:28, YueHaibing wrote: > If skb_linearize() fails in tipc_disc_rcv(), we need to free the skb instead of > handle it. > > Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values") > Signed-off-by: YueHaibing <yuehaibing@huawei.com> > --- > net/tipc/discover.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/net/tipc/discover.c b/net/tipc/discover.c > index e8630707901e..e8dcdf267c0c 100644 > --- a/net/tipc/discover.c > +++ b/net/tipc/discover.c > @@ -211,7 +211,10 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *skb, > u32 self; > int err; > > - skb_linearize(skb); > + if (skb_linearize(skb)) { > + kfree_skb(skb); > + return; > + } > hdr = buf_msg(skb); > > if (caps & TIPC_NODE_ID128) Acked-by: Jon Maloy <jmaloy@redhat.com>
Hello: This patch was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: On Sat, 19 Nov 2022 15:28:32 +0800 you wrote: > If skb_linearize() fails in tipc_disc_rcv(), we need to free the skb instead of > handle it. > > Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values") > Signed-off-by: YueHaibing <yuehaibing@huawei.com> > --- > net/tipc/discover.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Here is the summary with links: - [net] tipc: check skb_linearize() return value in tipc_disc_rcv() https://git.kernel.org/netdev/net/c/cd0f64211622 You are awesome, thank you!
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index e8630707901e..e8dcdf267c0c 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c @@ -211,7 +211,10 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *skb, u32 self; int err; - skb_linearize(skb); + if (skb_linearize(skb)) { + kfree_skb(skb); + return; + } hdr = buf_msg(skb); if (caps & TIPC_NODE_ID128)