[PATCH v4 3/5] nvme: refactor nvme_submit_user_cmd()

Clay Mayers Clay.Mayers at kioxia.com
Thu May 5 11:37:36 PDT 2022


> From: Kanchan Joshi
> Sent: Wednesday, May 4, 2022 11:06 PM
> ---

>  drivers/nvme/host/ioctl.c | 47 ++++++++++++++++++++++++++++++++++-----
>  1 file changed, 42 insertions(+), 5 deletions(-)
>
> +static int nvme_execute_user_rq(struct request *req, void __user
> *meta_buffer,
> +		unsigned meta_len, u64 *result)
> +{
> +	struct bio *bio = req->bio;
> +	bool write = bio_op(bio) == REQ_OP_DRV_OUT;

I'm getting a NULL ptr access on the first ioctl(NVME_IOCTL_ADMIN64_CMD)
I send - it has no ubuffer so I think there's no req->bio.

> +	int ret;
> +	void *meta = nvme_meta_from_bio(bio);
> +
>  	ret = nvme_execute_passthru_rq(req);
> +
>  	if (result)
>  		*result = le64_to_cpu(nvme_req(req)->result.u64);
>  	if (meta && !ret && !write) {


More information about the Linux-nvme mailing list