Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7186203ybi; Mon, 8 Jul 2019 16:27:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqykZn4GPiRtHtvvg4yeAvQ70pCtg1QAKzaEtwO23L8z8LfmMJMCyFyDHfKzpVUL2+ldnd1W X-Received: by 2002:a17:90a:cf0d:: with SMTP id h13mr28756748pju.63.1562628438259; Mon, 08 Jul 2019 16:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562628438; cv=none; d=google.com; s=arc-20160816; b=E4ESGWTRub40WpCwNyAhLPPFr/0quRTUvnMZNZHw71lRMFKxMIt7CDmwrOlEp5EMyJ cZSTt0leyMrsELU7Q5LhMEQM2zXVeyYvbZQ8womgZtFEHd6I1Pwhp+Kl00m5iJ+viSky /PfvLQ2D2nOjrYKJCfqQm1zA3b5FLn2I2tHuxtlxVbsBtGKTDNXW9oH6aCo5xzQuUGkS HVgHJnu4ukVxTVQABlZ0qR5lAPzxV7LTjndBkBGNUkCnuAuyfADckewvXzYdJqp06jrX cvEBX0kHEr25JnECv/j1l/gDbg/9R9z/dJpqeIlXhN9+EZHibpYKzwSz4rgFaGc7hA2g vdkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=MHtjdP6J7S4FAJZ1f9txr8+U6dEpel/MdY3bP6vOnYs=; b=XAYr5lyazb2PEhs9iXqxQkQJz0tnEoMbIkJXJgCztR/zaDrv/0GBsqz1y11L8fQfZ8 TkJKRcQhjGLADS6CxLW0jNpz+L2z9SnoPwkErTpHvMMpOkCQAUVPMUQjJuYvFb5Ob1rf ZDFvdMUOe6bYZfl9unbSnxc9LwLah9iU9NE9y8r1ceOpr9DPZUUJIlHgBeBLEvSJE5TX h2hgtDiwg203Y1WJ8o36qo24fL9jWIO0Hwj9l4hBTDCuT5eTufue7Ak7cvIDAQBbQMxc XWU4yp9ul9G5BSbFHUDmGWY//3jvupgkSSBrN8XDPJmabWohvAHVOhuZRgAmcV9IA+Hb q3UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=gpDon7dQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si19646318plr.340.2019.07.08.16.27.02; Mon, 08 Jul 2019 16:27:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=gpDon7dQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405213AbfGHVNt (ORCPT + 99 others); Mon, 8 Jul 2019 17:13:49 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:58131 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727011AbfGHVNs (ORCPT ); Mon, 8 Jul 2019 17:13:48 -0400 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 77083891A9; Tue, 9 Jul 2019 09:13:46 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1562620426; bh=MHtjdP6J7S4FAJZ1f9txr8+U6dEpel/MdY3bP6vOnYs=; h=From:To:CC:Subject:Date:References; b=gpDon7dQPuvlEuHytEDAyDWqRFRag3vPmIt2FDQfd6ZjwWYILDi1g6AVhop9rO9bD CnmDOT8JsYKEjlFHbHJpmOOb+HcK90RgAkuPuj7SXmGvpY9+i8jkykSLwGOMsxRZbl dDhcQA7TKB6MUziI4wgWFMddyRd3yaGiq863YtI78O2X0h/zC34eTg92M56f0Ce9aa HGeN250STPgfhsCJy3MyBJOPHW+cewOhXEH32W4NhDr/nxE4rTRgDfZtScNe2fWsOa fAbeVPoQZz18uV3adlUfi/wTx+8boZ9p6mqqwkvNZJfQxU3NXuWuOQFol26ZiBeO4l 8EKuszybvEyuA== Received: from svr-chch-ex1.atlnz.lc (Not Verified[10.32.16.77]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Tue, 09 Jul 2019 09:13:45 +1200 Received: from svr-chch-ex1.atlnz.lc (2001:df5:b000:bc8::77) by svr-chch-ex1.atlnz.lc (2001:df5:b000:bc8::77) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Tue, 9 Jul 2019 09:13:46 +1200 Received: from svr-chch-ex1.atlnz.lc ([fe80::409d:36f5:8899:92e8]) by svr-chch-ex1.atlnz.lc ([fe80::409d:36f5:8899:92e8%12]) with mapi id 15.00.1156.000; Tue, 9 Jul 2019 09:13:46 +1200 From: Chris Packham To: Eric Dumazet , "jon.maloy@ericsson.com" , "ying.xue@windriver.com" , "davem@davemloft.net" CC: "netdev@vger.kernel.org" , "tipc-discussion@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] tipc: ensure skb->lock is initialised Thread-Topic: [PATCH] tipc: ensure skb->lock is initialised Thread-Index: AQHVNRbM8H0dBbuBFkyTwxApCbaMkw== Date: Mon, 8 Jul 2019 21:13:45 +0000 Message-ID: <87fd2150548041219fc42bce80b63c9c@svr-chch-ex1.atlnz.lc> References: <20190707225328.15852-1-chris.packham@alliedtelesis.co.nz> <2298b9eb-100f-6130-60c4-0e5e2c7b84d1@gmail.com> <361940337b0d4833a5634ddd1e1896a9@svr-chch-ex1.atlnz.lc> Accept-Language: en-NZ, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [2001:df5:b000:22:3a2c:4aff:fe70:2b02] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/07/19 8:43 AM, Chris Packham wrote:=0A= > On 8/07/19 8:18 PM, Eric Dumazet wrote:=0A= >>=0A= >>=0A= >> On 7/8/19 12:53 AM, Chris Packham wrote:=0A= >>> tipc_named_node_up() creates a skb list. It passes the list to=0A= >>> tipc_node_xmit() which has some code paths that can call=0A= >>> skb_queue_purge() which relies on the list->lock being initialised.=0A= >>> Ensure tipc_named_node_up() uses skb_queue_head_init() so that the lock= =0A= >>> is explicitly initialised.=0A= >>>=0A= >>> Signed-off-by: Chris Packham =0A= >>=0A= >> I would rather change the faulty skb_queue_purge() to __skb_queue_purge(= )=0A= >>=0A= > =0A= > Makes sense. I'll look at that for v2.=0A= > =0A= =0A= Actually maybe not. tipc_rcast_xmit(), tipc_node_xmit_skb(), =0A= tipc_send_group_msg(), __tipc_sendmsg(), __tipc_sendstream(), and =0A= tipc_sk_timeout() all use skb_queue_head_init(). So my original change =0A= brings tipc_named_node_up() into line with them.=0A= =0A= I think it should be safe for tipc_node_xmit() to use =0A= __skb_queue_purge() since all the callers seem to have exclusive access =0A= to the list of skbs. It still seems that the callers should all use =0A= skb_queue_head_init() for consistency.=0A=