From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73FBCC3F2D1 for ; Fri, 28 Feb 2020 13:06:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52BB124691 for ; Fri, 28 Feb 2020 13:06:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbgB1NGG convert rfc822-to-8bit (ORCPT ); Fri, 28 Feb 2020 08:06:06 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49094 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725861AbgB1NGF (ORCPT ); Fri, 28 Feb 2020 08:06:05 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01SD4Nsh070469 for ; Fri, 28 Feb 2020 08:06:04 -0500 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [158.85.210.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yepxap6aq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 28 Feb 2020 08:06:04 -0500 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Fri, 28 Feb 2020 13:06:03 -0000 Received: from us1b3-smtp04.a3dr.sjc01.isc4sb.com (10.122.203.161) by smtp.notes.na.collabserv.com (10.122.47.39) with smtp.notes.na.collabserv.com ESMTP; Fri, 28 Feb 2020 13:05:54 -0000 Received: from us1b3-mail162.a3dr.sjc03.isc4sb.com ([10.160.174.187]) by us1b3-smtp04.a3dr.sjc01.isc4sb.com with ESMTP id 2020022813055366-387445 ; Fri, 28 Feb 2020 13:05:53 +0000 In-Reply-To: <20200227164622.GJ31668@ziepe.ca> Subject: Re: Re: possible deadlock in cma_netdev_callback From: "Bernard Metzler" To: "Jason Gunthorpe" Cc: "syzbot" , chuck.lever@oracle.com, dledford@redhat.com, leon@kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, parav@mellanox.com, syzkaller-bugs@googlegroups.com, willy@infradead.org Date: Fri, 28 Feb 2020 13:05:53 +0000 MIME-Version: 1.0 Sensitivity: Importance: Normal X-Priority: 3 (Normal) References: <20200227164622.GJ31668@ziepe.ca>,<20200227155335.GI31668@ziepe.ca> <20200226204238.GC31668@ziepe.ca> <000000000000153fac059f740693@google.com> X-Mailer: IBM iNotes ($HaikuForm 1054.1) | IBM Domino Build SCN1812108_20180501T0841_FP62 November 04, 2019 at 09:47 X-KeepSent: F9E6CFC6:7E79459D-0025851C:00472582; type=4; name=$KeepSent X-LLNOutbound: False X-Disclaimed: 15259 X-TNEFEvaluated: 1 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=UTF-8 x-cbid: 20022813-6283-0000-0000-000000FF3003 X-IBM-SpamModules-Scores: BY=0.02035; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.399202; ST=0; TS=0; UL=0; ISC=; MB=0.005929 X-IBM-SpamModules-Versions: BY=3.00012657; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000293; SDB=6.01340466; UDB=6.00714387; IPR=6.01122828; MB=3.00031010; MTD=3.00000008; XFM=3.00000015; UTC=2020-02-28 13:06:01 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2020-02-28 12:46:26 - 6.00011059 x-cbparentid: 20022813-6284-0000-0000-000000CD3278 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-28_04:2020-02-26,2020-02-28 signatures=0 X-Proofpoint-Spam-Reason: safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -----"Jason Gunthorpe" wrote: ----- >To: "Bernard Metzler" >From: "Jason Gunthorpe" >Date: 02/27/2020 05:46PM >Cc: "syzbot" , >chuck.lever@oracle.com, dledford@redhat.com, leon@kernel.org, >linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, >netdev@vger.kernel.org, parav@mellanox.com, >syzkaller-bugs@googlegroups.com, willy@infradead.org >Subject: [EXTERNAL] Re: possible deadlock in cma_netdev_callback > >On Thu, Feb 27, 2020 at 04:21:21PM +0000, Bernard Metzler wrote: >> >> >To: "Bernard Metzler" >> >From: "Jason Gunthorpe" >> >Date: 02/27/2020 04:53PM >> >Cc: "syzbot" >, >> >chuck.lever@oracle.com, dledford@redhat.com, leon@kernel.org, >> >linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, >> >netdev@vger.kernel.org, parav@mellanox.com, >> >syzkaller-bugs@googlegroups.com, willy@infradead.org >> >Subject: [EXTERNAL] Re: possible deadlock in cma_netdev_callback >> > >> >On Thu, Feb 27, 2020 at 10:11:13AM +0000, Bernard Metzler wrote: >> > >> >> Thanks for letting me know! Hmm, we cannot use RCU locks since >> >> we potentially sleep. One solution would be to create a list >> >> of matching interfaces while under lock, unlock and use that >> >> list for calling siw_listen_address() (which may sleep), >> >> right...? >> > >> >Why do you need to iterate over addresses anyhow? Shouldn't the >> >listen >> >just be done with the address the user gave and a BIND DEVICE to >the >> >device siw is connected to? >> >> The user may give a wildcard local address, so we'd have >> to bind to all addresses of that device... > >AFAIK a wild card bind using BIND DEVICE works just fine? > >Jason > Thanks Jason, absolutely! And it makes things so easy... Let me prepare and send a patch which drops all that jumbo mumbo logic to iterate over interface addresses if the socket interface does the right things anyway. It implies further simplifications to the siw connection management, since with that we never have to maintain a list of listening siw endpoints on a given cm_id; it will always be max one. I'll cleanup the code accordingly and prepare an extra cleanup patch, which I can send only later (have a very tight schedule this week). Bernard.