提交 372b2312 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net: use hlist_del_rcu() in dev_change_name()

Using plain hlist_del() in dev_change_name() is wrong since a
concurrent reader can crash trying to dereference LIST_POISON1.

Bug introduced in commit 72c9528b (net: Introduce
dev_get_by_name_rcu())
Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6f404e44
......@@ -1007,7 +1007,7 @@ int dev_change_name(struct net_device *dev, const char *newname)
}
write_lock_bh(&dev_base_lock);
hlist_del(&dev->name_hlist);
hlist_del_rcu(&dev->name_hlist);
write_unlock_bh(&dev_base_lock);
synchronize_rcu();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册