Skip to content

Commit 3110e40

Browse files
minipliherbertx
authored andcommitted
crypto: pcrypt - Fix wrong usage of rcu_dereference()
A kernel with enabled lockdep complains about the wrong usage of rcu_dereference() under a rcu_read_lock_bh() protected region. =============================== [ INFO: suspicious RCU usage. ] 3.13.0-rc1+ torvalds#126 Not tainted ------------------------------- linux/crypto/pcrypt.c:81 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 1, debug_locks = 1 1 lock held by cryptomgr_test/153: #0: (rcu_read_lock_bh){.+....}, at: [<ffffffff812c8075>] pcrypt_do_parallel.isra.2+0x5/0x200 Fix that by using rcu_dereference_bh() instead. Signed-off-by: Mathias Krause <[email protected]> Cc: "David S. Miller" <[email protected]> Acked-by: Steffen Klassert <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent fe8c8a1 commit 3110e40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/pcrypt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int pcrypt_do_parallel(struct padata_priv *padata, unsigned int *cb_cpu,
7878
cpu = *cb_cpu;
7979

8080
rcu_read_lock_bh();
81-
cpumask = rcu_dereference(pcrypt->cb_cpumask);
81+
cpumask = rcu_dereference_bh(pcrypt->cb_cpumask);
8282
if (cpumask_test_cpu(cpu, cpumask->mask))
8383
goto out;
8484

0 commit comments

Comments
 (0)