Spdk/test/unit/lib/bdev
Jonas Pfefferle 192e64bcc5 bdev: spdk_bdev_ext_io_opts missing size check
ext_io_opts uses the size member to allow backwards
compatibility however currently we only check if it is
below or equal the current size of the opts struct and
that it is not 0. size is only used when we copy opts
because of split or push/pull.
This patch introduces size checks to allow safe access
to e.g. metadata and memory domain pointers of the user
provided opts pointer. The minimum size of the struct
passed is now the size of the initial version of
spdk_bdev_ext_io_opts. To not introduce additional
checks when opts are consumed by a bdev module we
now always copy if the size is smaller than the
current opts struct size.
When introducing new members to opts additional
checks might be needed if those are directly accessed
through the passed pointer or bdev_io->internal.ext_opts.

Change-Id: Ibd181a5840a3d5022018a9f61403df961ffd6e1d
Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12550
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-20 15:55:50 +00:00
..
bdev_zone.c spelling: test 2021-12-03 08:13:22 +00:00
bdev.c bdev: spdk_bdev_ext_io_opts missing size check 2022-05-20 15:55:50 +00:00
compress.c bdev/compress: Verify mbuf chain if the driver doesn't suppot SGL 2022-03-31 09:34:52 +00:00
crypto.c module/bdev: Use spdk_bdev_unregister_by_name() if possible 2022-04-04 09:57:43 +00:00
gpt test: optimize unit test .gitignore files 2021-08-20 07:29:57 +00:00
mt bdev: abort all IOs when unregistering the bdev 2022-05-18 07:30:00 +00:00
nvme bdev/nvme: Poll adminq more often during ctrlr disconnection 2022-05-20 09:17:28 +00:00
part.c bdev: pull/push data if bdev doesn't support 2022-04-04 09:57:56 +00:00
pmem module/bdev: Use spdk_bdev_unregister_by_name() if possible 2022-04-04 09:57:43 +00:00
raid bdev/raid: Add concat module 2022-04-05 07:39:00 +00:00
scsi_nvme.c test: optimize unit test .gitignore files 2021-08-20 07:29:57 +00:00
vbdev_lvol.c Bdev/Lvol: check base bdev's md before examining 2022-05-20 09:18:18 +00:00
vbdev_zone_block.c module/bdev: Use spdk_bdev_unregister_by_name() if possible 2022-04-04 09:57:43 +00:00
Makefile ut/bdev_ocssd: Move bdev_ocssd_ut from bdev directory to bdev/nvme directory 2021-02-09 11:29:53 +00:00