All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <keith.busch@wdc.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>,
	linux-nvme@lists.infradead.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH 10/12] nvmet: Implement basic In-Band Authentication
Date: Wed, 29 Sep 2021 23:02:09 +0300	[thread overview]
Message-ID: <a850b479-cea5-fdf3-2ea8-00a2b3e601b5@grimberg.me> (raw)
In-Reply-To: <c1c90d31-a4c3-ab13-2f29-55a103715ef8@suse.de>


>> On the target:
>> # grep -r ''
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress\:uuid\:b73ff014-2723-4114-aa8d-2f784ecba4f4/
>>
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4/dhchap_dhgroup:null
>>
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4/dhchap_hash:hmac(sha512)
>>
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4/dhchap_ctrl_key:
>>
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4/dhchap_key:DHHC-1:03:KUwVlIUo627Pn05W/lRL2XD57kzIs1yZzJWdd2vgZJUC74kr:
>>
>>
>> On the host:
>> # ./nvme connect-all
>> --dhchap-secret="DHHC-1:03:KUwVlIUo627Pn05W/lRL2XD57kzIs1yZzJWdd2vgZJUC74kr:"
>>
>> failed to connect controller, error 5
>>
>> On the target dmesg:
>> [ 8695.716117] nvmet: creating controller 1 for subsystem
>> nqn.2014-08.org.nvmexpress.discovery for NQN
>> nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4.
>> [ 8695.749996] nvmet: creating controller 2 for subsystem testnqn1 for
>> NQN nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4
>> with DH-HMAC-CHAP.
>> [ 8695.755361] nvmet: ctrl 2 qid 0 failure1 (1)
>> [ 8695.755449] nvmet: ctrl 2 fatal error occurred!
>>
>> On the host dmesg:
>> [ 8781.616712] nvme nvme1: new ctrl: NQN
>> "nqn.2014-08.org.nvmexpress.discovery", addr 192.168.123.1:8009
>> [ 8781.637954] nvme nvme2: qid 0: authentication failed
>> [ 8781.638084] nvme nvme2: failed to connect queue: 0 ret=401
>>
>> If I change the dhchap_hash to hmac(sha256) authentication succeeds.
>> The failure with hmac(sha512) comes from the above condition as the
>> host is sending key length 64 and nvmet is expecting 32.
> 
> A-ha. That shouldn't have happened; selecting the hash on the target was
> _supposed_ to be reflected to the host.
> 
> You did mention something about blocktests; guess I'll need to bite the
> bullet and actually implement something there.

That is why I mentioned it ;)

WARNING: multiple messages have this Message-ID (diff)
From: Sagi Grimberg <sagi@grimberg.me>
To: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <keith.busch@wdc.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>,
	linux-nvme@lists.infradead.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH 10/12] nvmet: Implement basic In-Band Authentication
Date: Wed, 29 Sep 2021 23:02:09 +0300	[thread overview]
Message-ID: <a850b479-cea5-fdf3-2ea8-00a2b3e601b5@grimberg.me> (raw)
In-Reply-To: <c1c90d31-a4c3-ab13-2f29-55a103715ef8@suse.de>


>> On the target:
>> # grep -r ''
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress\:uuid\:b73ff014-2723-4114-aa8d-2f784ecba4f4/
>>
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4/dhchap_dhgroup:null
>>
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4/dhchap_hash:hmac(sha512)
>>
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4/dhchap_ctrl_key:
>>
>> /sys/kernel/config/nvmet/hosts/nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4/dhchap_key:DHHC-1:03:KUwVlIUo627Pn05W/lRL2XD57kzIs1yZzJWdd2vgZJUC74kr:
>>
>>
>> On the host:
>> # ./nvme connect-all
>> --dhchap-secret="DHHC-1:03:KUwVlIUo627Pn05W/lRL2XD57kzIs1yZzJWdd2vgZJUC74kr:"
>>
>> failed to connect controller, error 5
>>
>> On the target dmesg:
>> [ 8695.716117] nvmet: creating controller 1 for subsystem
>> nqn.2014-08.org.nvmexpress.discovery for NQN
>> nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4.
>> [ 8695.749996] nvmet: creating controller 2 for subsystem testnqn1 for
>> NQN nqn.2014-08.org.nvmexpress:uuid:b73ff014-2723-4114-aa8d-2f784ecba4f4
>> with DH-HMAC-CHAP.
>> [ 8695.755361] nvmet: ctrl 2 qid 0 failure1 (1)
>> [ 8695.755449] nvmet: ctrl 2 fatal error occurred!
>>
>> On the host dmesg:
>> [ 8781.616712] nvme nvme1: new ctrl: NQN
>> "nqn.2014-08.org.nvmexpress.discovery", addr 192.168.123.1:8009
>> [ 8781.637954] nvme nvme2: qid 0: authentication failed
>> [ 8781.638084] nvme nvme2: failed to connect queue: 0 ret=401
>>
>> If I change the dhchap_hash to hmac(sha256) authentication succeeds.
>> The failure with hmac(sha512) comes from the above condition as the
>> host is sending key length 64 and nvmet is expecting 32.
> 
> A-ha. That shouldn't have happened; selecting the hash on the target was
> _supposed_ to be reflected to the host.
> 
> You did mention something about blocktests; guess I'll need to bite the
> bullet and actually implement something there.

That is why I mentioned it ;)

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2021-09-29 20:02 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28  6:03 [PATCHv4 00/12] nvme: In-band authentication support Hannes Reinecke
2021-09-28  6:03 ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 01/12] crypto: add crypto_has_shash() Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 02/12] crypto: add crypto_has_kpp() Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 03/12] crypto/ffdhe: Finite Field DH Ephemeral Parameters Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 04/12] lib/base64: RFC4648-compliant base64 encoding Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:24   ` Eric Biggers
2021-09-28  6:24     ` Eric Biggers
2021-09-28  7:16     ` Hannes Reinecke
2021-09-28  7:16       ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 05/12] nvme: add definitions for NVMe In-Band authentication Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 06/12] nvme-fabrics: decode 'authentication required' connect error Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 07/12] nvme: Implement In-Band authentication Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 08/12] nvme-auth: Diffie-Hellman key exchange support Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 09/12] nvmet: Parse fabrics commands on all queues Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 10/12] nvmet: Implement basic In-Band Authentication Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-29 10:37   ` Sagi Grimberg
2021-09-29 10:37     ` Sagi Grimberg
2021-09-29 12:26     ` Hannes Reinecke
2021-09-29 12:26       ` Hannes Reinecke
2021-09-29 12:36       ` Sagi Grimberg
2021-09-29 12:36         ` Sagi Grimberg
2021-09-29 14:32         ` Hannes Reinecke
2021-09-29 14:32           ` Hannes Reinecke
2021-09-29 20:02           ` Sagi Grimberg [this message]
2021-09-29 20:02             ` Sagi Grimberg
2021-09-28  6:03 ` [PATCH 11/12] nvmet-auth: Diffie-Hellman key exchange support Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-28  6:03 ` [PATCH 12/12] nvmet-auth: expire authentication sessions Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-10-08 21:19 ` [PATCHv4 00/12] nvme: In-band authentication support Himanshu Madhani
2021-10-08 21:19   ` Himanshu Madhani
  -- strict thread matches above, loose matches on Subject: below --
2021-12-02 15:23 [PATCHv8 " Hannes Reinecke
2021-12-02 15:23 ` [PATCH 10/12] nvmet: Implement basic In-Band Authentication Hannes Reinecke
2021-11-23 12:37 [PATCHv7 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-23 12:37 ` [PATCH 10/12] nvmet: Implement basic In-Band Authentication Hannes Reinecke
2021-11-22  7:47 [PATCHv6 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-22  7:47 ` [PATCH 10/12] nvmet: Implement basic In-Band Authentication Hannes Reinecke
2021-11-22 11:59   ` Sagi Grimberg
2021-11-22 12:06     ` Hannes Reinecke
2021-11-22 13:21     ` Hannes Reinecke
2021-11-22 14:00       ` Sagi Grimberg
2021-11-22 14:17         ` Hannes Reinecke
2021-11-22 14:31           ` Sagi Grimberg
2021-11-12 12:59 [PATCHv5 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-12 12:59 ` [PATCH 10/12] nvmet: Implement basic In-Band Authentication Hannes Reinecke
2021-11-19 13:44   ` kernel test robot
2021-09-10  6:43 [PATCHv3 00/12] nvme: In-band authentication support Hannes Reinecke
2021-09-10  6:43 ` [PATCH 10/12] nvmet: Implement basic In-Band Authentication Hannes Reinecke
2021-09-10  6:43   ` Hannes Reinecke
2021-09-11 23:10   ` kernel test robot
2021-09-26 14:30   ` Sagi Grimberg
2021-09-26 14:30     ` Sagi Grimberg
2021-09-26 22:51   ` Sagi Grimberg
2021-09-26 22:51     ` Sagi Grimberg
2021-09-27  6:40     ` Hannes Reinecke
2021-09-27  6:40       ` Hannes Reinecke
2021-09-27  7:17       ` Hannes Reinecke
2021-09-27  7:17         ` Hannes Reinecke
2021-09-27  7:55         ` Sagi Grimberg
2021-09-27  7:55           ` Sagi Grimberg
2021-09-27  8:28           ` Hannes Reinecke
2021-09-27  8:28             ` Hannes Reinecke
2021-09-28 22:36             ` Sagi Grimberg
2021-09-28 22:36               ` Sagi Grimberg
2021-09-29  6:01               ` Hannes Reinecke
2021-09-29  6:01                 ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a850b479-cea5-fdf3-2ea8-00a2b3e601b5@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=davem@davemloft.net \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=keith.busch@wdc.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.