Spdk/lib/nvmf
Seth Howell 9cfd844f5f lib/nvmf: properly validate fuse command fields.
The fuse command value is a two byte value, but we were only checking to
see if the fuse value was equal to SPDK_NVME_CMD_FUSE_FIRST or
SPDK_NVME_CMD_FUSE_SECOND in spdk_nvmf_ctrlr_process_io_fused_cmd. If a
haywire initiator sent a command with a fused value equal to
SPDK_NVME_CMD_FUSE_MASK, that would result in us skipping all checks and
dereferencing a null pointer in
spdk_nvmf_bdev_ctrlr_compare_and_write_cmd.

To fix this, add an extra condition to validate the cuse field.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/483123 (master)
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>

(cherry picked from commit f0ca01e102)
Change-Id: I1ec4169ff5637562effd694f7046c6e3389627f1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/483255
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
2020-01-30 16:57:01 +00:00
..
ctrlr_bdev.c nvmf: Return ACWU and NACWU values in indentify structures 2020-01-27 17:39:52 +00:00
ctrlr_discovery.c nvmf: don't keep a global discovery log page. 2019-09-03 00:30:59 +00:00
ctrlr.c lib/nvmf: properly validate fuse command fields. 2020-01-30 16:57:01 +00:00
custom_cmd_hdlr.c lib/nvmf: custom admin cmd handler 2020-01-20 09:56:35 +00:00
fc_ls.c lib/nvmf: get_transport now takes a string. 2020-01-16 09:10:38 +00:00
fc.c nvmf: pass listen done cb to transport specific code 2020-01-16 09:18:38 +00:00
Makefile lib/nvmf: custom admin cmd handler 2020-01-20 09:56:35 +00:00
nvmf_fc.h lib/nvme: update trid struct with trstring. 2020-01-16 09:10:38 +00:00
nvmf_internal.h nvmf: Add support for compare op command 2020-01-27 17:39:52 +00:00
nvmf_rpc.c lib/nvmf: nvmf target stops to listen when subsystem is destroyed 2020-01-22 13:53:34 +00:00
nvmf.c lib/nvmf: nvmf target stops to listen when subsystem is destroyed 2020-01-22 13:53:34 +00:00
rdma.c nvmf/rdma: fix call to spdk_nvmf_rdma_listen 2020-01-23 16:38:46 +00:00
subsystem.c lib/nvmf: nvmf target stops to listen when subsystem is destroyed 2020-01-22 13:53:34 +00:00
tcp.c nvmf/tcp: Correctly kick the recv state machine when a request is freed 2020-01-27 17:42:24 +00:00
transport.c nvmf/tcp: Simplify qpair resource initialization 2020-01-27 17:42:24 +00:00
transport.h nvmf/tcp: Simplify qpair resource initialization 2020-01-27 17:42:24 +00:00