From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E19165F65 for ; Tue, 8 May 2018 10:31:22 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2018 01:31:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,377,1520924400"; d="scan'208";a="39280374" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga007.jf.intel.com with ESMTP; 08 May 2018 01:31:20 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 8 May 2018 01:31:20 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 8 May 2018 01:31:20 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.210]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.179]) with mapi id 14.03.0319.002; Tue, 8 May 2018 16:31:18 +0800 From: "Zhang, Qi Z" To: "Zhao1, Wei" , "adrien.mazarguil@6wind.com" CC: "Peng, Yuan" , "dev@dpdk.org" Thread-Topic: [PATCH] app/testpmd: fix invalid memory access Thread-Index: AQHT5ejaDM77h8ei40C1mZDJ/h9OlKQk2IEAgACpC/A= Date: Tue, 8 May 2018 08:31:17 +0000 Message-ID: <039ED4275CED7440929022BC67E70611531ADD91@SHSMSX103.ccr.corp.intel.com> References: <20180507095044.48038-1-qi.z.zhang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWE2NDhhMDAtNWYyMC00ZTAxLWI3ZjgtZDVhMTRmMTk3ODk3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI4RGlDbThkazB5SDZaSlFOMWY4ZmFzbjZIeEZSeUlZQ0g0RUs1eDV4OURLN2VXTnBsT2FsUU5TUFNEYlZGbTlCIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix invalid memory access 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: , X-List-Received-Date: Tue, 08 May 2018 08:31:23 -0000 Hi Zhao Wei: > -----Original Message----- > From: Zhao1, Wei > Sent: Tuesday, May 8, 2018 2:24 PM > To: Zhang, Qi Z ; adrien.mazarguil@6wind.com > Cc: Peng, Yuan ; dev@dpdk.org > Subject: RE: [PATCH] app/testpmd: fix invalid memory access >=20 > Hi, zhang qi > This fix patch to DPDK.or is also useful for igb flex byte core dump i= ssue. > I have validation it. But there is some patch check warning. > https://dpdk.org/dev/patchwork/patch/39417/ Thanks for testing, I will capture the typo if Adrien agree with the fix. Regards Qi >=20 >=20 >=20 > > -----Original Message----- > > From: Zhang, Qi Z > > Sent: Monday, May 7, 2018 5:51 PM > > To: adrien.mazarguil@6wind.com > > Cc: Peng, Yuan ; Zhao1, Wei > ; > > dev@dpdk.org; Zhang, Qi Z > > Subject: [PATCH] app/testpmd: fix invalid memory access > > > > When calulate memory size of an RTE_FLOW_ITEM_TYPE_RAW 's mask > > mask->length is not the real size of binary pattern, it should take > > spec->length, or memory size will be over counted (0xffff) and invalid > > memory be access during following memcpy. > > > > Fixes: d0ad8648b1c5 ("app/testpmd: fix RSS flow action configuration") > > > > Signed-off-by: Qi Zhang > > --- > > app/test-pmd/config.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > > 16fc481ce..bcaf429c4 100644 > > --- a/app/test-pmd/config.c > > +++ b/app/test-pmd/config.c > > @@ -1077,7 +1077,8 @@ flow_item_spec_copy(void *buf, const struct > > rte_flow_item *item, > > dst.raw =3D buf; > > off =3D RTE_ALIGN_CEIL(sizeof(struct rte_flow_item_raw), > > sizeof(*src.raw->pattern)); > > - size =3D off + src.raw->length * sizeof(*src.raw->pattern); > > + size =3D off + ((const struct rte_flow_item_raw *)item->spec)-> > > + length * sizeof(*src.raw->pattern); > > if (dst.raw) { > > memcpy(dst.raw, src.raw, sizeof(*src.raw)); > > dst.raw->pattern =3D memcpy((uint8_t *)dst.raw + off, > > -- > > 2.13.6