DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: dev@dpdk.org
Cc: Pablo de Lara <pablo.de.lara.guarch@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] test/crypto: fix overflow
Date: Wed, 28 Jun 2017 10:31:03 +0100	[thread overview]
Message-ID: <20170628093103.31763-1-pablo.de.lara.guarch@intel.com> (raw)

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 <pablo.de.lara.guarch@intel.com>
---
 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");
-- 
2.9.4

             reply	other threads:[~2017-06-28 17:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28  9:31 Pablo de Lara [this message]
2017-06-28 17:57 ` De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170628093103.31763-1-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).