nvme: sanitize metadata bounce buffer for reads
authorKeith Busch <kbusch@kernel.org>
Mon, 16 Oct 2023 20:12:47 +0000 (13:12 -0700)
committerKeith Busch <kbusch@kernel.org>
Wed, 18 Oct 2023 21:08:39 +0000 (14:08 -0700)
commit2b32c76e2b0154b98b9322ae7546b8156cd703e6
tree0cb8c544784658cd755446b307fb737ea21609fb
parent4ae55a7dce04989f289d5c5c8c8e5c37adc36c71
nvme: sanitize metadata bounce buffer for reads

User can request more metadata bytes than the device will write. Ensure
kernel buffer is initialized so we're not leaking unsanitized memory on
the copy-out.

Fixes: 0b7f1f26f95a51a ("nvme: use the block layer for userspace passthrough metadata")
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/ioctl.c