vdpa/ifc: fix vhost message size check issue
Checks
Commit Message
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@intel.com>
---
drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 6/21/22 15:46, Andy Pei wrote:
> 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@intel.com>
> ---
> drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
On 6/21/22 15:46, Andy Pei wrote:
> 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@intel.com>
> ---
> 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.
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Friday, July 1, 2022 9:55 PM
> To: Pei, Andy <andy.pei@intel.com>; dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: Re: [PATCH] vdpa/ifc: fix vhost message size check issue
>
>
>
> On 6/21/22 15:46, Andy Pei wrote:
> > 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@intel.com>
> > ---
> > drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> Applied to dpdk-next-virtio/main.
>
> Thanks,
> Maxime
@@ -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;