From: Herbert Xu Date: Thu, 7 Dec 2023 10:36:57 +0000 (+0800) Subject: crypto: api - Disallow identical driver names X-Git-Tag: v6.6.15~293 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1a67a0d1ace6201777be0234b13d06f42a889af;p=thirdparty%2Fkernel%2Fstable.git crypto: api - Disallow identical driver names commit 27016f75f5ed47e2d8e0ca75a8ff1f40bc1a5e27 upstream. Disallow registration of two algorithms with identical driver names. Cc: Reported-by: Ovidiu Panait Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- diff --git a/crypto/algapi.c b/crypto/algapi.c index 4fe95c4480473..85bc279b4233f 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -341,6 +341,7 @@ __crypto_register_alg(struct crypto_alg *alg, struct list_head *algs_to_put) } if (!strcmp(q->cra_driver_name, alg->cra_name) || + !strcmp(q->cra_driver_name, alg->cra_driver_name) || !strcmp(q->cra_name, alg->cra_driver_name)) goto err; }