From patchwork Thu Jan 17 16:14:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ewan Milne X-Patchwork-Id: 10768483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FBA613A4 for ; Thu, 17 Jan 2019 16:14:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 809073017F for ; Thu, 17 Jan 2019 16:14:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7464F301A7; Thu, 17 Jan 2019 16:14:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FFE53017F for ; Thu, 17 Jan 2019 16:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728625AbfAQQOq (ORCPT ); Thu, 17 Jan 2019 11:14:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36200 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728488AbfAQQOq (ORCPT ); Thu, 17 Jan 2019 11:14:46 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6DA3E5F793; Thu, 17 Jan 2019 16:14:46 +0000 (UTC) Received: from emilne.bos.redhat.com (unknown [10.18.25.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE8485C22E; Thu, 17 Jan 2019 16:14:45 +0000 (UTC) From: "Ewan D. Milne" To: linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org, james.smart@broadcom.com, dick.kennedy@broadcom.com Subject: [PATCH 0/2] Fix use-after-free errors in lpfc driver when using NVMe Date: Thu, 17 Jan 2019 11:14:43 -0500 Message-Id: <20190117161445.25671-1-emilne@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 17 Jan 2019 16:14:46 +0000 (UTC) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These two patches fix use-after-free errors in the shutdown path of the lpfc driver with both the Initiator and Target mode usage of FC ports. The problem is very apparent with slub_debug enabled, as the memory poisoning prevents the wait_for_completion_timeout() from returning after the object has been freed. Ewan D. Milne (2): lpfc: nvme: avoid hang / use-after-free when destroying localport lpfc: nvmet: avoid hang / use-after-free when destroying targetport drivers/scsi/lpfc/lpfc_nvme.c | 16 +++++++++------- drivers/scsi/lpfc/lpfc_nvme.h | 2 +- drivers/scsi/lpfc/lpfc_nvmet.c | 8 +++++--- drivers/scsi/lpfc/lpfc_nvmet.h | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-)