vdpa/ifc: fix vhost message size check issue
PATCH 1/1 vdpa/ifc: fix vhost message size check issue
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).
--- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/ifc/ifcvf_vdpa.c +1 -1
@@ -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 ;
Signature · 1 line
1.8.3.1
Quoted 6 lines · Andy Pei
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 thansizeof(struct virtio_blk_config).
Quoted 7 lines
Fixes 856d03bcdc54 ("vdpa/ifc: add block operations")Signed-off-by Andy Pei <[email protected]>--- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks,
Maxime
Maxime Coquelin
AppliedQuoted 6 lines · Andy Pei
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 thansizeof(struct virtio_blk_config).
Quoted 6 lines
Fixes 856d03bcdc54 ("vdpa/ifc: add block operations")Signed-off-by Andy Pei <[email protected]>--- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to dpdk-next-virtio/main.
Thanks,
Maxime
Hi Maxime,
Thanks for your effort.
Quoted 29 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Friday, July 1, 2022 9:55 PM
To: Pei, Andy <[email protected]>; [email protected]
Cc: Xia, Chenbo <[email protected]>; Xu, Rosen <[email protected]>; Xiao, QimaiX <[email protected]>
Subject: Re: [PATCH] vdpa/ifc: fix vhost message size check issueQuoted 1 line · Andy Pei
For vhost message
VHOST_USER_GET_CONFIG, we do not check payloadsize
Quoted 10 lines
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 <[email protected]>--- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Applied to dpdk-next-virtio/main.
Thanks,
Maxime