[PATCH] vdpa/ifc: fix vhost message size check issue
Andy Pei
andy.pei at intel.com
Tue Jun 21 15:46:31 CEST 2022
For vhost message VHOST_USER_GET_CONFIG, we do not check
payload size in vhost lib, we check payload size in driver
specific ops.
For ifc vdpa driver, we just need to make sure payload size
is not smaller than sizeof(struct virtio_blk_config).
Fixes: 856d03bcdc54 ("vdpa/ifc: add block operations")
Signed-off-by: Andy Pei <andy.pei at intel.com>
---
drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 8bc971c..ac42de9 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1400,7 +1400,7 @@ struct rte_vdpa_dev_info {
uint64_t capacity = 0;
uint8_t *byte;
- if (size != sizeof(struct virtio_blk_config)) {
+ if (size < sizeof(struct virtio_blk_config)) {
DRV_LOG(ERR, "Invalid len: %u, required: %u",
size, (uint32_t)sizeof(struct virtio_blk_config));
return -1;
--
1.8.3.1
More information about the dev
mailing list