Skip to content
Commit 877ccce7 authored by Ondrej Mosnacek's avatar Ondrej Mosnacek Committed by Herbert Xu
Browse files

crypto: x86/aegis,morus - Fix and simplify CPUID checks

It turns out I had misunderstood how the x86_match_cpu() function works.
It evaluates a logical OR of the matching conditions, not logical AND.
This caused the CPU feature checks for AEGIS to pass even if only SSE2
(but not AES-NI) was supported (or vice versa), leading to potential
crashes if something tried to use the registered algs.

This patch switches the checks to a simpler method that is used e.g. in
the Camellia x86 code.

The patch also removes the MODULE_DEVICE_TABLE declarations which
actually seem to cause the modules to be auto-loaded at boot, which is
not desired. The crypto API on-demand module loading is sufficient.

Fixes: 1d373d4e ("crypto: x86 - Add optimized AEGIS implementations")
Fixes: 6ecc9d9f

 ("crypto: x86 - Add optimized MORUS implementations")
Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
Tested-by: default avatarMilan Broz <gmazyland@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f10dc56c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment