Sebastian Andrzej Siewior 91e8bcd7b4 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: 254eff771441 ("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>
2022-05-13 17:24:48 +08:00
..
2022-03-03 10:49:20 +12:00
2020-08-28 16:58:28 +10:00
2022-03-03 10:49:20 +12:00
2021-03-26 19:55:55 +11:00
2022-02-18 16:21:08 +11:00
2020-02-28 08:43:21 +08:00
2021-08-21 15:44:58 +08:00
2022-03-03 10:49:20 +12:00
2022-04-08 16:12:46 +08:00
2022-03-26 12:01:35 -07:00
2022-02-18 16:21:08 +11:00
2021-11-08 16:55:21 -08:00