From: Mingxia Liu <mingxia.liu@intel.com>
To: dev@dpdk.org
Cc: jingjing.wu@intel.com, beilei.xing@intel.com,
xiao.w.wang@intel.com, junfeng.guo@intel.com,
mingxial <mingxia.liu@intel.com>,
stable@dpdk.org
Subject: [PATCH v1] common/idpf: fix tainted scalar
Date: Wed, 9 Nov 2022 05:01:30 +0000 [thread overview]
Message-ID: <20221109050130.392235-1-mingxia.liu@intel.com> (raw)
From: mingxial <mingxia.liu@intel.com>
Passing tainted expression "msg.data_len" to
"rte_memcpy", which uses it as a loop boundary.
Replace tainted expression with a temp variable
to avoid the tainted scalar coverity warning.
Coverity issue: 381688
Fixes: fb4ac04e9bfa ("common/idpf: introduce common library")
Cc: stable@dpdk.org
Signed-off-by: mingxial <mingxia.liu@intel.com>
---
drivers/common/idpf/base/idpf_common.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/common/idpf/base/idpf_common.c b/drivers/common/idpf/base/idpf_common.c
index 1debf129a3..bcc0c11ae8 100644
--- a/drivers/common/idpf/base/idpf_common.c
+++ b/drivers/common/idpf/base/idpf_common.c
@@ -221,6 +221,7 @@ int idpf_clean_arq_element(struct idpf_hw *hw,
{
struct idpf_ctlq_msg msg = { 0 };
int status;
+ u16 msg_data_len;
*pending = 1;
@@ -234,7 +235,8 @@ int idpf_clean_arq_element(struct idpf_hw *hw,
e->desc.datalen = msg.data_len;
if (msg.data_len > 0) {
e->buf_len = msg.data_len;
- idpf_memcpy(e->msg_buf, msg.ctx.indirect.payload->va, msg.data_len,
+ msg_data_len = msg.data_len;
+ idpf_memcpy(e->msg_buf, msg.ctx.indirect.payload->va, msg_data_len,
IDPF_DMA_TO_NONDMA);
}
return status;
--
2.25.1
next reply other threads:[~2022-11-09 5:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 5:01 Mingxia Liu [this message]
2022-11-09 7:28 ` Zhang, Qi Z
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=20221109050130.392235-1-mingxia.liu@intel.com \
--to=mingxia.liu@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=junfeng.guo@intel.com \
--cc=stable@dpdk.org \
--cc=xiao.w.wang@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).