]> 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)
committerKeith Busch <kbusch@kernel.org>
Mon, 20 Nov 2023 17:25:33 +0000 (09:25 -0800)
commit1c22e0295a5eb571c27b53c7371f95699ef705ff
treef729a30e956550ddbb358383834ff0774d7485e7
parentc7ca9757bda35ff9ce27ab42f2cb8b84d983e6ad
nvmet: nul-terminate the NQNs passed in the connect command

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>
drivers/nvme/target/fabrics-cmd.c