DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: fix crypto_op length for sessionless case
@ 2021-06-30 12:46 Abhinandan Gujjar
  2021-07-02 17:08 ` Gujjar, Abhinandan S
  2021-07-07 14:07 ` [dpdk-dev] [EXT] " Akhil Goyal
  0 siblings, 2 replies; 11+ messages in thread
From: Abhinandan Gujjar @ 2021-06-30 12:46 UTC (permalink / raw)
  To: dev, jerinj; +Cc: gakhil, abhinandan.gujjar, ciara.power

Currently, private_data_offset for the sessionless is computed
wrongly which includes extra bytes added because of using
sizeof(struct rte_crypto_sym_xform) * 2) instead of
(sizeof(union rte_event_crypto_metadata)). Due to this buffer
overflow, the corruption was leading to test application
crash while freeing the ops mempool.

Fixes: 3c2c535ecfc0 ("test: add event crypto adapter auto-test")
Reported-by: ciara.power@intel.com

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 app/test/test_event_crypto_adapter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index f689bc1f2..688ac0b2f 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -229,7 +229,7 @@ test_op_forward_mode(uint8_t session_less)
 		first_xform = &cipher_xform;
 		sym_op->xform = first_xform;
 		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
-				(sizeof(struct rte_crypto_sym_xform) * 2);
+				(sizeof(union rte_event_crypto_metadata));
 		op->private_data_offset = len;
 		/* Fill in private data information */
 		rte_memcpy(&m_data.response_info, &response_info,
@@ -424,7 +424,7 @@ test_op_new_mode(uint8_t session_less)
 		first_xform = &cipher_xform;
 		sym_op->xform = first_xform;
 		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
-				(sizeof(struct rte_crypto_sym_xform) * 2);
+				(sizeof(union rte_event_crypto_metadata));
 		op->private_data_offset = len;
 		/* Fill in private data information */
 		rte_memcpy(&m_data.response_info, &response_info,
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-07-18  9:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 12:46 [dpdk-dev] [PATCH] test: fix crypto_op length for sessionless case Abhinandan Gujjar
2021-07-02 17:08 ` Gujjar, Abhinandan S
2021-07-02 23:26   ` Ferruh Yigit
2021-07-05  6:30     ` Gujjar, Abhinandan S
2021-07-06 16:09       ` Brandon Lo
2021-07-07 14:07 ` [dpdk-dev] [EXT] " Akhil Goyal
2021-07-08 14:12   ` Gujjar, Abhinandan S
2021-07-13  9:11     ` Akhil Goyal
2021-07-18  9:05       ` Gujjar, Abhinandan S
2021-07-18  9:22         ` Gujjar, Abhinandan S
2021-07-18  9:25           ` Akhil Goyal

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).