Spdk/lib/bdev
Dariusz Stojaczyk 14cf1ad3ac bdev/virtio/scsi: validate bs and num_blocks before creating a bdev
This becomes especially useful when accidentally
trying to use vhost-blk socket as a vhost-scsi one.
There's no SCSI/Block identification within the protocol,
so blk messages can be interpreted as scsi ones.
This usually results in a bdev being created with
bs==0 && blocksize==0 and leads to a crash.

Nevertheless, this extra check should be here to protect
against malicious/incomplete vhost-scsi targets crashing
entire initiator apps.

Change-Id: I06cfe3852c35fbd3e6a9f9a337a5abe5febaddf2
Signed-off-by: Dariusz Stojaczyk <darek.stojaczyk@gmail.com>
Reviewed-on: https://review.gerrithub.io/409671
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-02 22:10:39 +00:00
..
aio bdev/aio: Fix EAGAIN handling. 2018-04-23 20:16:44 +00:00
error bdev: Wait for io device to unregister in bdev_part 2018-04-17 11:47:09 -04:00
gpt bdev/gpt: allocate buffer with correct alignment 2018-04-24 16:19:04 +00:00
iscsi iscsi_initiator: Make the disconnect in async mode. 2018-04-25 20:20:34 +00:00
lvol lvol: add destroy_lvol_bdev RPC method 2018-04-24 21:33:56 +00:00
malloc bdev/malloc: num_blocks parameter should be uint64_t 2018-04-06 18:22:22 -04:00
null bdev/null: fix RPC string memory leak 2018-04-06 18:22:22 -04:00
nvme bdev/nvme: Validate adrfam when printing out config file 2018-04-23 16:14:32 +00:00
passthru vbdev/passthru: add the construct_passthru_bdev RPC method 2018-04-20 14:58:13 -04:00
pmem bdev/pmem: add conf support to test in blockdev.sh 2018-04-03 14:14:29 -04:00
rbd bdev/rbd: add missing block_size in RPC config dump 2018-04-05 14:57:43 -04:00
rpc bdev/qos: add the QoS information on RPC get_bdevs interface 2018-04-20 13:34:44 -04:00
split bdev: Wait for io device to unregister in bdev_part 2018-04-17 11:47:09 -04:00
virtio bdev/virtio/scsi: validate bs and num_blocks before creating a bdev 2018-05-02 22:10:39 +00:00
bdev.c bdev/qos: Add unit tests for spdk_bdev_set_qos_limit_iops 2018-05-02 16:25:13 +00:00
Makefile bdev/pmem: change all NVML strings to PMDK 2018-04-07 00:07:57 -04:00
part.c bdev: Wait for io device to unregister in bdev_part 2018-04-17 11:47:09 -04:00
scsi_nvme.c nvme_spec: remove SGL Sub Type Invalid status code 2017-09-22 17:11:53 -04:00
vtune.c bdev: disable new GCC 7 warning in VTune code 2018-03-19 15:58:15 -04:00