Spdk/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_internal.h bdev: more ZERO_BUFFER_SIZE to bdev_internal.h 2022-04-28 07:29:43 +00:00
bdev_rpc.c bdev: remove support for deprecated RPC names 2022-05-09 23:03:02 +00:00
bdev_zone.c bdev/zone: add support for get zone id 2021-11-11 23:23:35 +00:00
bdev.c bdev: spdk_bdev_ext_io_opts missing size check 2022-05-20 15:55:50 +00:00
Makefile so_ver: increase all major versions 2022-01-31 15:29:56 +00:00
part.c bdev/part: add compare and cmp&write io types 2022-04-28 07:29:43 +00:00
scsi_nvme.c nvme: fix command specific status code 2020-02-20 09:49:24 +00:00
spdk_bdev.map bdev: Add spdk_for_each_bdev/bdev_leaf for clean up and further improvements 2022-04-05 07:30:47 +00:00
vtune.c mk: don't use '-include spdk/config.h' 2018-10-02 23:13:32 +00:00