Skip to content

Commit

Permalink
examples/ipsec-secgw: fix uninitialized memory access
Browse files Browse the repository at this point in the history
[ upstream commit 0b512a9 ]

rte_flow_validate and rte_flow_create not always initialize flow error.
Using error.message in some error cases will cause read from
uninitialized memory.

Fixes: 6738c0a ("examples/ipsec-secgw: support flow director")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
  • Loading branch information
f0rget-the-sad authored and kevintraynor committed Jun 8, 2022
1 parent 3a9e4cd commit 51952c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/ipsec-secgw/flow.c
Expand Up @@ -214,7 +214,7 @@ flow_init_single(struct flow_rule_entry *rule)
struct rte_flow_item pattern[MAX_RTE_FLOW_PATTERN] = {};
struct rte_flow_action action[MAX_RTE_FLOW_ACTIONS] = {};
struct rte_flow_attr attr = {};
struct rte_flow_error err;
struct rte_flow_error err = {};
int ret;

attr.egress = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/ipsec-secgw/ipsec.c
Expand Up @@ -496,7 +496,7 @@ int
create_ipsec_esp_flow(struct ipsec_sa *sa)
{
int ret = 0;
struct rte_flow_error err;
struct rte_flow_error err = {};
if (sa->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
RTE_LOG(ERR, IPSEC,
"No Flow director rule for Egress traffic\n");
Expand Down

0 comments on commit 51952c8

Please sign in to comment.