]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: simd - reject compat registrations without __ prefixes
authorWesley Atwell <atwellwea@gmail.com>
Mon, 9 Mar 2026 04:31:43 +0000 (22:31 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 21 Mar 2026 08:34:30 +0000 (17:34 +0900)
commite0ce97f781c78b717b00493630a9e34caf04f79b
tree34bb27117a1474e6e88eb20a9f98df62e0077404
parentc708d3fad4217f23421b8496e231b0c5cee617a0
crypto: simd - reject compat registrations without __ prefixes

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@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/simd.c