]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme-auth: don't override ctrl keys before validation
authorSagi Grimberg <sagi@grimberg.me>
Sun, 13 Nov 2022 11:24:11 +0000 (13:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:02 +0000 (13:33 +0100)
commit1f116dfd114fe8e419c1f4f90ce55a38a92a4fe1
tree0ba4290216c8ae1a7e938b41de8a8706514a425c
parent43a819c467a1a1b1a31936b2f97c1b7c2f1c9da3
nvme-auth: don't override ctrl keys before validation

[ Upstream commit 01604350e14560d4d69323eb1ba12a257a643ea8 ]

Replace ctrl ctrl_key/host_key only after nvme_auth_generate_key is successful.
Also, this fixes a bug where the keys are leaked.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c