From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 39020E07 for ; Thu, 7 Apr 2016 15:57:10 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 07 Apr 2016 06:57:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,449,1455004800"; d="scan'208";a="80896634" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga004.fm.intel.com with ESMTP; 07 Apr 2016 06:57:10 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.19]) by IRSMSX103.ger.corp.intel.com ([169.254.3.239]) with mapi id 14.03.0248.002; Thu, 7 Apr 2016 14:57:08 +0100 From: "Kulasek, TomaszX" To: "De Lara Guarch, Pablo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] app/test: fix array subscript is above array bounds for gcc 4.5 Thread-Index: AQHRkM7pHBGFH1Cgrky8yjtla3+D659+bKWAgAAcPXA= Date: Thu, 7 Apr 2016 13:57:07 +0000 Message-ID: <3042915272161B4EB253DA4D77EB373A14E7DEC9@IRSMSX102.ger.corp.intel.com> References: <1460034450-9360-1-git-send-email-tomaszx.kulasek@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/test: fix array subscript is above array bounds for gcc 4.5 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2016 13:57:10 -0000 > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Thursday, April 7, 2016 15:15 > To: Kulasek, TomaszX ; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] app/test: fix array subscript is above > array bounds for gcc 4.5 >=20 >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tomasz Kulasek > > Sent: Thursday, April 07, 2016 2:07 PM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH] app/test: fix array subscript is above > > array bounds for gcc 4.5 > > > > cc1: warnings being treated as errors > > DPDK/app/test/test_cryptodev.c: In function > > 'test_snow3g_encrypted_authenti > > cation.clone.3': > > DPDK/x86_64-ivshmem-linuxapp-gcc/include/rte_memcpy.h:796:14: error: > > array > > subscript is above array bounds > > compilation terminated due to -Wfatal-errors. > > > > > > ROOT OF PROBLEM: > > ---------------- > > > > In lines like: > > > > rte_memcpy(sym_op->cipher.iv.data, iv, iv_len); > > > > when "iv" is 64 bytes long array, and "iv_len" is "unsigned int", > > compiler tries to evaluate also a code for array size larger than 255 > > bytes long and reports error "array subscript is above array bounds" in > line: > > > > rte_memcpy.h:796 > > > > rte_mov128((uint8_t *)dst + 128, (const uint8_t *)src + 128); > > > > caused by evaluation to: > > > > rte_mov128((uint8_t *)sym_op->cipher.iv.data + 128, (const uint8_t > *)iv > > + 128); > > > > where "iv" is 64 bytes long buffer and "iv + 128" point out of it, gcc > 4.5. > > > > > > SOLUTION: > > --------- > > > > Using uint8_t as a size of copied block prevents to evaluate in > > rte_memcpy code for size bigger than 255, causing the problem. > > > > >=20 > Don't forget to include the "Fixes" line. > Thanks, > Pablo >=20 > > Signed-off-by: Tomasz Kulasek > > --- > > app/test/test_cryptodev.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) Ok. I'm sending v2 Tomasz.