All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: Fix handling of metadata_len for NVME_IOCTL_IO_CMD
@ 2018-07-20  3:07 Roland Dreier
  2018-07-20 14:26 ` Keith Busch
  2018-07-20 14:47 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Roland Dreier @ 2018-07-20  3:07 UTC (permalink / raw)


From: Roland Dreier <roland@purestorage.com>

The old code in nvme_user_cmd() passed the userspace virtual address
from nvme_passthru_cmd.metadata as the length of the metadata buffer
as well as the address to nvme_submit_user_cmd().

Signed-off-by: Roland Dreier <roland at purestorage.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 46df030b2c3f..4e2a48b574cc 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1218,7 +1218,7 @@ static int nvme_user_cmd(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
 	effects = nvme_passthru_start(ctrl, ns, cmd.opcode);
 	status = nvme_submit_user_cmd(ns ? ns->queue : ctrl->admin_q, &c,
 			(void __user *)(uintptr_t)cmd.addr, cmd.data_len,
-			(void __user *)(uintptr_t)cmd.metadata, cmd.metadata,
+			(void __user *)(uintptr_t)cmd.metadata, cmd.metadata_len,
 			0, &cmd.result, timeout);
 	nvme_passthru_end(ctrl, effects);
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] nvme: Fix handling of metadata_len for NVME_IOCTL_IO_CMD
  2018-07-20  3:07 [PATCH] nvme: Fix handling of metadata_len for NVME_IOCTL_IO_CMD Roland Dreier
@ 2018-07-20 14:26 ` Keith Busch
  2018-07-20 14:47 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Keith Busch @ 2018-07-20 14:26 UTC (permalink / raw)


On Thu, Jul 19, 2018@08:07:59PM -0700, Roland Dreier wrote:
> From: Roland Dreier <roland at purestorage.com>
> 
> The old code in nvme_user_cmd() passed the userspace virtual address
> from nvme_passthru_cmd.metadata as the length of the metadata buffer
> as well as the address to nvme_submit_user_cmd().
> 
> Signed-off-by: Roland Dreier <roland at purestorage.com>
> ---
>  drivers/nvme/host/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 46df030b2c3f..4e2a48b574cc 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1218,7 +1218,7 @@ static int nvme_user_cmd(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
>  	effects = nvme_passthru_start(ctrl, ns, cmd.opcode);
>  	status = nvme_submit_user_cmd(ns ? ns->queue : ctrl->admin_q, &c,
>  			(void __user *)(uintptr_t)cmd.addr, cmd.data_len,
> -			(void __user *)(uintptr_t)cmd.metadata, cmd.metadata,
> +			(void __user *)(uintptr_t)cmd.metadata, cmd.metadata_len,
>  			0, &cmd.result, timeout);
>  	nvme_passthru_end(ctrl, effects);
>  
> -- 
> 2.17.1

Oops, doesn't look like this path was ever tested with metadata! Thanks
for the fix.

Reviewed-by: Keith Busch <keith.busch at intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] nvme: Fix handling of metadata_len for NVME_IOCTL_IO_CMD
  2018-07-20  3:07 [PATCH] nvme: Fix handling of metadata_len for NVME_IOCTL_IO_CMD Roland Dreier
  2018-07-20 14:26 ` Keith Busch
@ 2018-07-20 14:47 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2018-07-20 14:47 UTC (permalink / raw)


Thanks, applied to nvme-4.18.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-20 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20  3:07 [PATCH] nvme: Fix handling of metadata_len for NVME_IOCTL_IO_CMD Roland Dreier
2018-07-20 14:26 ` Keith Busch
2018-07-20 14:47 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.