vDPA/ifcvf: get_config_size should return a value no greater than dev implementation
authorZhu Lingshan <lingshan.zhu@intel.com>
Fri, 22 Jul 2022 11:53:04 +0000 (19:53 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 11 Aug 2022 08:26:08 +0000 (04:26 -0400)
commit0d6e5e8d1686ce5d055c5ecaa76e5f51609ce9da
treef00e76993fff19f4d754ca8b58bd4b72cfb99801
parentf49c2226af8444563897e25bf293ea29e377995a
vDPA/ifcvf: get_config_size should return a value no greater than dev implementation

Drivers must not access a BAR outside the capability length,
and for a virtio device, ifcvf driver should not report any non-standard
capability contents to the upper layers.

Function ifcvf_get_config_size() is introduced here to return a safe value
of the device config capability size.

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Message-Id: <20220722115309.82746-2-lingshan.zhu@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/ifcvf/ifcvf_base.c
drivers/vdpa/ifcvf/ifcvf_base.h