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 16185A04C1; Tue, 26 Nov 2019 10:04:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2085A2A5D; Tue, 26 Nov 2019 10:04:21 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C1A0428EE for ; Tue, 26 Nov 2019 10:04:19 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from matan@mellanox.com) with ESMTPS (AES256-SHA encrypted); 26 Nov 2019 11:04:14 +0200 Received: from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx [10.210.16.112]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xAQ94EMp004869; Tue, 26 Nov 2019 11:04:14 +0200 From: Matan Azrad To: dev@dpdk.org Cc: jackmin@mellanox.com Date: Tue, 26 Nov 2019 09:04:10 +0000 Message-Id: <1574759050-21879-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] ethdev: fix missed item expansion for RSS flow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When the last item in flow pattern includes "next protocol" field which is relevant for RSS flow expansion, a new item is added to the pattern according to the "next protocol" field. This field is called missed field. The missed field wrongly was not initialized what caused to some of the flow item fields to contain garbage values. As a result, the PMDs internal flow engine may crash. For example, the spec value may include garbage pointer and to cause crash. Initialize the missed field with zeroes. Fixes: fc2dd8dd492f ("ethdev: fix expand RSS flows") Cc: jackmin@mellanox.com Signed-off-by: Matan Azrad Acked-by: Ori Kam --- lib/librte_ethdev/rte_flow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c index d7f29e5..87a3e8c 100644 --- a/lib/librte_ethdev/rte_flow.c +++ b/lib/librte_ethdev/rte_flow.c @@ -1071,6 +1071,7 @@ enum rte_flow_conv_item_spec_type { int elt = 0; const struct rte_flow_item *last_item = NULL; + memset(&missed_item, 0, sizeof(missed_item)); lsize = offsetof(struct rte_flow_expand_rss, entry) + elt_n * sizeof(buf->entry[0]); if (lsize <= size) { -- 1.8.3.1