Skip to contentSkip to conversation

net: hsr: Pass lockdep expression to RCU lists

PATCH RESEND Applied Amol Grover 2 participants 2 messages Feb 19, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 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.

---
Resend:
- Remove failed delivery recipients

 net/hsr/hsr_framereg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/hsr/hsr_framereg.c +2 -1
index 27dc65d7de67..cc8fcfd3918d 100644
@@ -156,7 +156,8 @@ static struct hsr_node *hsr_add_node(struct hsr_priv *hsr,
 		new_node->seq_out[i] = seq_out;
 
 	spin_lock_bh(&hsr->list_lock);
-	list_for_each_entry_rcu(node, node_db, mac_list) {
+	list_for_each_entry_rcu(node, node_db, mac_list,
+				lockdep_is_held(&hsr->list_lock)) {
 		if (ether_addr_equal(node->macaddress_A, addr))
 			goto out;
 		if (ether_addr_equal(node->macaddress_B, addr))
Signature · 1 line
2.24.1
maintainer Applied
#1 lore raw

From: Amol Grover <[email protected]>
Date: Wed, 19 Feb 2020 15:30:11 +0530

Quoted 11 lines

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.

---
Resend:
- Remove failed delivery recipients

Applied.