From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751634AbcFSXQp (ORCPT ); Sun, 19 Jun 2016 19:16:45 -0400 Received: from jbeekman.nl ([149.210.172.151]:59295 "EHLO daxilon.jbeekman.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbcFSXQo (ORCPT ); Sun, 19 Jun 2016 19:16:44 -0400 X-Greylist: delayed 537 seconds by postgrey-1.27 at vger.kernel.org; Sun, 19 Jun 2016 19:16:44 EDT From: Jethro Beekman To: keith.busch@intel.com, axboe@fb.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Jethro Beekman Date: Sun, 19 Jun 2016 16:06:31 -0700 Message-Id: <20160619230634.17229-1-kernel@jbeekman.nl> X-Mailer: git-send-email 2.9.0 X-SA-Exim-Connect-IP: 24.130.121.155 X-SA-Exim-Mail-From: kernel@jbeekman.nl X-Spam-Report: Content analysis details: (-1.0 points, 5.0 required) pts rule name description --- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: github.com] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Subject: [PATCH 0/3] nvme: Don't add namespaces for locked drives Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, If an NVMe drive is locked with ATA Security, most commands sent to the drive will fail. This includes commands sent by the kernel upon discovery to probe for partitions. The failing happens in such a way that trying to do anything with the drive (e.g. sending an unlock command; unloading the nvme module) is basically impossible with the high default command timeout. This patch adds a check to see if the drive is locked, and if it is, its namespaces are not initialized. It is expected that userspace will send the proper "security send/unlock" command and then reset the controller. Userspace tools are available at [1]. This is my first kernel patch so please let me know if you have any feedback. I intend to also submit a future patch that tracks ATA Security commands sent from userspace and remembers the password so it can be submitted to a locked drive upon pm_resume. (still WIP) Jethro Beekman [1] https://github.com/jethrogb/nvme-ata-security Jethro Beekman (3): nvme: When scanning namespaces, make sure the drive is not locked nvme: Add function for NVMe security receive command nvme: Check if drive is locked using ATA Security drivers/nvme/host/core.c | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) -- 2.9.0