Commit 37d94868 authored by Jens Axboe's avatar Jens Axboe
Browse files

Merge tag 'nvme-6.7-2023-11-8' of git://git.infradead.org/nvme into block-6.7

Pull NVMe fixes from Keith:

"nvme fixes for 6.7

 - nvme keyring config compile fixes (Hannes and Arnd)
 - fabrics keep alive fixes (Hannes)
 - tcp authentication fixes (Mark)
 - io_uring_cmd error handling fix (Anuj)
 - stale firmware attribute fix (Daniel)
 - tcp memory leak (Christophe)
 - cytpo library usage simplification (Eric)"

* tag 'nvme-6.7-2023-11-8' of git://git.infradead.org/nvme:
  nvme: keyring: fix conditional compilation
  nvme: common: make keyring and auth separate modules
  nvme: start keep-alive after admin queue setup
  nvme-loop: always quiesce and cancel commands before destroying admin q
  nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_queue()
  nvme-auth: always set valid seq_num in dhchap reply
  nvme-auth: add flag for bi-directional auth
  nvme-auth: auth success1 msg always includes resp
  nvme: fix error-handling for io_uring nvme-passthrough
  nvme: update firmware version after commit
  nvme-tcp: Fix a memory leak
  nvme-auth: use crypto_shash_tfm_digest()
parents 1b0a151c 706add13
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_NVME_COMMON)		+= common/
obj-y		+= common/
obj-y		+= host/
obj-y		+= target/
+2 −5
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

config NVME_COMMON
       tristate

config NVME_KEYRING
       bool
       tristate
       select KEYS

config NVME_AUTH
	bool
	tristate
	select CRYPTO
	select CRYPTO_HMAC
	select CRYPTO_SHA256
+4 −3
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@

ccflags-y			+= -I$(src)

obj-$(CONFIG_NVME_COMMON)	+= nvme-common.o
obj-$(CONFIG_NVME_AUTH)		+= nvme-auth.o
obj-$(CONFIG_NVME_KEYRING)	+= nvme-keyring.o

nvme-common-$(CONFIG_NVME_AUTH)	+= auth.o
nvme-common-$(CONFIG_NVME_KEYRING) += keyring.o
nvme-auth-y			+= auth.o
nvme-keyring-y			+= keyring.o
+2 −21
Original line number Diff line number Diff line
@@ -341,7 +341,6 @@ int nvme_auth_augmented_challenge(u8 hmac_id, u8 *skey, size_t skey_len,
		u8 *challenge, u8 *aug, size_t hlen)
{
	struct crypto_shash *tfm;
	struct shash_desc *desc;
	u8 *hashed_key;
	const char *hmac_name;
	int ret;
@@ -369,29 +368,11 @@ int nvme_auth_augmented_challenge(u8 hmac_id, u8 *skey, size_t skey_len,
		goto out_free_key;
	}

	desc = kmalloc(sizeof(struct shash_desc) + crypto_shash_descsize(tfm),
		       GFP_KERNEL);
	if (!desc) {
		ret = -ENOMEM;
		goto out_free_hash;
	}
	desc->tfm = tfm;

	ret = crypto_shash_setkey(tfm, hashed_key, hlen);
	if (ret)
		goto out_free_desc;

	ret = crypto_shash_init(desc);
	if (ret)
		goto out_free_desc;

	ret = crypto_shash_update(desc, challenge, hlen);
	if (ret)
		goto out_free_desc;
		goto out_free_hash;

	ret = crypto_shash_final(desc, aug);
out_free_desc:
	kfree_sensitive(desc);
	ret = crypto_shash_tfm_digest(tfm, challenge, hlen, aug);
out_free_hash:
	crypto_free_shash(tfm);
out_free_key:
+7 −4
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ key_serial_t nvme_tls_psk_default(struct key *keyring,
}
EXPORT_SYMBOL_GPL(nvme_tls_psk_default);

int nvme_keyring_init(void)
static int __init nvme_keyring_init(void)
{
	int err;

@@ -171,12 +171,15 @@ int nvme_keyring_init(void)
	}
	return 0;
}
EXPORT_SYMBOL_GPL(nvme_keyring_init);

void nvme_keyring_exit(void)
static void __exit nvme_keyring_exit(void)
{
	unregister_key_type(&nvme_tls_psk_key_type);
	key_revoke(nvme_keyring);
	key_put(nvme_keyring);
}
EXPORT_SYMBOL_GPL(nvme_keyring_exit);

MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Hannes Reinecke <hare@suse.de>");
module_init(nvme_keyring_init);
module_exit(nvme_keyring_exit);
Loading