summaryrefslogtreecommitdiff
path: root/crypto/xts.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2022-05-04 17:07:36 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2022-05-13 17:24:48 +0800
commit5924aba1f50fe48ccb7d890098e13180a414d88c (patch)
tree984d66288755e37c2f7893e54b64f2767d04eb64 /crypto/xts.c
parent1102a510e1a2c04721d5bfeff8f2c70546d76289 (diff)
downloadlinux-crypto-5924aba1f50fe48ccb7d890098e13180a414d88c.tar.gz
linux-crypto-5924aba1f50fe48ccb7d890098e13180a414d88c.zip
crypto: cryptd - Protect per-CPU resource by disabling BH.
The access to cryptd_queue::cpu_queue is synchronized by disabling preemption in cryptd_enqueue_request() and disabling BH in cryptd_queue_worker(). This implies that access is allowed from BH. If cryptd_enqueue_request() is invoked from preemptible context _and_ soft interrupt then this can lead to list corruption since cryptd_enqueue_request() is not protected against access from soft interrupt. Replace get_cpu() in cryptd_enqueue_request() with local_bh_disable() to ensure BH is always disabled. Remove preempt_disable() from cryptd_queue_worker() since it is not needed because local_bh_disable() ensures synchronisation. Fixes: a045a18f0207 ("crypto: cryptd - Per-CPU thread implementation...") Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/xts.c')
0 files changed, 0 insertions, 0 deletions