public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 00/16] nvme: rework dhchap authentication host code
@ 2022-11-09  3:44 Sagi Grimberg
  2022-11-09  3:44 ` [PATCH 01/16] nvme-auth: rename __nvme_auth_[reset|free] to nvme_auth[reset|free]_dhchap Sagi Grimberg
                   ` (18 more replies)
  0 siblings, 19 replies; 43+ messages in thread
From: Sagi Grimberg @ 2022-11-09  3:44 UTC (permalink / raw)
  To: linux-nvme
  Cc: Christoph Hellwig, Hannes Reinecke, Keith Busch,
	Chaitanya Kulkarni

Currently the authentication code is fairly fragile with respect to
mutual locking between secrets sysfs override, re-authentication, and
controller resets.

This patch set attempts to resolve these issues by:
1. freeing queue chap context as soon as authentication completes
2. allocates a simple vector for queue chap contexts so there is
no list/tree traversal to resolve queue chap context. queue chap
contexts are 1x1 mapped to queues, which are stored in a vector as
well.
3. flush chap auth_work from the ctrl dhchap work, this simplifies
how we flush inflight authentication sequence
4. use ctrl dhchap_auth_mutex to protect only the resources that are
accessed and modified via sysfs and the authentication flow (i.e. ctrl
host_key and ctrl_key)
5. move drivers (rdma/tcp) nvme_auth_stop later in the error recovery
flow to expedite failover and not block on I/O.


Feedback is welcome.

Sagi Grimberg (16):
  nvme-auth: rename __nvme_auth_[reset|free] to
    nvme_auth[reset|free]_dhchap
  nvme-auth: remove symbol export from nvme_auth_reset
  nvme-auth: don't re-authenticate if the controller is not LIVE
  nvme-auth: remove redundant buffer deallocations
  nvme-auth: don't ignore key generation failures when initializing ctrl
    keys
  nvme-auth: don't override ctrl keys before validation
  nvme-auth: remove redundant if statement
  nvme-auth: don't keep long lived 4k dhchap buffer
  nvme-auth: clear sensitive info right after authentication completes
  nvme-auth: remove redundant deallocations
  nvme-auth: no need to reset chap contexts on re-authentication
  nvme-auth: convert dhchap_auth_list to an array
  nvme-auth: remove redundant auth_work flush
  nvme-auth: have dhchap_auth_work wait for queues auth to complete
  nvme-tcp: stop auth work after tearing down queues in error recovery
  nvme-rdma: stop auth work after tearing down queues in error recovery

 drivers/nvme/host/auth.c | 209 ++++++++++++++++++---------------------
 drivers/nvme/host/core.c |  26 +++--
 drivers/nvme/host/nvme.h |   5 +-
 drivers/nvme/host/rdma.c |   2 +-
 drivers/nvme/host/tcp.c  |   2 +-
 5 files changed, 121 insertions(+), 123 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2022-11-09 19:06 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-09  3:44 [PATCH 00/16] nvme: rework dhchap authentication host code Sagi Grimberg
2022-11-09  3:44 ` [PATCH 01/16] nvme-auth: rename __nvme_auth_[reset|free] to nvme_auth[reset|free]_dhchap Sagi Grimberg
2022-11-09 17:35   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 02/16] nvme-auth: remove symbol export from nvme_auth_reset Sagi Grimberg
2022-11-09  7:30   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 03/16] nvme-auth: don't re-authenticate if the controller is not LIVE Sagi Grimberg
2022-11-09  7:33   ` Hannes Reinecke
2022-11-09 19:00     ` Sagi Grimberg
2022-11-09  3:44 ` [PATCH 04/16] nvme-auth: remove redundant buffer deallocations Sagi Grimberg
2022-11-09 17:36   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 05/16] nvme-auth: don't ignore key generation failures when initializing ctrl keys Sagi Grimberg
2022-11-09  7:33   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 06/16] nvme-auth: don't override ctrl keys before validation Sagi Grimberg
2022-11-09  7:34   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 07/16] nvme-auth: remove redundant if statement Sagi Grimberg
2022-11-09  6:37   ` Christoph Hellwig
2022-11-09 18:42     ` Sagi Grimberg
2022-11-09  7:34   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 08/16] nvme-auth: don't keep long lived 4k dhchap buffer Sagi Grimberg
2022-11-09  6:39   ` Christoph Hellwig
2022-11-09 18:05     ` Sagi Grimberg
2022-11-09 17:37   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 09/16] nvme-auth: clear sensitive info right after authentication completes Sagi Grimberg
2022-11-09  7:35   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 10/16] nvme-auth: remove redundant deallocations Sagi Grimberg
2022-11-09  3:44 ` [PATCH 11/16] nvme-auth: no need to reset chap contexts on re-authentication Sagi Grimberg
2022-11-09  7:36   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 12/16] nvme-auth: convert dhchap_auth_list to an array Sagi Grimberg
2022-11-09  6:48   ` Christoph Hellwig
2022-11-09 19:06     ` Sagi Grimberg
2022-11-09 17:40   ` Hannes Reinecke
2022-11-09 19:05     ` Sagi Grimberg
2022-11-09  3:44 ` [PATCH 13/16] nvme-auth: remove redundant auth_work flush Sagi Grimberg
2022-11-09 17:41   ` Hannes Reinecke
2022-11-09  3:44 ` [PATCH 14/16] nvme-auth: have dhchap_auth_work wait for queues auth to complete Sagi Grimberg
2022-11-09  7:44   ` Hannes Reinecke
2022-11-09 19:01     ` Sagi Grimberg
2022-11-09  3:44 ` [PATCH 15/16] nvme-tcp: stop auth work after tearing down queues in error recovery Sagi Grimberg
2022-11-09  3:44 ` [PATCH 16/16] nvme-rdma: " Sagi Grimberg
2022-11-09  3:44 ` [PATCH 17/16 blktests] nvme: add re-authentication running concurrently with reset Sagi Grimberg
2022-11-09  3:47 ` [PATCH 00/16] nvme: rework dhchap authentication host code Sagi Grimberg
2022-11-09  7:45 ` Hannes Reinecke
2022-11-09 17:42   ` Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox