Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: hsr: Pass lockdep expression to RCU lists

node_db is traversed using list_for_each_entry_rcu
outside an RCU read-side critical section but under the protection
of hsr->list_lock.

Hence, add corresponding lockdep expression to silence false-positive
warnings, and harden RCU lists.

Signed-off-by: Amol Grover <frextrite@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Amol Grover and committed by
David S. Miller
a7a9456e 7822dee5

+2 -1
+2 -1
net/hsr/hsr_framereg.c
··· 155 155 new_node->seq_out[i] = seq_out; 156 156 157 157 spin_lock_bh(&hsr->list_lock); 158 - list_for_each_entry_rcu(node, node_db, mac_list) { 158 + list_for_each_entry_rcu(node, node_db, mac_list, 159 + lockdep_is_held(&hsr->list_lock)) { 159 160 if (ether_addr_equal(node->macaddress_A, addr)) 160 161 goto out; 161 162 if (ether_addr_equal(node->macaddress_B, addr))