aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDastin Wilski <dastin.wilski@gmail.com>2022-03-31 11:55:09 +0200
committerDastin Wilski <dastin.wilski@gmail.com>2022-03-31 11:55:09 +0200
commit8a4a7c216a7db3f06a2221290129aaba81a44bb9 (patch)
tree24e101ef563793380abc26b53decdb8d89c16050 /src
parentd918cc54eb5f178ccf81dc2463d176cffcd63df1 (diff)
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 <dastin.wilski@gmail.com> Change-Id: I67211867ee29dc41cc9f0733e8e0b3ea86677f85
Diffstat (limited to 'src')
-rw-r--r--src/vnet/crypto/crypto.h6
1 files changed, 6 insertions, 0 deletions
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))