Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1809042ybe; Tue, 3 Sep 2019 03:56:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxNZfcBkiAr0cYo4FwgXgOz1u4AWN262aLP3eyRWYVy7nk+i+vwnRDvYidlQ1D5x93giQS X-Received: by 2002:aa7:85c2:: with SMTP id z2mr8322462pfn.205.1567508210755; Tue, 03 Sep 2019 03:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567508210; cv=none; d=google.com; s=arc-20160816; b=fzFxneFW2zOH3W+A3Sm29cDp2WeNPUZBBxm1VufxQFS6Cu7RNA3jr0x26G+QKw68de 4iVQw6BUKSHOLEOCFlT2i+HoxP3juIAjjMgAhyimeGz165r8599aQZe4FLPN8N7jWY6L sCulVHregumSemARulE4Qcg8EfJ5zMaODvw/wBupd2kIlIONjfJBeWuWcfCsCdeFm0nY NVFufLjaexa5Nd+6+SoNqQKqfffoHn95Y2rG9VOPywckMH4LaMcJywo9x8bQOkAz8B5M RbmSwIReWsUr2AcL9ouiZXEt/Z+/zuf2K3Kba8pmayoD2A6CN7UKLNwC4zj8F/qkPI74 8r2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EUTOAJ5vrISZdZbB5nhWLAb0dTuVygYHmRtFcNYfL9c=; b=YnTrlyWZBm/4+dn1grfLWIivMH06YmxnX2w6ISUxWDX1xd6PPJ8ZvyXZ45D5gLkZ8P T+cVzhLn3Ay9/NPbtSqKqU20cky9k7oNbTuD6tUmnEkIesxW80VpumRqFy0e7uWtXmzD 0J3x4nxfdePicJQ0LlSflRk8VC+uVIpcfQTcPhEdz/10mpWoPa0e21CPcze225a+A8gj QeDZY7dfpMYt41VJ2WVrzhfM8LIYG4ip+I1pxyIaVlXEj1ZOCLoLIK9z3ELsyQdAp0Ll ERgCrmrJSBazWJBWJ0Jmj23/pkWQVdg63VUYBc5UEOQXPnsJxIShhGf+EiPlZHILDndm KRKw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si14614456pld.177.2019.09.03.03.56.34; Tue, 03 Sep 2019 03:56:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728749AbfICKzl (ORCPT + 99 others); Tue, 3 Sep 2019 06:55:41 -0400 Received: from nautica.notk.org ([91.121.71.147]:33023 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727969AbfICKzl (ORCPT ); Tue, 3 Sep 2019 06:55:41 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id EAF20C009; Tue, 3 Sep 2019 12:55:38 +0200 (CEST) Date: Tue, 3 Sep 2019 12:55:23 +0200 From: Dominique Martinet To: Jia-Ju Bai Cc: ericvh@gmail.com, lucho@ionkov.net, davem@davemloft.net, v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: 9p: Fix possible null-pointer dereferences in p9_cm_event_handler() Message-ID: <20190903105523.GA29600@nautica> References: <20190724103948.5834-1-baijiaju1990@gmail.com> <20190724125545.GA12982@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190724125545.GA12982@nautica> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jia-Ju, Dominique Martinet wrote on Wed, Jul 24, 2019: > Jia-Ju Bai wrote on Wed, Jul 24, 2019: > > In p9_cm_event_handler(), there is an if statement on 260 to check > > whether rdma is NULL, which indicates that rdma can be NULL. > > If so, using rdma->xxx may cause a possible null-pointer dereference. > > The final dereference (complete(&rdma->cm_done) line 285) has been here > from the start, so we would have seen crashes by now if rdma could be > null at this point. > > Let's do it the other way around and remove the useless "if (rdma)" that > has been here from day 1 instead ; I basically did the same with > c->status a few months ago (from a coverity report)... Did you get anywhere with this, or should I submit a new patch myself ? In the later case I'll tag this as Reported-by you Thanks, -- Dominique