diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-03-30 19:44:30 -0700 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-03-31 17:19:22 -0700 |
| commit | 8f45af945fce60c8656b5113d80af7fe221c88f5 (patch) | |
| tree | 0dd178cdf8e0737624519a3b0c1508281e41ff01 /net/ipv4/ipvs/git@git.tavy.me:linux.git | |
| parent | 1aa82df3eb4d1a28c02a9d0062c6ed0db1a59bac (diff) | |
lib/crypto: aesgcm: 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.
Link: https://lore.kernel.org/r/20260331024430.51755-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
