[PATCH] nvme: disallow passthru cmd from targeting a nsid != nsid of the block dev

Christoph Hellwig hch at lst.de
Thu Mar 25 16:30:28 GMT 2021


On Thu, Mar 25, 2021 at 09:48:37AM +0000, Niklas Cassel wrote:
> @@ -1632,6 +1632,8 @@ static int nvme_user_cmd(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
>  		return -EFAULT;
>  	if (cmd.flags)
>  		return -EINVAL;
> +	if (ns && cmd.nsid != ns->head->ns_id)
> +		return -EINVAL;

Shouldn't we log something to the kernel log including the device
and current->comm?



More information about the Linux-nvme mailing list