examples/ipsec-secgw: fix uninitialized memory access
Checks
Commit Message
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: 6738c0a9569 ("examples/ipsec-secgw: support flow director")
Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
examples/ipsec-secgw/flow.c | 2 +-
examples/ipsec-secgw/ipsec.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
>
> ----------------------------------------------------------------------
> 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: 6738c0a9569 ("examples/ipsec-secgw: support flow director")
>
> Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> ---
> examples/ipsec-secgw/flow.c | 2 +-
> examples/ipsec-secgw/ipsec.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
Acked-by: Anoob Joseph <anoobj@marvell.com>
> > 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: 6738c0a9569 ("examples/ipsec-secgw: support flow director")
> >
> > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > ---
> > examples/ipsec-secgw/flow.c | 2 +-
> > examples/ipsec-secgw/ipsec.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
>
> Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.
> -----Original Message-----
> From: Akhil Goyal
> Sent: Thursday, May 12, 2022 1:06 AM
> To: Anoob Joseph <anoobj@marvell.com>; Volodymyr Fialko
> <vfialko@marvell.com>; dev@dpdk.org; Radu Nicolau
> <radu.nicolau@intel.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Volodymyr Fialko
> <vfialko@marvell.com>
> Subject: RE: [EXT] [PATCH] examples/ipsec-secgw: fix uninitialized memory
> access
>
>
> > > 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: 6738c0a9569 ("examples/ipsec-secgw: support flow director")
> > >
> > > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > > ---
> > > examples/ipsec-secgw/flow.c | 2 +-
> > > examples/ipsec-secgw/ipsec.c | 2 +-
> > > 2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> >
> > Acked-by: Anoob Joseph <anoobj@marvell.com>
>
> Acked-by: Akhil Goyal <gakhil@marvell.com>
>
> Applied to dpdk-next-crypto
>
> Thanks.
Cc: stable@dpdk.org
@@ -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;
@@ -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");