Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp674576img; Fri, 22 Mar 2019 06:21:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqx27AG+RwnEuU460cZdoAytB897HPAezbKnxnqubU/f6yg/AEI2YWjUR2EQrMlrckcCglZH X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr9630592plb.340.1553260892669; Fri, 22 Mar 2019 06:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553260892; cv=none; d=google.com; s=arc-20160816; b=Ymf3+vi/1UCXmcx+MM9cjG3MpN4mkwkUIWEs79QkNHeIk/vZMN0Re/7g/NXsIW2zJP ryeQQaysyQr1dI7V6k97PBKsV/n/TY186jWgw9loV1rfCIqKo1D4PeByKSnxmounu140 nx/uDeuzR83OAjWHfpsZA/jFXYs+67aR/yvV+WSlMa/L2T8pSzFGcLTDFhfbQbwRBWmQ rSdlXJaj1rCzwVulSyoisJi52tTS10f8EBdHKjPCDBv0OFwsK1v1K4A+DKPnf8CafcEJ qo2vHJjtPmPqb7hoq+zTEOJz/v2N9u9eDEFd1647pdTEX1jKr57qC40PIIlQPaLguYMr bSfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2h2mNHxf1DMeABKQTPUEmPYJIU4+dJog/B22dKpA/so=; b=QducPpFPIn0zOOQDI2cDzRM+PBpVwXGoLAbHlmqeiFFl0U1jcmsmZ5Ma348rocoUXf irm0ePJGmEmw5WZrCBWeXq9OoY0cHfE1cIT13kSYFlqUEqyHmgUNCN+LMJxDg8qbT5Xp /OAJsA+/WQzxxJLNoPTf934+nyvw+uBGggpEosFZySgFLxAIVXvfWImxyo06C1fzF5jc oLehKpsTz5Pj8Yxw2ALnsGVapAALPmw7/M5monp4igHF9p1guZbEYk7EF/GQ7oIEQWJo A46uurPXtiPEtj05d05OxESqqatW/vQgJnS+zknwg7Fqz3wVV7n3nIWF3sXoakMdz+D6 W8Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SVQ6B8BV; 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 r3si3620885plb.226.2019.03.22.06.21.17; Fri, 22 Mar 2019 06:21:32 -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=@kernel.org header.s=default header.b=SVQ6B8BV; 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 S1728139AbfCVLVL (ORCPT + 99 others); Fri, 22 Mar 2019 07:21:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728504AbfCVLVJ (ORCPT ); Fri, 22 Mar 2019 07:21:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0166E218A2; Fri, 22 Mar 2019 11:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253668; bh=Ci8r9JrvBQlkMj6wlh01sOCISBE4+eY9wb35xQ7lnnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SVQ6B8BV76gNDw3+jYS4miXqU6m6IWy3jxPw7vEUMpFaKBJIMGY/eG6Gil75n06bh jOJY0ULZ5wJMs/stLnH+WW83OBtZp+RTgHAynrk040MkeiKSbccM6jer6Gsx0b8h5Y vTgGjoyoFBRibVKO/f3BIr+UqH3OyHsK2m0vys+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Varun Prakash , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 3.18 035/134] scsi: csiostor: fix NULL pointer dereference in csio_vport_set_state() Date: Fri, 22 Mar 2019 12:14:08 +0100 Message-Id: <20190322111212.275272667@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit fe35a40e675473eb65f2f5462b82770f324b5689 ] Assign fc_vport to ln->fc_vport before calling csio_fcoe_alloc_vnp() to avoid a NULL pointer dereference in csio_vport_set_state(). ln->fc_vport is dereferenced in csio_vport_set_state(). Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/csiostor/csio_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/csiostor/csio_attr.c b/drivers/scsi/csiostor/csio_attr.c index 065a87ace623b..22b800b5ac7ff 100644 --- a/drivers/scsi/csiostor/csio_attr.c +++ b/drivers/scsi/csiostor/csio_attr.c @@ -582,12 +582,12 @@ csio_vport_create(struct fc_vport *fc_vport, bool disable) } fc_vport_set_state(fc_vport, FC_VPORT_INITIALIZING); + ln->fc_vport = fc_vport; if (csio_fcoe_alloc_vnp(hw, ln)) goto error; *(struct csio_lnode **)fc_vport->dd_data = ln; - ln->fc_vport = fc_vport; if (!fc_vport->node_name) fc_vport->node_name = wwn_to_u64(csio_ln_wwnn(ln)); if (!fc_vport->port_name) -- 2.19.1