Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp728411ybi; Fri, 12 Jul 2019 03:44:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8t+nd5Bq7URRaIEVeDvKCf+LMkeWVfh+speEiICSIlCWSKG/hb8OkscPmhP/WaXPxGF30 X-Received: by 2002:a17:902:a514:: with SMTP id s20mr10084741plq.162.1562928273812; Fri, 12 Jul 2019 03:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562928273; cv=none; d=google.com; s=arc-20160816; b=xMrJHjHfGhz9pxnaVwD6u3fYHaj7YkaUDJFyzgzycfHCGk3sxHXnqU92x/NpEABRhV 6KjM4pDE81zPgikYqTq/DxBqTY4xLVYUZVeTWXu6i4DO2Bq7bkTZ0KbuIFxlVnVlO27/ lSgDa3hSKAZmy9oO0w3APKdCe2TtstQIaiwxVubt6DKJaX1/x03eLOSOuOWHMmxJ6xsM L1QP4h+Et4P+JV9/4EgMMXnVPPoWzz5nkYzuS6QrU8JiTYSiCmjUrvzkoA9Gu9wrrypr d80qfGNsOUG1ydRuWWxYsdpLua05CYyPrPRlwMLDYf5LlghDYFi2mbYgXscO1LNa9NKP 2lGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=N5K63/QPUOpmLwUgSxGBqjFibv+3l0kzfAVVlctTzQA=; b=mRIUUaX8yo44nFM4MoJeXK7QGP1ZG1cjfOwuwO865Tgn1KZ9dbcc0VQgL/HzwXIhyX wzeXlzSfTgB3UPm0/oXu31d2k/El22PIJjv36pMels4fKqjXj4xrF449HLe2iVstkZa5 lulQvQN/BNFZLq4ZwzwRHqodGUmnebOGnFCpBwGN86pPmM8fk+T+Z8AduTPZRIBUcPM4 XoPmXXUSuIW3fVgPoYiK7Fa3SRetxAPpcPZjonOtfWt9GHccuvA8sSGZyYpqt0IRHmSi m86edUE1uT+nxroicNai2Qvm1QPuKdTF6Xl/+e1fNWjEZgfcBnI+SLUX8CSaEH6Z0hoQ Nj4A== 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 m9si7467826pgq.373.2019.07.12.03.44.18; Fri, 12 Jul 2019 03:44:33 -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 S1726428AbfGLKn7 (ORCPT + 99 others); Fri, 12 Jul 2019 06:43:59 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:53773 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbfGLKn7 (ORCPT ); Fri, 12 Jul 2019 06:43:59 -0400 X-IronPort-AV: E=Sophos;i="5.63,482,1557180000"; d="scan'208";a="313309971" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2019 12:43:55 +0200 Date: Fri, 12 Jul 2019 12:43:52 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Hannes Reinecke cc: Colin King , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: libfc: fix null pointer dereference on a null lport In-Reply-To: <14c9e345-dd98-63e7-5ba2-679f10760fe6@suse.de> Message-ID: References: <20190702091835.13629-1-colin.king@canonical.com> <14c9e345-dd98-63e7-5ba2-679f10760fe6@suse.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1695843507-1562928232=:3900" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --8323329-1695843507-1562928232=:3900 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Fri, 12 Jul 2019, Hannes Reinecke wrote: > On 7/2/19 11:18 AM, Colin King wrote: > > From: Colin Ian King > > > > Currently if lport is null then the null lport pointer is dereference > > when printing out debug via the FC_LPORT_DB macro. Fix this by using > > the more generic FC_LIBFC_DBG debug macro instead that does not use > > lport. > > > > Addresses-Coverity: ("Dereference after null check") > > Fixes: 7414705ea4ae ("libfc: Add runtime debugging with debug_logging module parameter") > > Signed-off-by: Colin Ian King > > --- > > drivers/scsi/libfc/fc_exch.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c > > index 025cd2ff9f65..c477fadbf504 100644 > > --- a/drivers/scsi/libfc/fc_exch.c > > +++ b/drivers/scsi/libfc/fc_exch.c > > @@ -2591,8 +2591,8 @@ void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp) > > > > /* lport lock ? */ > > if (!lport || lport->state == LPORT_ST_DISABLED) { > > - FC_LPORT_DBG(lport, "Receiving frames for an lport that " > > - "has not been initialized correctly\n"); > > + FC_LIBFC_DBG("Receiving frames for an lport that " > > + "has not been initialized correctly\n"); If the code is being changed, perhaps the string could be put onto one line as well. julia > > fc_frame_free(fp); > > return; > > } > > > Reviewed-by: Hannes Reinecke > > Cheers, > > Hannes > -- > Dr. Hannes Reinecke Teamlead Storage & Networking > hare@suse.de +49 911 74053 688 > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg > GF: Felix Imendörffer, Mary Higgins, Sri Rasiah > HRB 21284 (AG Nürnberg) > --8323329-1695843507-1562928232=:3900--