Patch "net: macvlan: Use built-in RCU list checking" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: macvlan: Use built-in RCU list checking

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-macvlan-use-built-in-rcu-list-checking.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 57208393bccd88b5270033b6799d140bbffcd8c9
Author: Chuang Wang <nashuiliang@xxxxxxxxx>
Date:   Fri Nov 11 09:41:30 2022 +0800

    net: macvlan: Use built-in RCU list checking
    
    [ Upstream commit 5df1341ea822292275c56744aab9c536d75c33be ]
    
    hlist_for_each_entry_rcu() has built-in RCU and lock checking.
    
    Pass cond argument to hlist_for_each_entry_rcu() to silence false
    lockdep warning when CONFIG_PROVE_RCU_LIST is enabled.
    
    Execute as follow:
    
     ip link add link eth0 type macvlan mode source macaddr add <MAC-ADDR>
    
    The rtnl_lock is held when macvlan_hash_lookup_source() or
    macvlan_fill_info_macaddr() are called in the non-RCU read side section.
    So, pass lockdep_rtnl_is_held() to silence false lockdep warning.
    
    Fixes: 79cf79abce71 ("macvlan: add source mode")
    Signed-off-by: Chuang Wang <nashuiliang@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index cdc238dda1e1..7fb0ead7b1ef 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -141,7 +141,7 @@ static struct macvlan_source_entry *macvlan_hash_lookup_source(
 	u32 idx = macvlan_eth_hash(addr);
 	struct hlist_head *h = &vlan->port->vlan_source_hash[idx];
 
-	hlist_for_each_entry_rcu(entry, h, hlist) {
+	hlist_for_each_entry_rcu(entry, h, hlist, lockdep_rtnl_is_held()) {
 		if (ether_addr_equal_64bits(entry->addr, addr) &&
 		    entry->vlan == vlan)
 			return entry;
@@ -1635,7 +1635,7 @@ static int macvlan_fill_info_macaddr(struct sk_buff *skb,
 	struct hlist_head *h = &vlan->port->vlan_source_hash[i];
 	struct macvlan_source_entry *entry;
 
-	hlist_for_each_entry_rcu(entry, h, hlist) {
+	hlist_for_each_entry_rcu(entry, h, hlist, lockdep_rtnl_is_held()) {
 		if (entry->vlan != vlan)
 			continue;
 		if (nla_put(skb, IFLA_MACVLAN_MACADDR, ETH_ALEN, entry->addr))



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux