From patchwork Wed Jun 28 09:31:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 25891 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 0E8664C57; Wed, 28 Jun 2017 19:30:49 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 83DF62C8; Wed, 28 Jun 2017 19:30:47 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 28 Jun 2017 10:30:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,276,1496127600"; d="scan'208";a="118499064" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by orsmga005.jf.intel.com with ESMTP; 28 Jun 2017 10:30:44 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: Pablo de Lara , stable@dpdk.org Date: Wed, 28 Jun 2017 10:31:03 +0100 Message-Id: <20170628093103.31763-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 Subject: [dpdk-dev] [PATCH] test/crypto: fix overflow 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" In one of the SNOW3G unit tests, insufficient memory was allocated, leading to a buffer overflow. Fixes: 2b52e1e95aab ("app/test: add SNOW 3G UEA2 with offset") CC: stable@dpdk.org Signed-off-by: Pablo de Lara --- test/test/test_cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index eed7385..7e74990 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -3581,7 +3581,7 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata) #endif expected_ciphertext_shifted = rte_malloc(NULL, - ceil_byte_length(plaintext_len + extra_offset), 0); + ceil_byte_length(plaintext_len * 8 + extra_offset), 0); TEST_ASSERT_NOT_NULL(expected_ciphertext_shifted, "failed to reserve memory for ciphertext shifted\n");