diff options
| author | Eric Biggers <[email protected]> | 2024-08-05 18:27:13 +0000 |
|---|---|---|
| committer | Herbert Xu <[email protected]> | 2024-08-10 04:25:34 +0000 |
| commit | 001412493e74d89166d2441b622eeaea00511bdc (patch) | |
| tree | 1edeeb831b33f1e640d3534c4704c496df549640 /lib/crypto/mpi/mpi-mod.c | |
| parent | hwrng: cctrng - Add missing clk_disable_unprepare in cctrng_resume (diff) | |
| download | kernel-001412493e74d89166d2441b622eeaea00511bdc.tar.gz kernel-001412493e74d89166d2441b622eeaea00511bdc.zip | |
crypto: x86/aes-gcm - fix PREEMPT_RT issue in gcm_crypt()
On PREEMPT_RT, kfree() takes sleeping locks and must not be called with
preemption disabled. Therefore, on PREEMPT_RT skcipher_walk_done() must
not be called from within a kernel_fpu_{begin,end}() pair, even when
it's the last call which is guaranteed to not allocate memory.
Therefore, move the last skcipher_walk_done() in gcm_crypt() to the end
of the function so that it goes after the kernel_fpu_end(). To make
this work cleanly, rework the data processing loop to handle only
non-last data segments.
Fixes: b06affb1cb58 ("crypto: x86/aes-gcm - add VAES and AVX512 / AVX10 optimized AES-GCM")
Reported-by: Sebastian Andrzej Siewior <[email protected]>
Closes: https://lore.kernel.org/linux-crypto/[email protected]
Signed-off-by: Eric Biggers <[email protected]>
Tested-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions
