From: Mike Pattrick <mkp@redhat.com>
To: beilei.xing@intel.com, murphyx.yang@intel.com
Cc: dev@dpdk.org, Mike Pattrick <mkp@redhat.com>, stable@dpdk.org
Subject: [PATCH] net/i40e: Populate error in flow_parse_fdir_pattern
Date: Mon, 21 Mar 2022 23:19:37 -0400 [thread overview]
Message-ID: <20220322031937.252037-1-mkp@redhat.com> (raw)
Errors from i40e_flow_parse_fdir_pattern() can bubble up to
rte_flow_create. If rte_flow_error is not initialized a caller may
dereference error->message. This may be uninitialized memory, leading
to a segemntation fault.
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Fixes: 4a072ad43442 ("net/i40e: fix flow director config after flow validate")
Cc: stable@dpdk.org
---
drivers/net/i40e/i40e_flow.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index e0cf996200..4f3808cb5f 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -3142,8 +3142,11 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
/* Check if the input set is valid */
if (i40e_validate_input_set(pctype, RTE_ETH_FILTER_FDIR,
input_set) != 0) {
- PMD_DRV_LOG(ERR, "Invalid input set");
- return -EINVAL;
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Invalid input set");
+ return -rte_errno;
}
filter->input.flow_ext.input_set = input_set;
--
2.27.0
next reply other threads:[~2022-03-22 3:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-22 3:19 Mike Pattrick [this message]
2022-03-22 8:35 ` David Marchand
2022-03-24 9:15 ` 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=20220322031937.252037-1-mkp@redhat.com \
--to=mkp@redhat.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=murphyx.yang@intel.com \
--cc=stable@dpdk.org \
/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).