pipeline: fix instruction label check

Message ID 1634786612-115588-1-git-send-email-yogesh.jangra@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series pipeline: fix instruction label check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Yogesh Jangra Oct. 21, 2021, 3:23 a.m. UTC
  The instruction_data array was incorrectly indexed, which resulted in
the array index getting out of bounds and sometimes segfault.

Fixes: a1711f (“pipeline: add SWX Rx and extract instructions“)
Cc: stable@dpdk.org

Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/pipeline/rte_swx_pipeline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Oct. 25, 2021, 12:06 p.m. UTC | #1
21/10/2021 05:23, Yogesh Jangra:
> The instruction_data array was incorrectly indexed, which resulted in
> the array index getting out of bounds and sometimes segfault.
> 
> Fixes: a1711f (“pipeline: add SWX Rx and extract instructions“)
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks.
  

Patch

diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index 1cd09a4..0550560 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -5983,7 +5983,7 @@  struct_field_parse(struct rte_swx_pipeline *p,
 			continue;
 
 		for (j = i + 1; j < n_instructions; j++)
-			CHECK(strcmp(label, data[j].label), EINVAL);
+			CHECK(strcmp(label, instruction_data[j].label), EINVAL);
 	}
 
 	/* Get users for each instruction label. */