From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B87C3A034F; Mon, 11 Oct 2021 10:05:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F56140E0F; Mon, 11 Oct 2021 10:05:34 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 8895940E01 for ; Mon, 11 Oct 2021 10:05:32 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10133"; a="224232583" X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="224232583" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 01:05:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="591241715" Received: from silpixa00401012.ir.intel.com ([10.243.22.70]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2021 01:05:25 -0700 From: Przemyslaw Zegan To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, Przemyslaw Zegan , pablo.de.lara.guarch@intel.com Date: Mon, 11 Oct 2021 08:04:52 +0000 Message-Id: <20211011080452.2710095-1-przemyslawx.zegan@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210922101511.10395-1-przemyslawx.zegan@intel.com> References: <20210922101511.10395-1-przemyslawx.zegan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [dpdk-dev v3] app: fix buffer overrun X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" This patch fixes a possible buffer overrun problem in crypto perf test. Previously when user configured aad size is over 12 bytes the copy of template aad will cause a buffer overrun. The problem is fixed by only copy up to 12 bytes of aad template. Fixes: 8a5b494a7f99 ("app/test-crypto-perf: add AEAD parameters") Cc: pablo.de.lara.guarch@intel.com Signed-off-by: Przemyslaw Zegan --- v3: - replaced hardcoded values by sizeof(aad) app/test-crypto-perf/cperf_test_vectors.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c index 2c7e314ec8..271e91c13c 100644 --- a/app/test-crypto-perf/cperf_test_vectors.c +++ b/app/test-crypto-perf/cperf_test_vectors.c @@ -555,8 +555,8 @@ cperf_test_vector_get_dummy(struct cperf_options *options) return NULL; } - if(options->aead_aad_sz > 12) - options->aead_aad_sz = 12; + if(options->aead_aad_sz > sizeof(aad)) + options->aead_aad_sz = sizeof(aad); memcpy(t_vec->aad.data, aad, options->aead_aad_sz); t_vec->aad.phys_addr = rte_malloc_virt2iova(t_vec->aad.data); -- 2.30.2