Spdk/lib/bdev/virtio
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
..
bdev_virtio_blk.c bdev/virito: add JSON config dump and generic create RPC 2018-04-17 17:16:06 -04:00
bdev_virtio_rpc.c bdev/virito: add JSON config dump and generic create RPC 2018-04-17 17:16:06 -04:00
bdev_virtio_scsi.c bdev/virtio/scsi: validate bs and num_blocks before creating a bdev 2018-05-02 22:10:39 +00:00
bdev_virtio.h bdev/virtio/rpc: allow listing created devices 2018-03-28 13:12:06 -04:00
Makefile bdev/virtio: added vhost-blk initiator 2018-03-02 13:41:38 -05:00