DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] vdpa/ifc: fix vhost message size check issue
@ 2022-06-21 13:46 Andy Pei
  2022-07-01 12:04 ` Maxime Coquelin
  2022-07-01 13:55 ` Maxime Coquelin
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Pei @ 2022-06-21 13:46 UTC (permalink / raw)
  To: dev; +Cc: chenbo.xia, maxime.coquelin, rosen.xu, qimaix.xiao

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(-)

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vdpa/ifc: fix vhost message size check issue
  2022-06-21 13:46 [PATCH] vdpa/ifc: fix vhost message size check issue Andy Pei
@ 2022-07-01 12:04 ` Maxime Coquelin
  2022-07-01 13:55 ` Maxime Coquelin
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2022-07-01 12:04 UTC (permalink / raw)
  To: Andy Pei, dev; +Cc: chenbo.xia, rosen.xu, qimaix.xiao



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vdpa/ifc: fix vhost message size check issue
  2022-06-21 13:46 [PATCH] vdpa/ifc: fix vhost message size check issue Andy Pei
  2022-07-01 12:04 ` Maxime Coquelin
@ 2022-07-01 13:55 ` Maxime Coquelin
  2022-07-04  2:29   ` Pei, Andy
  1 sibling, 1 reply; 4+ messages in thread
From: Maxime Coquelin @ 2022-07-01 13:55 UTC (permalink / raw)
  To: Andy Pei, dev; +Cc: chenbo.xia, rosen.xu, qimaix.xiao



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] vdpa/ifc: fix vhost message size check issue
  2022-07-01 13:55 ` Maxime Coquelin
@ 2022-07-04  2:29   ` Pei, Andy
  0 siblings, 0 replies; 4+ messages in thread
From: Pei, Andy @ 2022-07-04  2:29 UTC (permalink / raw)
  To: Maxime Coquelin, dev; +Cc: Xia, Chenbo, Xu, Rosen, Xiao, QimaiX

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-04  2:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 13:46 [PATCH] vdpa/ifc: fix vhost message size check issue Andy Pei
2022-07-01 12:04 ` Maxime Coquelin
2022-07-01 13:55 ` Maxime Coquelin
2022-07-04  2:29   ` Pei, Andy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).