From: Dastin Wilski Date: Thu, 31 Mar 2022 09:55:09 +0000 (+0200) Subject: crypto: drop the frame if there is no handler X-Git-Tag: v22.10-rc0~168 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=8a4a7c216a7db3f06a2221290129aaba81a44bb9;p=vpp.git 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 --- 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))