From: Andy Pei <andy.pei@intel.com>
To: dev@dpdk.org
Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com,
rosen.xu@intel.com, qimaix.xiao@intel.com
Subject: [PATCH] vdpa/ifc: fix vhost message size check issue
Date: Tue, 21 Jun 2022 21:46:31 +0800 [thread overview]
Message-ID: <1655819191-124476-1-git-send-email-andy.pei@intel.com> (raw)
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
next reply other threads:[~2022-06-21 14:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-21 13:46 Andy Pei [this message]
2022-07-01 12:04 ` Maxime Coquelin
2022-07-01 13:55 ` Maxime Coquelin
2022-07-04 2:29 ` Pei, Andy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1655819191-124476-1-git-send-email-andy.pei@intel.com \
--to=andy.pei@intel.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=qimaix.xiao@intel.com \
--cc=rosen.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).