diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-03-30 19:44:14 -0700 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-03-31 17:19:15 -0700 |
| commit | 1aa82df3eb4d1a28c02a9d0062c6ed0db1a59bac (patch) | |
| tree | 6114408eb0c802c18e663fcf1036829ac51312fd /net/ipv4/ipvs/git@git.tavy.me:linux.git | |
| parent | d2a68aba8505ce88b39c34ecb3b707c776af79d4 (diff) | |
lib/crypto: aescfb: Don't disable IRQs during AES block encryption
aes_encrypt() now uses AES instructions when available instead of always
using table-based code. AES instructions are constant-time and don't
benefit from disabling IRQs as a constant-time hardening measure.
In fact, on two architectures (arm and riscv) disabling IRQs is
counterproductive because it prevents the AES instructions from being
used. (See the may_use_simd() implementation on those architectures.)
Therefore, let's remove the IRQ disabling/enabling and leave the choice
of constant-time hardening measures to the AES library code.
Note that currently the arm table-based AES code (which runs on arm
kernels that don't have ARMv8 CE) disables IRQs, while the generic
table-based AES code does not. So this does technically regress in
constant-time hardening when that generic code is used. But as
discussed in commit a22fd0e3c495 ("lib/crypto: aes: Introduce improved
AES library") I think just leaving IRQs enabled is the right choice.
Disabling them is slow and can cause problems, and AES instructions
(which modern CPUs have) solve the problem in a much better way anyway.
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20260331024414.51545-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'net/ipv4/ipvs/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
