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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 BB9E0C3F2D1 for ; Mon, 2 Mar 2020 14:52:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 902C22080C for ; Mon, 2 Mar 2020 14:52:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgCBOwH (ORCPT ); Mon, 2 Mar 2020 09:52:07 -0500 Received: from mga01.intel.com ([192.55.52.88]:57182 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727112AbgCBOwG (ORCPT ); Mon, 2 Mar 2020 09:52:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2020 06:52:06 -0800 X-IronPort-AV: E=Sophos;i="5.70,507,1574150400"; d="scan'208";a="262791876" Received: from ddalessa-mobl.amr.corp.intel.com (HELO [10.254.201.53]) ([10.254.201.53]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Mar 2020 06:52:04 -0800 Subject: Re: [PATCH for-rc] IB/hfi1, qib: Ensure RCU is locked when accessing list To: Jason Gunthorpe Cc: dledford@redhat.com, linux-rdma@vger.kernel.org, Mike Marciniszyn , Madhuparna Bhowmik References: <20200225195445.140896.41873.stgit@awfm-01.aw.intel.com> <20200228161516.GA26535@ziepe.ca> <8c036704-cd70-fd86-4fb7-20621543d1d2@intel.com> <20200302132921.GX31668@ziepe.ca> From: Dennis Dalessandro Message-ID: Date: Mon, 2 Mar 2020 09:52:03 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200302132921.GX31668@ziepe.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On 3/2/2020 8:29 AM, Jason Gunthorpe wrote: > On Mon, Mar 02, 2020 at 08:14:52AM -0500, Dennis Dalessandro wrote: >> On 2/28/2020 11:15 AM, Jason Gunthorpe wrote: >>> On Tue, Feb 25, 2020 at 02:54:45PM -0500, Dennis Dalessandro wrote: >>>> The packet handling function, specifically the iteration of the qp list >>>> for mad packet processing misses locking RCU before running through the >>>> list. Not only is this incorrect, but the list_for_each_entry_rcu() call >>>> can not be called with a conditional check for lock dependency. Remedy >>>> this by invoking the rcu lock and unlock around the critical section. >>>> >>>> This brings MAD packet processing in line with what is done for non-MAD >>>> packets. >>>> >>>> Cc: Madhuparna Bhowmik >>>> Reviewed-by: Mike Marciniszyn >>>> Signed-off-by: Dennis Dalessandro >>>> drivers/infiniband/hw/hfi1/verbs.c | 4 +++- >>>> drivers/infiniband/hw/qib/qib_verbs.c | 2 ++ >>>> 2 files changed, 5 insertions(+), 1 deletion(-) >>> >>> Applied to for-next, thanks >>> >> >> Maybe it should have went to -rc? > > It doesn't even have a fixes line. If you want patches in -rc send > better commit message. I keep repeating this again and again.. > > Jason > Crap, yeah my bad on that. However there really isn't a good fixes line for this. It's pretty much just the initial commit of the driver, does that really help? It's still just in your WIP branch so is it too late to add: Fixes: 7724105686e7 ("IB/hfi1: add driver files") Other than a fixes line what else do you need for the commit message? Messed up locking is pretty self explanatory I would think. -Denny