* [PATCH v1] common/idpf: fix possible null dereference
@ 2022-11-09 5:17 Mingxia Liu
2022-11-09 7:44 ` Zhang, Qi Z
0 siblings, 1 reply; 2+ messages in thread
From: Mingxia Liu @ 2022-11-09 5:17 UTC (permalink / raw)
To: dev; +Cc: jingjing.wu, beilei.xing, xiao.w.wang, junfeng.guo, mingxial, stable
From: mingxial <mingxia.liu@intel.com>
Coverity is reporting FORWARD_NULL issue when msg.ctx.indirect.payload
is NULL. Adding NULL check for this.
Coverity issue: 381689
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 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/common/idpf/base/idpf_common.c b/drivers/common/idpf/base/idpf_common.c
index bcc0c11ae8..3a9fdb1878 100644
--- a/drivers/common/idpf/base/idpf_common.c
+++ b/drivers/common/idpf/base/idpf_common.c
@@ -234,6 +234,8 @@ int idpf_clean_arq_element(struct idpf_hw *hw,
e->desc.ret_val = msg.status;
e->desc.datalen = msg.data_len;
if (msg.data_len > 0) {
+ if (!msg.ctx.indirect.payload)
+ return -EINVAL;
e->buf_len = msg.data_len;
msg_data_len = msg.data_len;
idpf_memcpy(e->msg_buf, msg.ctx.indirect.payload->va, msg_data_len,
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH v1] common/idpf: fix possible null dereference
2022-11-09 5:17 [PATCH v1] common/idpf: fix possible null dereference Mingxia Liu
@ 2022-11-09 7:44 ` Zhang, Qi Z
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2022-11-09 7:44 UTC (permalink / raw)
To: Liu, Mingxia, dev
Cc: Wu, Jingjing, Xing, Beilei, Wang, Xiao W, Guo, Junfeng, Liu,
Mingxia, stable
> -----Original Message-----
> From: Mingxia Liu <mingxia.liu@intel.com>
> Sent: Wednesday, November 9, 2022 1:17 PM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Wang, Xiao W <xiao.w.wang@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>; Liu, Mingxia <mingxia.liu@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v1] common/idpf: fix possible null dereference
>
> From: mingxial <mingxia.liu@intel.com>
>
> Coverity is reporting FORWARD_NULL issue when msg.ctx.indirect.payload is
> NULL. Adding NULL check for this.
>
> Coverity issue: 381689
> Fixes: fb4ac04e9bfa ("common/idpf: introduce common library")
> Cc: stable@dpdk.org
Fix current release no need Cc stable
>
> Signed-off-by: mingxial <mingxia.liu@intel.com>
s/mingxial/Mingxia Liu/
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-09 7:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 5:17 [PATCH v1] common/idpf: fix possible null dereference Mingxia Liu
2022-11-09 7:44 ` Zhang, Qi Z
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).