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 71F36A04DD for ; Fri, 30 Oct 2020 08:28:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6938B2BDB; Fri, 30 Oct 2020 08:27:59 +0100 (CET) Received: from alln-iport-2.cisco.com (alln-iport-2.cisco.com [173.37.142.89]) by dpdk.org (Postfix) with ESMTP id 1C51D68C3; Fri, 30 Oct 2020 08:27:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2106; q=dns/txt; s=iport; t=1604042877; x=1605252477; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=8D0DgiTspiXIPBuj7hcqX/6CLZdHPUlKvdvmc+htq9k=; b=RhDBZRGip/BjzrtFy7zIkHUvGDLtdLxyVcPPENIr8LtRNV/0aVDR//eN AooujJ1mULbfFKwMBloQWD5D59LAfVosxKyiF532I1QWZ9KFchq4gT1Jg Q5z7SP588DOGLlLm2cE7q8qhhHv9+zb7Ge3wPX6fqU5ED+Jv2nff2sQ4S M=; X-IronPort-AV: E=Sophos;i="5.77,432,1596499200"; d="scan'208";a="597043038" Received: from alln-core-12.cisco.com ([173.36.13.134]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 30 Oct 2020 07:27:54 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-12.cisco.com (8.15.2/8.15.2) with ESMTP id 09U7RrDQ020701; Fri, 30 Oct 2020 07:27:54 GMT Received: by cisco.com (Postfix, from userid 508933) id A421120F2005; Fri, 30 Oct 2020 00:27:53 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, Hyong Youb Kim , stable@dpdk.org, John Daley Date: Fri, 30 Oct 2020 00:27:49 -0700 Message-Id: <20201030072749.29113-1-hyonkim@cisco.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-12.cisco.com Subject: [dpdk-stable] [PATCH] net/enic: fix header sizes when copying flow patterns 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" Several functions use sizeof(struct rte_flow_item_eth) and sizeof(struct rte_flow_item_ipv6) when copying headers. These sizes used to coincide with the sizes of rte_ether_hdr and rte_ipv6_hdr. But, with recently added fields, rte_flow_item_eth and rte_flow_item_ipv6 have grown in size. Use sizeof(rte_ether_hdr) and sizeof(rte_ipv6_hdr) instead. Coverity issue: 363572, 363573 Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API") Cc: stable@dpdk.org Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_fm_flow.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c index 9cea94269c..86b91ed8b1 100644 --- a/drivers/net/enic/enic_fm_flow.c +++ b/drivers/net/enic/enic_fm_flow.c @@ -368,8 +368,8 @@ enic_fm_copy_item_eth(struct copy_item_args *arg) fm_mask = &entry->ftm_mask.fk_hdrset[lvl]; fm_data->fk_header_select |= FKH_ETHER; fm_mask->fk_header_select |= FKH_ETHER; - memcpy(&fm_data->l2.eth, spec, sizeof(*spec)); - memcpy(&fm_mask->l2.eth, mask, sizeof(*mask)); + memcpy(&fm_data->l2.eth, spec, sizeof(struct rte_ether_hdr)); + memcpy(&fm_mask->l2.eth, mask, sizeof(struct rte_ether_hdr)); return 0; } @@ -479,8 +479,8 @@ enic_fm_copy_item_ipv6(struct copy_item_args *arg) fm_data->fk_header_select |= FKH_IPV6; fm_mask->fk_header_select |= FKH_IPV6; - memcpy(&fm_data->l3.ip6, spec, sizeof(*spec)); - memcpy(&fm_mask->l3.ip6, mask, sizeof(*mask)); + memcpy(&fm_data->l3.ip6, spec, sizeof(struct rte_ipv6_hdr)); + memcpy(&fm_mask->l3.ip6, mask, sizeof(struct rte_ipv6_hdr)); return 0; } @@ -1047,7 +1047,7 @@ enic_fm_copy_vxlan_encap(struct enic_flowman *fm, eth = (struct rte_ether_hdr *)template; ethertype = ð->ether_type; append_template(&template, &off, item->spec, - sizeof(struct rte_flow_item_eth)); + sizeof(struct rte_ether_hdr)); item++; flow_item_skip_void(&item); /* Optional VLAN */ -- 2.26.2