]> git.itanic.dy.fi Git - linux-stable/commit
nvmet: nul-terminate the NQNs passed in the connect command
authorChristoph Hellwig <hch@lst.de>
Fri, 17 Nov 2023 13:13:36 +0000 (08:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Dec 2023 06:31:22 +0000 (07:31 +0100)
commite26c6febac43a2dd2c5fb993b2137489005d43bf
treed426ff7c52982fc2e6de283406b1b6bd2dcff827
parentb5d50c6a609da672e0606a2791102e1eed440c8b
nvmet: nul-terminate the NQNs passed in the connect command

[ Upstream commit 1c22e0295a5eb571c27b53c7371f95699ef705ff ]

The host and subsystem NQNs are passed in the connect command payload and
interpreted as nul-terminated strings.  Ensure they actually are
nul-terminated before using them.

Fixes: a07b4970f464 "nvmet: add a generic NVMe target")
Reported-by: Alon Zahavi <zahavi.alon@gmail.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/target/fabrics-cmd.c