From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE79AA2E1B for ; Thu, 5 Sep 2019 12:19:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D508F1EFA2; Thu, 5 Sep 2019 12:19:05 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 11F351EF7D for ; Thu, 5 Sep 2019 12:19:04 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8456F1DA2 for ; Thu, 5 Sep 2019 10:19:03 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-52.ams2.redhat.com [10.36.117.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DF9619C6A; Thu, 5 Sep 2019 10:19:02 +0000 (UTC) From: Kevin Traynor To: Aaron Conole Cc: dpdk stable Date: Thu, 5 Sep 2019 11:17:30 +0100 Message-Id: <20190905101754.21933-30-ktraynor@redhat.com> In-Reply-To: <20190905101754.21933-1-ktraynor@redhat.com> References: <20190905101754.21933-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Thu, 05 Sep 2019 10:19:03 +0000 (UTC) Subject: [dpdk-stable] patch 'test/flow_classify: fix undefined behavior' has been queued to LTS release 18.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 09/12/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/86c74fb5f447be396ca763d7954bba41c19809a2 Thanks. Kevin Traynor --- >From 86c74fb5f447be396ca763d7954bba41c19809a2 Mon Sep 17 00:00:00 2001 From: Aaron Conole Date: Tue, 30 Jul 2019 17:31:23 -0400 Subject: [PATCH] test/flow_classify: fix undefined behavior [ upstream commit 0d36f32ed29be8ed6d517665cdc266335eb23541 ] The unit test for the flow classify introduced undefined behavior by using a corrupted list. Remove these tests as the invalid data is impossible to detect with the current API. Fixes: 9c9befea4f57 ("test: add flow classify unit tests") Signed-off-by: Aaron Conole --- test/test/test_flow_classify.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/test/test/test_flow_classify.c b/test/test/test_flow_classify.c index 5f5beeee7..90066713e 100644 --- a/test/test/test_flow_classify.c +++ b/test/test/test_flow_classify.c @@ -125,5 +125,4 @@ static struct rte_flow_item udp_item_bad = { RTE_FLOW_ITEM_TYPE_UDP, static struct rte_flow_item end_item = { RTE_FLOW_ITEM_TYPE_END, 0, 0, 0 }; -static struct rte_flow_item end_item_bad = { -1, 0, 0, 0 }; /* test TCP pattern: @@ -180,5 +179,4 @@ static struct rte_flow_action count_action_bad = { -1, 0}; static struct rte_flow_action end_action = { RTE_FLOW_ACTION_TYPE_END, 0}; -static struct rte_flow_action end_action_bad = { -1, 0}; static struct rte_flow_action actions[2]; @@ -383,5 +381,5 @@ test_invalid_patterns(void) pattern[1] = ipv4_udp_item_1; pattern[2] = udp_item_bad; - pattern[3] = end_item_bad; + pattern[3] = end_item; ret = rte_flow_classify_validate(cls->cls, &attr, pattern, @@ -457,30 +455,4 @@ test_invalid_actions(void) } - actions[0] = count_action; - actions[1] = end_action_bad; - - ret = rte_flow_classify_validate(cls->cls, &attr, pattern, - actions, &error); - if (!ret) { - printf("Line %i: rte_flow_classify_validate", __LINE__); - printf(" should have failed!\n"); - return -1; - } - - rule = rte_flow_classify_table_entry_add(cls->cls, &attr, pattern, - actions, &key_found, &error); - if (rule) { - printf("Line %i: flow_classify_table_entry_add", __LINE__); - printf(" should have failed!\n"); - return -1; - } - - ret = rte_flow_classify_table_entry_delete(cls->cls, rule); - if (!ret) { - printf("Line %i: rte_flow_classify_table_entry_delete", - __LINE__); - printf("should have failed!\n"); - return -1; - } return 0; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-09-05 10:36:49.335117349 +0100 +++ 0030-test-flow_classify-fix-undefined-behavior.patch 2019-09-05 10:36:47.526700139 +0100 @@ -1 +1 @@ -From 0d36f32ed29be8ed6d517665cdc266335eb23541 Mon Sep 17 00:00:00 2001 +From 86c74fb5f447be396ca763d7954bba41c19809a2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0d36f32ed29be8ed6d517665cdc266335eb23541 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -15 +16 @@ - app/test/test_flow_classify.c | 30 +----------------------------- + test/test/test_flow_classify.c | 30 +----------------------------- @@ -18,5 +19,5 @@ -diff --git a/app/test/test_flow_classify.c b/app/test/test_flow_classify.c -index 6bbaad364..ff5265c6a 100644 ---- a/app/test/test_flow_classify.c -+++ b/app/test/test_flow_classify.c -@@ -126,5 +126,4 @@ static struct rte_flow_item udp_item_bad = { RTE_FLOW_ITEM_TYPE_UDP, +diff --git a/test/test/test_flow_classify.c b/test/test/test_flow_classify.c +index 5f5beeee7..90066713e 100644 +--- a/test/test/test_flow_classify.c ++++ b/test/test/test_flow_classify.c +@@ -125,5 +125,4 @@ static struct rte_flow_item udp_item_bad = { RTE_FLOW_ITEM_TYPE_UDP, @@ -28 +29 @@ -@@ -182,5 +181,4 @@ static struct rte_flow_action count_action_bad = { -1, 0}; +@@ -180,5 +179,4 @@ static struct rte_flow_action count_action_bad = { -1, 0}; @@ -34 +35 @@ -@@ -385,5 +383,5 @@ test_invalid_patterns(void) +@@ -383,5 +381,5 @@ test_invalid_patterns(void) @@ -41 +42 @@ -@@ -459,30 +457,4 @@ test_invalid_actions(void) +@@ -457,30 +455,4 @@ test_invalid_actions(void)