Commit 5c42a30
crypto: x86/aes-gcm - fix PREEMPT_RT issue in gcm_crypt()
[ Upstream commit 0014124 ]
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: b06affb ("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]>
Signed-off-by: Sasha Levin <[email protected]>1 parent f65c8ae commit 5c42a30
1 file changed
Lines changed: 28 additions & 31 deletions
| Original file line number | Diff line number | Diff line change |
|---|
0 commit comments