Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2021229imu; Fri, 14 Dec 2018 04:38:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/VYKQ7hEkTZwvMZThz8ud/hxcv1EpbSQ+mUGU/mwnfzGi6yMyo8Vr643VEvI3vNzt3UZJ9J X-Received: by 2002:a63:d301:: with SMTP id b1mr2608493pgg.61.1544791082794; Fri, 14 Dec 2018 04:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544791082; cv=none; d=google.com; s=arc-20160816; b=QwBtmgOSIP+NIpmF0De5sBDA5tVdPy6B3MXdgo7vOBfC2oLgYg1DrC+cew7AupTnVt XvT409erDwYACimkHnxmbP5kjop9FpHnJq56vW+Q9R21ISCkeJH5sPUbM3I0xTCFTOD2 h6RqKOdk2XcP38f6Hk1EdvZO2Cxc/XL+fs0zNKF7pkDYxNqpGTm2uThNwzljcYerqPZM RdcgF4Cbp+SkiVZ9+iuSkzTscVREfDFrvrPwleT3FFSt3yqw39BkRaeIH+pTq2XP5dUs iIWATwHT096bBrEVSMtc7M4Ct335Qb+woSoFPP9qvLG9taCsomPHy5kWw4vWmuPVxzRz 128w== 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=SnZl3m7oH6I1bGUazjRmOKBp3oQfo9/oQhKoewdvA4c=; b=ge5vBSijUU+miU7YH6tdmvYsrRs+f7vSKe0nYIhUprFXJLMCS+r52eQ9q13cBJk0SY uGd/oEEGwrAywKQF4KDdvWcw8eTTT7m3xidM8INfVTE6jKhGp5+098tlNCykzFEwKBdP dkfRUsfvjkc3pqzduTJCsDEtYDy2W5yRIaQBrxCReJoCwgnXIa1Ob12SDu66VFldfMGG CqtoS42zoPUj5zd4xBQWwj1PyNoC7pIj+LRdV2c2hqtp1bGrXV/kmrA2srj2BvS9kXB2 0qe7FEV7Eu0d+BClUVGcfjxBIZRRfmxyD4eeqN5wJGuXEkvBo88GRjQR5dudXwfmVRfV Nr6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EaoYtQyw; 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 d4si4259173pla.58.2018.12.14.04.37.48; Fri, 14 Dec 2018 04:38:02 -0800 (PST) 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=EaoYtQyw; 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 S1731067AbeLNMHM (ORCPT + 99 others); Fri, 14 Dec 2018 07:07:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:52326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731030AbeLNMHK (ORCPT ); Fri, 14 Dec 2018 07:07:10 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 443E42147D; Fri, 14 Dec 2018 12:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789229; bh=ouMRBUYnSbpn4SyYKMrIYHr+Zz+f0iNrKgoHuL2LJ9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EaoYtQywcwzCO5Tjy/PIQ6/cfbax/x6MMY/5Gxr0LHQIrFugGV/qjBgwsKJQVcslO jDrm0wOO2xm4htAL8JIFQgzzbrZh+JNyywRS3sgq5z0Bhs8v23zFpEo2m4EGEoeaCC avcfJZzD4AnFKLimhSltJCffZyC4RZ1Ghh+X3yHc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Prabhath Sajeepa , Roland Dreier , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.19 122/142] nvme-rdma: fix double freeing of async event data Date: Fri, 14 Dec 2018 13:00:07 +0100 Message-Id: <20181214115751.910696070@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115747.053633987@linuxfoundation.org> References: <20181214115747.053633987@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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 6344d02dc8f886b6bbcd922ae1a17e4a41500f2d ] Some error paths in configuration of admin queue free data buffer associated with async request SQE without resetting the data buffer pointer to NULL, This buffer is also freed up again if the controller is shutdown or reset. Signed-off-by: Prabhath Sajeepa Reviewed-by: Roland Dreier Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/rdma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index dc042017c293..b6a28de682e8 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -184,6 +184,7 @@ static int nvme_rdma_alloc_qe(struct ib_device *ibdev, struct nvme_rdma_qe *qe, qe->dma = ib_dma_map_single(ibdev, qe->data, capsule_size, dir); if (ib_dma_mapping_error(ibdev, qe->dma)) { kfree(qe->data); + qe->data = NULL; return -ENOMEM; } @@ -816,6 +817,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl, out_free_async_qe: nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, sizeof(struct nvme_command), DMA_TO_DEVICE); + ctrl->async_event_sqe.data = NULL; out_free_queue: nvme_rdma_free_queue(&ctrl->queues[0]); return error; -- 2.19.1