From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com ([192.55.52.93]:30450 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932247AbdIFPAN (ORCPT ); Wed, 6 Sep 2017 11:00:13 -0400 Date: Wed, 6 Sep 2017 11:06:04 -0400 From: Keith Busch To: Christoph Hellwig Cc: sagi@grimberg.me, mb@lightnvm.io, linux-nvme@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] nvme: fix lightnvm check Message-ID: <20170906150604.GD17331@localhost.localdomain> References: <20170906094825.8845-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170906094825.8845-1-hch@lst.de> Sender: stable-owner@vger.kernel.org List-ID: On Wed, Sep 06, 2017 at 11:48:25AM +0200, Christoph Hellwig wrote: > nvme_nvm_ns_supported assumes every device is a pci_dev, which leads to > reading an incorrect field, or possible even a dereference of unallocated > memory for fabrics controllers. > > Fix this by introducing a quirk for lighnvm capable devices instead. Ugh, even with this quirk, new lightnvm device will be broken for all existing kernels. This sort of thing really could benefit from a standard's defined capability or command set supported bit to distinguish lightnvm devices. Lacking that, this looks like the only thing we can do at the moment. Reviewed-by: Keith Busch