From 6c9e0ea5a7663d9ebdfbcaadf61eaa3c9767caa4 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Fri, 24 Apr 2026 11:54:36 -0500 Subject: [PATCH] linuxkm/lkcapi_ecdsa_glue.c: in km_ecdsa_verify(), add checks on hash_len following pattern of #10131, before calling wc_ecc_verify_hash(), for defense-in-depth. --- linuxkm/lkcapi_ecdsa_glue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linuxkm/lkcapi_ecdsa_glue.c b/linuxkm/lkcapi_ecdsa_glue.c index 15113e6b1b..46469131e5 100644 --- a/linuxkm/lkcapi_ecdsa_glue.c +++ b/linuxkm/lkcapi_ecdsa_glue.c @@ -401,7 +401,9 @@ static int km_ecdsa_verify(struct akcipher_request *req) sig_len = req->src_len; hash_len = req->dst_len; - if (hash_len <= 0) { + if ((hash_len > WC_MAX_DIGEST_SIZE) || + (hash_len < WC_MIN_DIGEST_SIZE)) + { err = -EINVAL; goto ecdsa_verify_end; }