From 8a4a7c216a7db3f06a2221290129aaba81a44bb9 Mon Sep 17 00:00:00 2001 From: Dastin Wilski Date: Thu, 31 Mar 2022 11:55:09 +0200 Subject: crypto: drop the frame if there is no handler If async engines are disbaled and async is turned on vpp tries to enqueue frame with nonexisting handler which leads to segfault. This patch checks for handler and drops the frame in case it doesn't exist. Type: fix Signed-off-by: Dastin Wilski Change-Id: I67211867ee29dc41cc9f0733e8e0b3ea86677f85 --- src/vnet/crypto/crypto.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vnet/crypto') diff --git a/src/vnet/crypto/crypto.h b/src/vnet/crypto/crypto.h index eb381187f29..e24ad1091f3 100644 --- a/src/vnet/crypto/crypto.h +++ b/src/vnet/crypto/crypto.h @@ -599,6 +599,12 @@ vnet_crypto_async_submit_open_frame (vlib_main_t * vm, frame->state = VNET_CRYPTO_FRAME_STATE_PENDING; frame->enqueue_thread_index = vm->thread_index; + if (PREDICT_FALSE (cm->enqueue_handlers == NULL)) + { + frame->state = VNET_CRYPTO_FRAME_STATE_ELT_ERROR; + return -1; + } + int ret = (cm->enqueue_handlers[frame->op]) (vm, frame); if (PREDICT_TRUE (ret == 0)) -- cgit 1.2.3-korg