mirror_ubuntu-kernels/drivers/nvme/host
Niklas Cassel c881a23fb6 nvme: disallow passthru cmd from targeting a nsid != nsid of the block dev
When a passthru command targets a specific namespace, the ns parameter to
nvme_user_cmd()/nvme_user_cmd64() is set. However, there is currently no
validation that the nsid specified in the passthru command targets the
namespace/nsid represented by the block device that the ioctl was
performed on.

Add a check that validates that the nsid in the passthru command matches
that of the supplied namespace.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Javier González <javier@javigon.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2021-04-06 08:34:38 +02:00
..
core.c nvme: disallow passthru cmd from targeting a nsid != nsid of the block dev 2021-04-06 08:34:38 +02:00
fabrics.c nvme-fabrics: fix kato initialization 2021-03-05 13:41:03 +01:00
fabrics.h nvme-fabrics: reject I/O to offline device 2020-12-01 20:36:37 +01:00
fault_inject.c nvme: enable to inject errors into admin commands 2019-06-21 11:15:50 +02:00
fc.c nvme-fc: check sgl supported by target 2021-04-02 18:48:29 +02:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c nvme-hwmon: Return error code when registration fails 2021-03-05 13:41:03 +01:00
Kconfig nvme-tcp: fix kconfig dependency warning when !CRYPTO 2020-09-15 07:58:49 +02:00
lightnvm.c nvme: use bio_set_dev to assign ->bi_bdev 2021-01-26 08:50:01 -07:00
Makefile nvme: support for zoned namespaces 2020-07-08 16:16:20 +02:00
multipath.c nvme: retrigger ANA log update if group descriptor isn't found 2021-04-06 08:34:38 +02:00
nvme.h nvme: use driver pdu command for passthrough 2021-04-02 18:48:27 +02:00
pci.c nvme: use driver pdu command for passthrough 2021-04-02 18:48:27 +02:00
rdma.c nvme: use driver pdu command for passthrough 2021-04-02 18:48:27 +02:00
tcp.c nvme-tcp: check sgl supported by target 2021-04-02 18:48:28 +02:00
trace.c nvme: add tracing of zns commands 2021-02-02 10:26:12 +01:00
trace.h nvme-trace: print result and status in hex format 2019-06-21 11:12:37 +02:00
zns.c nvme: set max_zone_append_sectors nvme_revalidate_zones 2021-03-11 11:48:34 +01:00