瀏覽代碼

[BRIDGE]: Missing rtnl.

Writing to /sys/class/net/brX/bridge/stp_state causes a warning because
RTNL is not held when call br_stp_if.c

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger 18 年之前
父節點
當前提交
98486fa2f4
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      net/bridge/br_sysfs_br.c

+ 2 - 0
net/bridge/br_sysfs_br.c

@@ -149,9 +149,11 @@ static ssize_t show_stp_state(struct device *d,
 
 static void set_stp_state(struct net_bridge *br, unsigned long val)
 {
+	rtnl_lock();
 	spin_unlock_bh(&br->lock);
 	br_stp_set_enabled(br, val);
 	spin_lock_bh(&br->lock);
+	rtnl_unlock();
 }
 
 static ssize_t store_stp_state(struct device *d,