Re: [PATCH] crypto: simd - reject compat registrations without __ prefixes

From: Herbert Xu

Date: Sat Mar 21 2026 - 04:42:00 EST


On Sun, Mar 08, 2026 at 10:31:43PM -0600, Wesley Atwell wrote:
> simd_register_skciphers_compat() and simd_register_aeads_compat()
> derive the wrapper algorithm names by stripping the __ prefix from the
> internal algorithm names.
>
> Currently they only WARN if cra_name or cra_driver_name lacks that prefix,
> but they still continue and unconditionally add 2 to both strings. That
> registers wrapper algorithms with incorrectly truncated names after a
> violated precondition.
>
> Reject such inputs with -EINVAL before registering anything, while keeping
> the warning so invalid internal API usage is still visible.
>
> Fixes: d14f0a1fc488 ("crypto: simd - allow registering multiple algorithms at once")
> Fixes: 1661131a0479 ("crypto: simd - support wrapping AEAD algorithms")
> Assisted-by: Codex:GPT-5
> Signed-off-by: Wesley Atwell <atwellwea@xxxxxxxxx>
> ---
> crypto/simd.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt