From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3CD6C18E5A for ; Wed, 11 Mar 2020 15:01:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A27DC206C0 for ; Wed, 11 Mar 2020 15:01:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jREGyo+E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A27DC206C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=/DWLKL4JL5lq4fMdPF74kxwgxcWRm6snvu1d361m6iM=; b=jRE Gyo+E8SZkUXTyYLZmeLjVw/7v7uGwNqBdTz1aSTMMgYmzyHQ0Faga9t3F7Mrp/ZnmkR2hcqxqNbLx /oATgbagpEgNfDgZurDpTWURpTVlKenRztyjS/YijgI3ykgm5zTqe70duzE3tWIz7ivyec5a+1otG X4CuBRKv0F3Yqlb5rm7BpMGatPipbUVFkHXT4pzmW10EIFCseJLqtPXuwfTK39RrPwSST2j500bBg 2OQPVG+6y0quBw7K4qT9h1J3053LAhHtBJHnziTgj4k5v34SHVnlNtEJqA+4ojlti82U4nMgBb9Ip oQSEVtVxtAPlRebpn0WvfRMxBiMCsVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jC2rO-0004UY-D7; Wed, 11 Mar 2020 15:01:26 +0000 Received: from mail-il-dmz.mellanox.com ([193.47.165.129] helo=mellanox.co.il) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jC2qv-0004Py-SW for linux-nvme@lists.infradead.org; Wed, 11 Mar 2020 15:01:00 +0000 Received: from Internal Mail-Server by MTLPINE2 (envelope-from israelr@mellanox.com) with ESMTPS (AES256-SHA encrypted); 11 Mar 2020 17:00:50 +0200 Received: from rsws50.mtr.labs.mlnx (rsws50.mtr.labs.mlnx [10.209.40.61]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 02BF0oVl002953; Wed, 11 Mar 2020 17:00:50 +0200 From: Israel Rukshin To: Linux-nvme , Sagi Grimberg , Christoph Hellwig Subject: [PATCH 0/4] nvme: Fixes for deleting a ctrl before it was created Date: Wed, 11 Mar 2020 17:00:45 +0200 Message-Id: <1583938849-5787-1-git-send-email-israelr@mellanox.com> X-Mailer: git-send-email 1.8.4.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200311_080058_327832_B0E5F0C7 X-CRM114-Status: UNSURE ( 7.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Israel Rukshin , Max Gurtovoy MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org The patchset starts with warning fixes on this scenario, continue with small cleanup and ends with the actual fix. Calling nvme_sysfs_delete() when the controller is in the middle of creation may cause several bugs. If the controller is in NEW state we remove delete_controller file and don't delete the controller. The user will not be able to use nvme disconnect command on that controller again, although the controller may be active. Other bugs may happen if the controller is in the middle of create_ctrl callback and nvme_do_delete_ctrl() starts. For example, freeing I/O tagset at nvme_do_delete_ctrl() before it was created or controller use after free at create_ctrl callback. Israel Rukshin (4): nvme-rdma: Fix warning at nvme_rdma_setup_ctrl nvme-tcp: Fix warning at nvme_tcp_setup_ctrl nvme: Remove unused return code from nvme_delete_ctrl_sync nvme: Fix controller use after free at create_ctrl callback drivers/nvme/host/core.c | 13 ++++++------- drivers/nvme/host/fabrics.c | 1 + drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/rdma.c | 8 ++++++-- drivers/nvme/host/tcp.c | 8 ++++++-- 5 files changed, 20 insertions(+), 11 deletions(-) -- 1.8.3.1 _______________________________________________ linux-nvme mailing list linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme