Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1894120img; Sat, 23 Mar 2019 15:42:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxffUstdfxykeazi4QulTntDzYIVzq4xcpNrU5N3z+iT0PpGXKjzBJa9M9CZ4Vu3OcEkGxW X-Received: by 2002:a17:902:7798:: with SMTP id o24mr10925085pll.316.1553380966323; Sat, 23 Mar 2019 15:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553380966; cv=none; d=google.com; s=arc-20160816; b=a3A+EWQ93ywagZYt3xC2BQNu1V000dBAZf2UB5u0jO8ry2LSkfP/A63WyxXVGiJgBp e0yBQm3BoeF8bIsrvUzTBTKTrGG2Nb579aaVvVf6PvDn9rAEcp4cwUDU8WQU6t9YZjj3 20UZ5YWJjR4MYuXq7N01U4NiSWNvcqFQIVrdRSFofNzNHrIqMcmg9kOiAqJkAeutphpY QMuM6zOsILsMavY2S3jNo8aoiVp5N9HYOcPRWg4DTtmwCmt7jGPlVaOz16AGcKpflCG2 2wqts0d5bYxebHB0rjQPYCIZd/Y9KafAhAdb10emKo7MhCAppA/kHVu3WbZ3M8dj8OdT nCoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :from:in-reply-to:references:cc:subject:dkim-signature; bh=+fKxgDGSPmUqLXo9HKk8/efhTORtUU9n7nsvOWorgpY=; b=mIyJHayk2mgPmxXMBRDM35JfOhkyatGW7Lkc6X5ziKGqFSkRoDTXUBch5wwatnlIhb JiC0M1K2q+NOEp6TwDhf2Tp4ciNwE2ziPFhzRVGBLcEsAmjKL8XRSr2eP7cJkStyzmas W/HUiNmgXwjkL77JN7zxb8RPCxYS9l6zGYTI+jOrmx72WBWv/112tH9aBnVmJx2KOW9p 8pWtAGr2R4/pd0RzpjsHZOW2Dy0EIWi6SoLtNaqNsGQ/X+8X5j/FYwA50baWOyRzdbfS aVvsH5ZMmWbwICrCkVaBX/IObUPF8m+bC9A58lpzX5C3XPgVq/JPhocnw/om2kkOmM5M is6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b="Zl/1R1gs"; 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=umn.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10si10926936plb.375.2019.03.23.15.42.31; Sat, 23 Mar 2019 15:42:46 -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=@umn.edu header.s=google header.b="Zl/1R1gs"; 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=umn.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727927AbfCWWkB (ORCPT + 99 others); Sat, 23 Mar 2019 18:40:01 -0400 Received: from mta-p5.oit.umn.edu ([134.84.196.205]:57764 "EHLO mta-p5.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727808AbfCWWkA (ORCPT ); Sat, 23 Mar 2019 18:40:00 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-p5.oit.umn.edu (Postfix) with ESMTP id 66104C4A for ; Sat, 23 Mar 2019 22:39:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p5.oit.umn.edu ([127.0.0.1]) by localhost (mta-p5.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id teDR9uDW6ZsH for ; Sat, 23 Mar 2019 17:39:59 -0500 (CDT) Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p5.oit.umn.edu (Postfix) with ESMTPS id 37877C81 for ; Sat, 23 Mar 2019 17:39:59 -0500 (CDT) Received: by mail-io1-f69.google.com with SMTP id e72so4875325iof.7 for ; Sat, 23 Mar 2019 15:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=subject:cc:references:in-reply-to:from:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=+fKxgDGSPmUqLXo9HKk8/efhTORtUU9n7nsvOWorgpY=; b=Zl/1R1gsw66RM1fBwZICrqbFCFjwnZI0wTSMtiXXQWpp+ubszOGkLvrdlnjbnF0kk0 GXpAAK613pxMxmKmZmjgLiz97EbrXS/YQTP5zDbFLKkDyZq8wizn30b2+qZADPQnsyN5 1LN8+sqvKQvLZvzE4mBMjB3NnjC0Uf6LqDlpbb5iLmiuGaJCbi3+Gqk6G+Z3Zkb30Sek YV9yxQmtyZWmlNz6WaXQ6+dGu0ik/IUL6eiq4n/Rg4B0nIHbGjNyRu7lSgnHbtSwfmzF fTt8b1lJtCFmENB0CP5Ti8RYvFCVRrt2UbtkfcaH1/h7uGRDiwuSLdV3ddy2oZs+IyCv jlrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:cc:references:in-reply-to:from :message-id:date:user-agent:mime-version:content-transfer-encoding :content-language; bh=+fKxgDGSPmUqLXo9HKk8/efhTORtUU9n7nsvOWorgpY=; b=lv2HeAspXyOhO816abFbGIoCBeUULgR+I0NX6adToGBJ61HtTKYsPq4PunWdn7R8sQ DTxG7khn14PyVF8vHVjp+Uy2f0QBURwF/qUlFCjtxFw1c0lJLqKa9r/USDTaNkO960go YzwWkvtRvZzOlqLSgEqzKFEPAbvrKj9KauoIjXECaxzebXfCeyij188QJyLZ/+37YMyl T3c+ai9Ria8PrlmP5wPsOtsH3csJI+7JL6rHQET8SJmCmkjSIMghaNFxvM/S0qdbZ+5V uqMWNmF7gmTS0LZTXsNrn3+VLe+ZYOb7AdTaCOCjgxCEqK+xewe0CNvdk2nBLRhBVLk5 Acyg== X-Gm-Message-State: APjAAAX0ouYnrZYBrssKakC4HRPqBQL4ixU9iTzs2AHG+iQSvEJ/Ku8Z VOM69HgBQGMxrhIxiktWVeR5yzXrbQ7RUWAeJpilBOV+53/14cTwvuEFRId4MuIzXDurpXZSCma 637JBNT4DkBW8Jzm4Z0w1PJsLapBT X-Received: by 2002:a02:6a2c:: with SMTP id l44mr10396328jac.63.1553380798736; Sat, 23 Mar 2019 15:39:58 -0700 (PDT) X-Received: by 2002:a02:6a2c:: with SMTP id l44mr10396318jac.63.1553380798553; Sat, 23 Mar 2019 15:39:58 -0700 (PDT) Received: from [128.101.106.66] (cs-u-syssec1.cs.umn.edu. [128.101.106.66]) by smtp.gmail.com with ESMTPSA id a77sm3389666itc.5.2019.03.23.15.39.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 15:39:58 -0700 (PDT) Subject: Re: [PATCH] scsi: qla4xxx: fix a potential NULL pointer dereference Cc: Kangjie Lu , QLogic-Storage-Upstream@qlogic.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190314063100.12805-1-kjlu@umn.edu> In-Reply-To: <20190314063100.12805-1-kjlu@umn.edu> From: Aditya Pakki Message-ID: <5c390db5-c2a2-cfad-48c1-c619244db9c1@umn.edu> Date: Sat, 23 Mar 2019 17:39:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/14/19 1:30 AM, Kangjie Lu wrote: > In case iscsi_lookup_endpoint fails, the fix returns -EINVAL to > avoid NULL pointer dereference. > > Signed-off-by: Kangjie Lu > --- > drivers/scsi/qla4xxx/ql4_os.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c > index a77bfb224248..80289c885c07 100644 > --- a/drivers/scsi/qla4xxx/ql4_os.c > +++ b/drivers/scsi/qla4xxx/ql4_os.c > @@ -3203,6 +3203,8 @@ static int qla4xxx_conn_bind(struct iscsi_cls_session *cls_session, > if (iscsi_conn_bind(cls_session, cls_conn, is_leading)) > return -EINVAL; > ep = iscsi_lookup_endpoint(transport_fd); > + if (!ep) > + return -EINVAL; > conn = cls_conn->dd_data; > qla_conn = conn->dd_data; > qla_conn->qla_ep = ep->dd_data; Gentle reminder, could someone please review this ?