linux/drivers/nvme/target
Vitaliy Shevtsov c94e965f76 nvmet-auth: assign dh_key to NULL after kfree_sensitive
[ Upstream commit d2f551b1f7 ]

ctrl->dh_key might be used across multiple calls to nvmet_setup_dhgroup()
for the same controller. So it's better to nullify it after release on
error path in order to avoid double free later in nvmet_destroy_auth().

Found by Linux Verification Center (linuxtesting.org) with Svace.

Fixes: 7a277c37d3 ("nvmet-auth: Diffie-Hellman key exchange support")
Cc: stable@vger.kernel.org
Signed-off-by: Vitaliy Shevtsov <v.shevtsov@maxima.ru>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-11-08 16:26:46 +01:00
..
admin-cmd.c nvmet: fix I/O Command Set specific Identify Controller 2023-05-11 23:03:22 +09:00
auth.c nvmet-auth: assign dh_key to NULL after kfree_sensitive 2024-11-08 16:26:46 +01:00
configfs.c nvmet: fix ns enable/disable possible hang 2024-06-12 11:03:54 +02:00
core.c nvmet: always initialize cqe.result 2024-07-25 09:49:13 +02:00
discovery.c nvme: move from strlcpy with unused retval to strscpy 2022-09-19 11:33:53 +02:00
fabrics-cmd-auth.c nvmet: always initialize cqe.result 2024-07-25 09:49:13 +02:00
fabrics-cmd.c nvmet: always initialize cqe.result 2024-07-25 09:49:13 +02:00
fc.c nvmet-fc: take ref count on tgtport before delete assoc 2024-03-01 13:26:28 +01:00
fcloop.c nvmet-fcloop: swap the list_add_tail arguments 2024-03-01 13:26:27 +01:00
io-cmd-bdev.c nvmet: don't look at the request_queue in nvmet_bdev_set_limits 2022-09-27 18:51:50 +02:00
io-cmd-file.c nvmet: use bvec_set_page to initialize bvecs 2023-09-23 11:11:08 +02:00
Kconfig nvmet-auth: select the intended CRYPTO_DH_RFC7919_GROUPS 2022-08-02 17:22:51 -06:00
loop.c nvme: consolidate setting the tagset flags 2023-02-01 08:34:43 +01:00
Makefile nvmet: implement basic In-Band Authentication 2022-08-02 17:14:49 -06:00
nvmet.h nvmet: fix nvme status code when namespace is disabled 2024-06-12 11:03:03 +02:00
passthru.c nvmet-passthru: propagate status from id override functions 2024-06-21 14:35:52 +02:00
rdma.c nvmet-rdma: fix possible bad dereference when freeing rsps 2024-08-29 17:30:40 +02:00
tcp.c nvmet-tcp: fix kernel crash if commands allocation fails 2024-09-12 11:10:29 +02:00
trace.c nvmet-trace: avoid dereferencing pointer too early 2024-08-29 17:30:34 +02:00
trace.h nvmet-trace: avoid dereferencing pointer too early 2024-08-29 17:30:34 +02:00
zns.c nvmet: fix I/O Command Set specific Identify Controller 2023-05-11 23:03:22 +09:00