]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme-ioctl: fix leaked requests on mapping error
authorKeith Busch <kbusch@kernel.org>
Tue, 25 Feb 2025 01:13:30 +0000 (17:13 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:02:01 +0000 (13:02 +0100)
commit9dedafd86e4dec2b8c299b4f68db1bb994c0ea0d
treedef58a27c0a05f9cb95f2ef151f21682f69c4847
parent3c63fb6ef7f387ce8fbc0d952dc6179b75068a9a
nvme-ioctl: fix leaked requests on mapping error

[ Upstream commit 00817f0f1c45b007965f5676b9a2013bb39c7228 ]

All the callers assume nvme_map_user_request() frees the request on a
failure. This wasn't happening on invalid metadata or io_uring command
flags, so we've been leaking those requests.

Fixes: 23fd22e55b767b ("nvme: wire up fixed buffer support for nvme passthrough")
Fixes: 7c2fd76048e95d ("nvme: fix metadata handling in nvme-passthrough")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/ioctl.c